Bug 1425704 Fix nullptr deref in android-only Clients.openWindow() when browser is not running. r=asuth
authorBen Kelly <ben@wanderview.com>
Mon, 18 Dec 2017 11:55:18 -0500
changeset 448489 332dc60a05c2be6783adbb42312c77367e5d49b9
parent 448488 59658470f635a138beced3e78c8eeea5a45a571a
child 448490 bb89831b9aadfc4b6d736b89d781a5c04b35f369
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersasuth
bugs1425704
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1425704 Fix nullptr deref in android-only Clients.openWindow() when browser is not running. r=asuth
dom/clients/manager/ClientOpenWindowUtils.cpp
--- a/dom/clients/manager/ClientOpenWindowUtils.cpp
+++ b/dom/clients/manager/ClientOpenWindowUtils.cpp
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ClientOpenWindowUtils.h"
 
 #include "ClientInfo.h"
 #include "ClientState.h"
+#include "mozilla/SystemGroup.h"
 #include "nsContentUtils.h"
 #include "nsIBrowserDOMWindow.h"
 #include "nsIDocShell.h"
 #include "nsIDOMChromeWindow.h"
 #include "nsIURI.h"
 #include "nsIWebProgress.h"
 #include "nsIWebProgressListener.h"
 #include "nsIWindowWatcher.h"
@@ -420,17 +421,17 @@ ClientOpenWindowInCurrentProcess(const C
   nsresult rv = OpenWindow(aArgs, getter_AddRefs(outerWindow));
 
 #ifdef MOZ_WIDGET_ANDROID
   // If we get the NOT_AVAILABLE error that means the browser is still
   // launching on android.  Use the observer we created above to wait
   // until the launch completes and then try to open the window again.
   if (rv == NS_ERROR_NOT_AVAILABLE && launchObserver) {
     RefPtr<GenericPromise> p = launchObserver->Promise();
-    p->Then(outerWindow->EventTargetFor(TaskCategory::Other), __func__,
+    p->Then(SystemGroup::EventTargetFor(TaskCategory::Other), __func__,
       [aArgs, promise] (bool aResult) {
         nsCOMPtr<nsPIDOMWindowOuter> outerWindow;
         nsresult rv = OpenWindow(aArgs, getter_AddRefs(outerWindow));
         if (NS_WARN_IF(NS_FAILED(rv))) {
           promise->Reject(rv, __func__);
         }
 
         WaitForLoad(aArgs, outerWindow, promise);