From 40a355a42d4a9444dc753c04c6608dade2f06a23 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:13:27 +0200 Subject: Adding upstream version 125.0.1. Signed-off-by: Daniel Baumann --- dom/ipc/BrowserParent.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'dom/ipc/BrowserParent.cpp') diff --git a/dom/ipc/BrowserParent.cpp b/dom/ipc/BrowserParent.cpp index d369556588..5d13d2e814 100644 --- a/dom/ipc/BrowserParent.cpp +++ b/dom/ipc/BrowserParent.cpp @@ -1322,8 +1322,20 @@ mozilla::ipc::IPCResult BrowserParent::RecvPDocAccessibleConstructor( #endif already_AddRefed BrowserParent::AllocPFilePickerParent( - const nsString& aTitle, const nsIFilePicker::Mode& aMode) { - return MakeAndAddRef(aTitle, aMode); + const nsString& aTitle, const nsIFilePicker::Mode& aMode, + const MaybeDiscarded& aBrowsingContext) { + RefPtr browsingContext = + [&]() -> CanonicalBrowsingContext* { + if (aBrowsingContext.IsNullOrDiscarded()) { + return nullptr; + } + if (!aBrowsingContext.get_canonical()->IsOwnedByProcess( + Manager()->ChildID())) { + return nullptr; + } + return aBrowsingContext.get_canonical(); + }(); + return MakeAndAddRef(aTitle, aMode, browsingContext); } already_AddRefed -- cgit v1.2.3