Bug 1596687 - Allow Navigator.share in non-e10s mode r=marcosc
authorKagami Sascha Rosylight <saschanaz@outlook.com>
Mon, 09 Dec 2019 03:38:28 +0000
changeset 568150 8a285497c16992995f515e43166432b0c765ea72
parent 568149 aa07114fb54ab1f7b819522f45563cb83f6b637e
child 568151 34290818201544f24c764d4bbd9e7020b559ce12
push id12493
push userffxbld-merge
push dateMon, 06 Jan 2020 15:38:57 +0000
treeherdermozilla-beta@63ae456b848d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarcosc
bugs1596687
milestone73.0a1
first release with
nightly linux32
8a285497c169 / 73.0a1 / 20191209095039 / files
nightly linux64
8a285497c169 / 73.0a1 / 20191209095039 / files
nightly mac
8a285497c169 / 73.0a1 / 20191209095039 / files
nightly win32
8a285497c169 / 73.0a1 / 20191209095039 / files
nightly win64
8a285497c169 / 73.0a1 / 20191209095039 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1596687 - Allow Navigator.share in non-e10s mode r=marcosc Differential Revision: https://phabricator.services.mozilla.com/D53161
dom/ipc/WindowGlobalParent.cpp
--- a/dom/ipc/WindowGlobalParent.cpp
+++ b/dom/ipc/WindowGlobalParent.cpp
@@ -396,24 +396,23 @@ mozilla::ipc::IPCResult WindowGlobalPare
       do_GetService("@mozilla.org/sharepicker;1");
   if (!sharePicker) {
     aResolver(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
     return IPC_OK();
   }
 
   // Initialize the ShareWidget
   RefPtr<BrowserParent> parent = GetBrowserParent();
-  if (NS_WARN_IF(!parent)) {
-    aResolver(NS_ERROR_FAILURE);
-    return IPC_OK();
-  }
-  nsCOMPtr<mozIDOMWindowProxy> openerWindow = parent->GetParentWindowOuter();
-  if (!openerWindow) {
-    aResolver(NS_ERROR_FAILURE);
-    return IPC_OK();
+  nsCOMPtr<mozIDOMWindowProxy> openerWindow;
+  if (parent) {
+    openerWindow = parent->GetParentWindowOuter();
+    if (!openerWindow) {
+      aResolver(NS_ERROR_FAILURE);
+      return IPC_OK();
+    }
   }
   sharePicker->Init(openerWindow);
 
   // And finally share the data...
   RefPtr<Promise> promise;
   nsresult rv = sharePicker->Share(aData.title(), aData.text(), aData.url(),
                                    getter_AddRefs(promise));
   if (NS_FAILED(rv)) {