Bug 1523982 - Part 3: Don't raise an error in observe if creation of our actor was vetoed, r=nika
authorJohn Dai <jdai@mozilla.com>
Tue, 26 Mar 2019 15:19:56 +0000
changeset 466115 06a189e6b675149d77a254e6e4678c9c898d3158
parent 466114 1d112c578b34f040b662e5d602bb2663f6191259
child 466116 54f0ce4913e043c1eddbb18704a2f0d1d4d1c4d5
push id81453
push userjdai@mozilla.com
push dateTue, 26 Mar 2019 16:52:49 +0000
treeherderautoland@54f0ce4913e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1523982
milestone68.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 1523982 - Part 3: Don't raise an error in observe if creation of our actor was vetoed, r=nika Depends on D24204 Differential Revision: https://phabricator.services.mozilla.com/D24205
dom/ipc/JSWindowActorService.cpp
--- a/dom/ipc/JSWindowActorService.cpp
+++ b/dom/ipc/JSWindowActorService.cpp
@@ -308,17 +308,23 @@ NS_IMETHODIMP JSWindowActorProtocol::Obs
   if (NS_WARN_IF(!wgc)) {
     return NS_ERROR_FAILURE;
   }
 
   // Ensure our actor is present.
   ErrorResult error;
   RefPtr<JSWindowActorChild> actor = wgc->GetActor(mName, error);
   if (NS_WARN_IF(error.Failed())) {
-    return error.StealNSResult();
+    nsresult rv = error.StealNSResult();
+
+    // Don't raise an error if creation of our actor was vetoed.
+    if (rv == NS_ERROR_NOT_AVAILABLE) {
+      return NS_OK;
+    }
+    return rv;
   }
 
   // Get the wrapper for our actor. If we don't have a wrapper, the target
   // method won't be defined on it. so there's no reason to continue.
   JS::Rooted<JSObject*> obj(RootingCx(), actor->GetWrapper());
   if (NS_WARN_IF(!obj)) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }