merge mozilla-central to autoland. r=merge a=merge
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 24 Oct 2017 23:59:14 +0200
changeset 685838 ef024b6a452b77fb399a654f90fdb35aa8e61c64
parent 685837 0adee90257d82b3e4e15b3b1122d1111f5dc72eb (current diff)
parent 685608 a124f4901430f6db74cfc7fe3b07957a1c691b40 (diff)
child 685839 c4403a6818cb40608ae9e5c3f4af6891e728c7e9
push id86016
push userkgupta@mozilla.com
push dateWed, 25 Oct 2017 01:53:44 +0000
reviewersmerge, merge
milestone58.0a1
merge mozilla-central to autoland. r=merge a=merge
dom/html/test/test_document.watch.html
dom/svg/crashtests/880544-1.svg
dom/svg/crashtests/880544-2.svg
dom/svg/crashtests/880544-3.svg
dom/svg/crashtests/880544-4.svg
dom/svg/crashtests/880544-5.svg
dom/tests/mochitest/bugs/iframe_bug38959-1.html
dom/tests/mochitest/bugs/iframe_bug38959-2.html
dom/tests/mochitest/bugs/test_bug38959.html
editor/libeditor/HTMLEditRules.cpp
editor/libeditor/crashtests/crashtests.list
ipc/glue/nsIIPCBackgroundChildCreateCallback.h
js/src/jit-test/tests/auto-regress/bug466654.js
js/src/jit-test/tests/auto-regress/bug516897.js
js/src/jit-test/tests/auto-regress/bug537854.js
js/src/jit-test/tests/auto-regress/bug560796.js
js/src/jit-test/tests/auto-regress/bug639413.js
js/src/jit-test/tests/auto-regress/bug698899.js
js/src/jit-test/tests/auto-regress/bug746397.js
js/src/jit-test/tests/auto-regress/bug769192.js
js/src/jit-test/tests/baseline/bug843444.js
js/src/jit-test/tests/basic/bug510437.js
js/src/jit-test/tests/basic/bug605015.js
js/src/jit-test/tests/basic/bug631305.js
js/src/jit-test/tests/basic/bug662562.js
js/src/jit-test/tests/basic/bug690292.js
js/src/jit-test/tests/basic/bug831846.js
js/src/jit-test/tests/basic/testAssigningWatchedDeletedProperty.js
js/src/jit-test/tests/basic/testBug566556.js
js/src/jit-test/tests/basic/testBug578044.js
js/src/jit-test/tests/basic/testBug584650.js
js/src/jit-test/tests/basic/testBug780288-1.js
js/src/jit-test/tests/basic/testBug780288-2.js
js/src/jit-test/tests/basic/testEvalCalledFromWatchOverSetter.js
js/src/jit-test/tests/basic/testNonStubGetter.js
js/src/jit-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js
js/src/jit-test/tests/basic/testTrueShiftTrue.js
js/src/jit-test/tests/basic/testWatchRecursion.js
js/src/jit-test/tests/cacheir/bug1350171.js
js/src/jit-test/tests/gc/bug-900405.js
js/src/jit-test/tests/gc/bug-913261.js
js/src/jit-test/tests/gc/bug-986864.js
js/src/jit-test/tests/ion/bug1063182.js
js/src/jit-test/tests/ion/bug774257-1.js
js/src/jit-test/tests/ion/bug774257-2.js
js/src/jit-test/tests/ion/bug779631.js
js/src/jit-test/tests/jaeger/bug550665.js
js/src/jit-test/tests/jaeger/bug557063.js
js/src/jit-test/tests/jaeger/bug625438.js
js/src/jit-test/tests/jaeger/bug630366.js
js/src/jit-test/tests/pic/fuzz1.js
js/src/jit-test/tests/pic/fuzz3.js
js/src/jit-test/tests/pic/watch1.js
js/src/jit-test/tests/pic/watch1a.js
js/src/jit-test/tests/pic/watch2.js
js/src/jit-test/tests/pic/watch2a.js
js/src/jit-test/tests/pic/watch3.js
js/src/jit-test/tests/pic/watch3a.js
js/src/jit-test/tests/pic/watch3b.js
js/src/jit-test/tests/pic/watch4.js
js/src/jit-test/tests/pic/watch5.js
js/src/jit-test/tests/profiler/bug1140643.js
js/src/jswatchpoint.cpp
js/src/jswatchpoint.h
js/src/tests/ecma_5/extensions/watch-array-length.js
js/src/tests/ecma_5/extensions/watch-inherited-property.js
js/src/tests/ecma_5/extensions/watch-replaced-setter.js
js/src/tests/ecma_5/extensions/watch-setter-become-setter.js
js/src/tests/ecma_5/extensions/watch-value-prop-becoming-setter.js
js/src/tests/ecma_5/extensions/watchpoint-deletes-JSPropertyOp-setter.js
js/src/tests/js1_2/Objects/watch-deprecated.js
js/src/tests/js1_5/Object/regress-362872-01.js
js/src/tests/js1_5/Object/regress-362872-02.js
js/src/tests/js1_5/Regress/regress-127243.js
js/src/tests/js1_5/Regress/regress-213482.js
js/src/tests/js1_5/Regress/regress-240577.js
js/src/tests/js1_5/Regress/regress-355341.js
js/src/tests/js1_5/Regress/regress-355344.js
js/src/tests/js1_5/Regress/regress-361467.js
js/src/tests/js1_5/Regress/regress-361617.js
js/src/tests/js1_5/Regress/regress-385393-06.js
js/src/tests/js1_5/Regress/regress-506567.js
js/src/tests/js1_5/extensions/regress-303277.js
js/src/tests/js1_5/extensions/regress-355339.js
js/src/tests/js1_5/extensions/regress-361346.js
js/src/tests/js1_5/extensions/regress-361360.js
js/src/tests/js1_5/extensions/regress-361552.js
js/src/tests/js1_5/extensions/regress-361558.js
js/src/tests/js1_5/extensions/regress-361571.js
js/src/tests/js1_5/extensions/regress-361856.js
js/src/tests/js1_5/extensions/regress-361964.js
js/src/tests/js1_5/extensions/regress-385134.js
js/src/tests/js1_5/extensions/regress-385393-09.js
js/src/tests/js1_5/extensions/regress-390597.js
js/src/tests/js1_5/extensions/regress-420612.js
js/src/tests/js1_5/extensions/regress-435345-01.js
js/src/tests/js1_5/extensions/regress-454040.js
js/src/tests/js1_5/extensions/regress-454142.js
js/src/tests/js1_5/extensions/regress-455413.js
js/src/tests/js1_5/extensions/regress-465145.js
js/src/tests/js1_5/extensions/regress-472787.js
js/src/tests/js1_5/extensions/regress-488995.js
js/src/tests/js1_6/Regress/regress-476655.js
js/src/tests/js1_6/extensions/regress-457521.js
js/src/tests/js1_6/extensions/regress-479567.js
js/src/tests/js1_7/extensions/regress-453955.js
js/src/tests/js1_7/extensions/regress-473282.js
js/src/tests/js1_7/regress/regress-385133-01.js
js/src/tests/js1_8/extensions/regress-394709.js
js/src/tests/js1_8/extensions/regress-481989.js
js/src/tests/js1_8_1/extensions/regress-452498-193.js
js/src/tests/js1_8_1/extensions/regress-520572.js
js/src/tests/js1_8_5/extensions/regress-604781-1.js
js/src/tests/js1_8_5/extensions/regress-604781-2.js
js/src/tests/js1_8_5/extensions/regress-627984-1.js
js/src/tests/js1_8_5/extensions/regress-627984-2.js
js/src/tests/js1_8_5/extensions/regress-627984-3.js
js/src/tests/js1_8_5/extensions/regress-627984-4.js
js/src/tests/js1_8_5/extensions/regress-627984-5.js
js/src/tests/js1_8_5/extensions/regress-627984-6.js
js/src/tests/js1_8_5/extensions/regress-627984-7.js
js/src/tests/js1_8_5/extensions/regress-631723.js
js/src/tests/js1_8_5/extensions/regress-636697.js
js/src/tests/js1_8_5/extensions/regress-637985.js
js/src/tests/js1_8_5/extensions/regress-691746.js
js/src/tests/js1_8_5/extensions/watch-undefined-setter.js
js/src/tests/js1_8_5/regress/regress-533876.js
js/src/tests/js1_8_5/regress/regress-548276.js
js/src/tests/js1_8_5/regress/regress-584648.js
js/src/tests/js1_8_5/regress/regress-635195.js
js/src/tests/js1_8_5/regress/regress-636394.js
js/src/tests/test262/intl402/Intl/getCanonicalLocales/success_cases.js
js/src/tests/test262/language/arguments-object/S10.1.6_A1_T3.js
js/src/tests/test262/language/statements/let/syntax/identifier-let-allowed-as-lefthandside-expression-non-strict.js
js/xpconnect/tests/chrome/test_watchpoints.xul
netwerk/base/nsIOService.cpp
python/mozboot/mozboot/gentoo.py
testing/web-platform/meta/eventsource/format-field-id-null.htm.ini
toolkit/components/telemetry/Histograms.json
--- a/CLOBBER
+++ b/CLOBBER
@@ -17,9 +17,9 @@
 #
 # Modifying this file will now automatically clobber the buildbot machines \o/
 #
 
 # Are you updating CLOBBER because you think it's needed for your WebIDL
 # changes to stick? As of bug 928195, this shouldn't be necessary! Please
 # don't change CLOBBER for WebIDL changes any more.
 
-Merge day clobber
+Bug 1409329 works better after a clobber.
--- a/accessible/tests/crashtests/471493.xul
+++ b/accessible/tests/crashtests/471493.xul
@@ -1,29 +1,49 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
 
 <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         title="bug 471493 'crash [@ nsPropertyTable::GetPropertyInternal]'"
-        onload="doTest();">
+        onload="doTest();" class="reftest-wait">
 
   <script type="application/javascript">
   <![CDATA[
+    function addA11yLoadEvent(accService, func) {
+      function waitForDocLoad() {
+        setTimeout(() => {
+            let accDoc = accService.getAccessibleFor(document);
+            let state = {};
+            accDoc.getState(state, {});
+
+            if (state.value & SpecialPowers.Ci.nsIAccessibleStates.STATE_BUSY) {
+              return waitForDocLoad();
+            }
+            setTimeout(func, 0);
+          }, 0);
+      }
+
+      waitForDocLoad();
+    }
+
     function doTest()
     {
       var accService = SpecialPowers.Cc["@mozilla.org/accessibilityService;1"].
         getService(SpecialPowers.Ci.nsIAccessibilityService);
 
       var treecol = document.getElementById("col");
       var x = treecol.boxObject.screenX;
       var y = treecol.boxObject.screenY;
 
       var tree = document.getElementById("tree");
-      var treeAcc = accService.getAccessibleFor(tree);
-      treeAcc.getChildAtPoint(x + 1, y + 1);
+      addA11yLoadEvent(accService, () => {
+        var treeAcc = accService.getAccessibleFor(tree);
+        treeAcc.getChildAtPoint(x + 1, y + 1);
+        document.documentElement.removeAttribute("class");
+      });
     }
   ]]>
   </script>
 
   <tree id="tree" flex="1">
     <treecols>
       <treecol id="col" flex="1" primary="true" label="column"/>
       <treecol id="scol" flex="1" label="column 2"/>
--- a/accessible/tests/crashtests/crashtests.list
+++ b/accessible/tests/crashtests/crashtests.list
@@ -1,3 +1,5 @@
-# Disabled because they cause assertions/crashes in later crashtests, see bug 918246
-skip load 448064.xhtml
-skip load 471493.xul
+load 448064.xhtml # This test instantiates a11y, so be careful about adding tests before it
+load 471493.xul
+# last_test_to_unload_testsuite.xul MUST be the last test in the list because it
+# is responsible for shutting down accessibility service affecting later tests.
+load last_test_to_unload_testsuite.xul
new file mode 100644
--- /dev/null
+++ b/accessible/tests/crashtests/last_test_to_unload_testsuite.xul
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
+
+<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+        title="bug 471493 'crash [@ nsPropertyTable::GetPropertyInternal]'"
+        onload="shutdown();" class="reftest-wait">
+
+  <script type="application/javascript">
+  <![CDATA[
+    function shutdown() {
+      !SpecialPowers.Services.appinfo.accessibilityEnabled &&
+        dump("### Error : Accessibility is expected to be enabled.\n");
+
+      // Force garbage collection. We try really hard to garbage collect
+      // everythin here to ensure that all a11y xpcom bits are shut down and
+      // avoid intermittent timeouts.
+      SpecialPowers.gc();
+      SpecialPowers.forceShrinkingGC();
+      SpecialPowers.forceCC();
+      SpecialPowers.gc();
+      SpecialPowers.forceShrinkingGC();
+      SpecialPowers.forceCC();
+
+      if (SpecialPowers.Services.appinfo.accessibilityEnabled) {
+        let observe = (subject, topic, data) => {
+          SpecialPowers.Services.obs.removeObserver(observe, "a11y-init-or-shutdown");
+          data === "0" && document.documentElement.removeAttribute("class");
+        };
+        SpecialPowers.Services.obs.addObserver(observe, "a11y-init-or-shutdown");
+      } else {
+        document.documentElement.removeAttribute("class");
+      }
+    }
+  ]]>
+  </script>
+</window>
--- a/devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js
+++ b/devtools/client/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js
@@ -52,18 +52,18 @@ var consoleOpened = Task.async(function*
   ok(!popup.isOpen, "popup is not open");
 
   popup.once("popup-opened", () => {
     ok(popup.isOpen, "popup is open");
 
     // 4 values, and the following properties:
     // __defineGetter__  __defineSetter__ __lookupGetter__ __lookupSetter__
     // __proto__ hasOwnProperty isPrototypeOf propertyIsEnumerable
-    // toLocaleString toString toSource unwatch valueOf watch constructor.
-    is(popup.itemCount, 19, "popup.itemCount is correct");
+    // toLocaleString toString toSource valueOfconstructor.
+    is(popup.itemCount, 17, "popup.itemCount is correct");
 
     let sameItems = popup.getItems().reverse().map(function (e) {
       return e.label;
     });
 
     ok(sameItems.every(function (prop, index) {
       return [
         "__defineGetter__",
@@ -77,62 +77,60 @@ var consoleOpened = Task.async(function*
         "item0",
         "item1",
         "item2",
         "item3",
         "propertyIsEnumerable",
         "toLocaleString",
         "toSource",
         "toString",
-        "unwatch",
         "valueOf",
-        "watch",
       ][index] === prop;
     }), "getItems returns the items we expect");
 
-    is(popup.selectedIndex, 18,
+    is(popup.selectedIndex, 16,
        "Index of the first item from bottom is selected.");
     EventUtils.synthesizeKey("VK_DOWN", {});
 
     let prefix = jsterm.getInputValue().replace(/[\S]/g, " ");
 
     is(popup.selectedIndex, 0, "index 0 is selected");
-    is(popup.selectedItem.label, "watch", "watch is selected");
-    is(completeNode.value, prefix + "watch",
-        "completeNode.value holds watch");
+    is(popup.selectedItem.label, "valueOf", "valueOf is selected");
+    is(completeNode.value, prefix + "valueOf",
+        "completeNode.value holds valueOf");
 
     EventUtils.synthesizeKey("VK_DOWN", {});
 
     is(popup.selectedIndex, 1, "index 1 is selected");
-    is(popup.selectedItem.label, "valueOf", "valueOf is selected");
-    is(completeNode.value, prefix + "valueOf",
-        "completeNode.value holds valueOf");
+    is(popup.selectedItem.label, "toString", "toString is selected");
+    is(completeNode.value, prefix + "toString",
+        "completeNode.value holds toString");
 
     EventUtils.synthesizeKey("VK_UP", {});
 
     is(popup.selectedIndex, 0, "index 0 is selected");
-    is(popup.selectedItem.label, "watch", "watch is selected");
-    is(completeNode.value, prefix + "watch",
-        "completeNode.value holds watch");
+    is(popup.selectedItem.label, "valueOf", "valueOf is selected");
+    is(completeNode.value, prefix + "valueOf",
+        "completeNode.value holds valueOf");
 
     let currentSelectionIndex = popup.selectedIndex;
 
     EventUtils.synthesizeKey("VK_PAGE_DOWN", {});
 
     ok(popup.selectedIndex > currentSelectionIndex,
       "Index is greater after PGDN");
 
     currentSelectionIndex = popup.selectedIndex;
     EventUtils.synthesizeKey("VK_PAGE_UP", {});
 
     ok(popup.selectedIndex < currentSelectionIndex,
        "Index is less after Page UP");
 
     EventUtils.synthesizeKey("VK_END", {});
-    is(popup.selectedIndex, 18, "index is last after End");
+    is(popup.selectedIndex, 16, "index is last after End");
 
     EventUtils.synthesizeKey("VK_HOME", {});
     is(popup.selectedIndex, 0, "index is first after Home");
 
     info("press Tab and wait for popup to hide");
     popup.once("popup-closed", () => {
       deferred.resolve();
     });
@@ -146,35 +144,35 @@ var consoleOpened = Task.async(function*
 });
 
 function popupHideAfterTab() {
   let deferred = defer();
 
   // At this point the completion suggestion should be accepted.
   ok(!popup.isOpen, "popup is not open");
 
-  is(jsterm.getInputValue(), "window.foobarBug585991.watch",
+  is(jsterm.getInputValue(), "window.foobarBug585991.valueOf",
      "completion was successful after VK_TAB");
 
   ok(!completeNode.value, "completeNode is empty");
 
   popup.once("popup-opened", function onShown() {
     ok(popup.isOpen, "popup is open");
 
-    is(popup.itemCount, 19, "popup.itemCount is correct");
+    is(popup.itemCount, 17, "popup.itemCount is correct");
 
-    is(popup.selectedIndex, 18, "First index from bottom is selected");
+    is(popup.selectedIndex, 16, "First index from bottom is selected");
     EventUtils.synthesizeKey("VK_DOWN", {});
 
     let prefix = jsterm.getInputValue().replace(/[\S]/g, " ");
 
     is(popup.selectedIndex, 0, "index 0 is selected");
-    is(popup.selectedItem.label, "watch", "watch is selected");
-    is(completeNode.value, prefix + "watch",
-        "completeNode.value holds watch");
+    is(popup.selectedItem.label, "valueOf", "valueOf is selected");
+    is(completeNode.value, prefix + "valueOf",
+        "completeNode.value holds valueOf");
 
     popup.once("popup-closed", function onHidden() {
       ok(!popup.isOpen, "popup is not open after VK_ESCAPE");
 
       is(jsterm.getInputValue(), "window.foobarBug585991.",
          "completion was cancelled");
 
       ok(!completeNode.value, "completeNode is empty");
@@ -198,39 +196,39 @@ function popupHideAfterTab() {
 }
 
 function testReturnKey() {
   let deferred = defer();
 
   popup.once("popup-opened", function onShown() {
     ok(popup.isOpen, "popup is open");
 
-    is(popup.itemCount, 19, "popup.itemCount is correct");
+    is(popup.itemCount, 17, "popup.itemCount is correct");
 
-    is(popup.selectedIndex, 18, "First index from bottom is selected");
+    is(popup.selectedIndex, 16, "First index from bottom is selected");
     EventUtils.synthesizeKey("VK_DOWN", {});
 
     let prefix = jsterm.getInputValue().replace(/[\S]/g, " ");
 
     is(popup.selectedIndex, 0, "index 0 is selected");
-    is(popup.selectedItem.label, "watch", "watch is selected");
-    is(completeNode.value, prefix + "watch",
-        "completeNode.value holds watch");
+    is(popup.selectedItem.label, "valueOf", "valueOf is selected");
+    is(completeNode.value, prefix + "valueOf",
+        "completeNode.value holds valueOf");
 
     EventUtils.synthesizeKey("VK_DOWN", {});
 
     is(popup.selectedIndex, 1, "index 1 is selected");
-    is(popup.selectedItem.label, "valueOf", "valueOf is selected");
-    is(completeNode.value, prefix + "valueOf",
-       "completeNode.value holds valueOf");
+    is(popup.selectedItem.label, "toString", "toString is selected");
+    is(completeNode.value, prefix + "toString",
+       "completeNode.value holds toString");
 
     popup.once("popup-closed", function onHidden() {
       ok(!popup.isOpen, "popup is not open after VK_RETURN");
 
-      is(jsterm.getInputValue(), "window.foobarBug585991.valueOf",
+      is(jsterm.getInputValue(), "window.foobarBug585991.toString",
          "completion was successful after VK_RETURN");
 
       ok(!completeNode.value, "completeNode is empty");
 
       deferred.resolve();
     }, false);
 
     info("press Return to accept suggestion. wait for popup to hide");
--- a/dom/asmjscache/AsmJSCache.cpp
+++ b/dom/asmjscache/AsmJSCache.cpp
@@ -25,17 +25,16 @@
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/Unused.h"
 #include "nsAutoPtr.h"
 #include "nsAtom.h"
 #include "nsIFile.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIPrincipal.h"
 #include "nsIRunnable.h"
 #include "nsISimpleEnumerator.h"
 #include "nsIThread.h"
 #include "nsJSPrincipals.h"
 #include "nsThreadUtils.h"
 #include "nsXULAppAPI.h"
 #include "prio.h"
@@ -1057,17 +1056,16 @@ DeallocEntryParent(PAsmJSCacheEntryParen
 
 namespace {
 
 // A runnable that presents a single interface to the AsmJSCache ops which need
 // to wait until the file is open.
 class ChildRunnable final
   : public FileDescriptorHolder
   , public PAsmJSCacheEntryChild
-  , public nsIIPCBackgroundChildCreateCallback
 {
   typedef mozilla::ipc::PBackgroundChild PBackgroundChild;
 
 public:
   class AutoClose
   {
     ChildRunnable* mChildRunnable;
 
@@ -1100,19 +1098,17 @@ public:
     ~AutoClose()
     {
       if (mChildRunnable) {
         mChildRunnable->Close();
       }
     }
   };
 
-  NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIRUNNABLE
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
 
   ChildRunnable(nsIPrincipal* aPrincipal,
                 OpenMode aOpenMode,
                 WriteParams aWriteParams,
                 ReadParams aReadParams)
   : mPrincipal(aPrincipal),
     mWriteParams(aWriteParams),
     mReadParams(aReadParams),
@@ -1316,28 +1312,35 @@ ChildRunnable::Run()
       nsresult rv = PrincipalToPrincipalInfo(mPrincipal, principalInfo);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         Fail(JS::AsmJSCache_InternalError);
         return NS_OK;
       }
 
       mPrincipalInfo = Move(principalInfo);
 
-      PBackgroundChild* actor = BackgroundChild::GetForCurrentThread();
-      if (actor) {
-        ActorCreated(actor);
-        return NS_OK;
-      }
-
-      if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(this))) {
+      PBackgroundChild* actor = BackgroundChild::GetOrCreateForCurrentThread();
+      if (NS_WARN_IF(!actor)) {
         Fail(JS::AsmJSCache_InternalError);
         return NS_OK;
       }
 
-      mState = eBackgroundChildPending;
+      if (!actor->SendPAsmJSCacheEntryConstructor(this, mOpenMode, mWriteParams,
+                                                   *mPrincipalInfo)) {
+        // Unblock the parsing thread with a failure.
+
+        Fail(JS::AsmJSCache_InternalError);
+        return NS_OK;
+      }
+
+      // AddRef to keep this runnable alive until IPDL deallocates the
+      // subprotocol (DeallocEntryChild).
+      AddRef();
+
+      mState = eOpening;
       return NS_OK;
     }
 
     case eClosing: {
       MOZ_ASSERT(NS_IsMainThread());
 
       // Per FileDescriptorHolder::Finish()'s comment, call before
       // releasing the directory lock (which happens in the parent upon receipt
@@ -1367,50 +1370,16 @@ ChildRunnable::Run()
       MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Shouldn't Run() in this state");
     }
   }
 
   MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Corrupt state");
   return NS_OK;
 }
 
-void
-ChildRunnable::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-
-  if (!aActor->SendPAsmJSCacheEntryConstructor(this, mOpenMode, mWriteParams,
-                                               *mPrincipalInfo)) {
-    // Unblock the parsing thread with a failure.
-
-    Fail(JS::AsmJSCache_InternalError);
-
-    return;
-  }
-
-  // AddRef to keep this runnable alive until IPDL deallocates the
-  // subprotocol (DeallocEntryChild).
-  AddRef();
-
-  mState = eOpening;
-}
-
-void
-ChildRunnable::ActorFailed()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(mState == eBackgroundChildPending);
-
-  Fail(JS::AsmJSCache_InternalError);
-}
-
-NS_IMPL_ISUPPORTS_INHERITED(ChildRunnable,
-                            FileDescriptorHolder,
-                            nsIIPCBackgroundChildCreateCallback)
-
 } // unnamed namespace
 
 void
 DeallocEntryChild(PAsmJSCacheEntryChild* aActor)
 {
   // Match the AddRef before SendPAsmJSCacheEntryConstructor.
   static_cast<ChildRunnable*>(aActor)->Release();
 }
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -46,16 +46,18 @@
 #include "nsError.h"
 #include "mozilla/Encoding.h"
 
 namespace mozilla {
 namespace dom {
 
 using namespace workers;
 
+static LazyLogModule gEventSourceLog("EventSource");
+
 #define SPACE_CHAR           (char16_t)0x0020
 #define CR_CHAR              (char16_t)0x000D
 #define LF_CHAR              (char16_t)0x000A
 #define COLON_CHAR           (char16_t)0x003A
 
 // Reconnection time related values in milliseconds. The default one is equal
 // to the default value of the pref dom.server-events.default-reconnection-time
 #define MIN_RECONNECTION_TIME_VALUE       500
@@ -948,33 +950,40 @@ EventSourceImpl::GetBaseURI(nsIURI** aBa
   return NS_OK;
 }
 
 void
 EventSourceImpl::SetupHttpChannel()
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(!IsShutDown());
-  DebugOnly<nsresult> rv =
-    mHttpChannel->SetRequestMethod(NS_LITERAL_CSTRING("GET"));
+  nsresult rv = mHttpChannel->SetRequestMethod(NS_LITERAL_CSTRING("GET"));
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   /* set the http request headers */
 
   rv = mHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Accept"),
     NS_LITERAL_CSTRING(TEXT_EVENT_STREAM), false);
   MOZ_ASSERT(NS_SUCCEEDED(rv));
 
   // LOAD_BYPASS_CACHE already adds the Cache-Control: no-cache header
 
-  if (!mLastEventID.IsEmpty()) {
-    rv = mHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Last-Event-ID"),
-      NS_ConvertUTF16toUTF8(mLastEventID), false);
-    MOZ_ASSERT(NS_SUCCEEDED(rv));
+  if (mLastEventID.IsEmpty()) {
+    return;
   }
+  NS_ConvertUTF16toUTF8 eventId(mLastEventID);
+  rv = mHttpChannel->SetRequestHeader(NS_LITERAL_CSTRING("Last-Event-ID"),
+                                      eventId, false);
+#ifdef DEBUG
+  if (NS_FAILED(rv)) {
+    MOZ_LOG(gEventSourceLog, LogLevel::Warning,
+            ("SetupHttpChannel. rv=%x (%s)", uint32_t(rv), eventId.get()));
+  }
+#endif
+  Unused << rv;
 }
 
 nsresult
 EventSourceImpl::SetupReferrerPolicy()
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(!IsShutDown());
   nsCOMPtr<nsIDocument> doc = mEventSource->GetDocumentIfCurrent();
@@ -1720,17 +1729,18 @@ EventSourceImpl::ParseCharacter(char16_t
         NS_ENSURE_SUCCESS(rv, rv);
 
         mStatus = PARSE_STATE_CR_CHAR;
       } else if (aChr == LF_CHAR) {
         rv = SetFieldAndClear();
         NS_ENSURE_SUCCESS(rv, rv);
 
         mStatus = PARSE_STATE_BEGIN_OF_LINE;
-      } else {
+      } else if (aChr != 0) {
+        // Avoid appending the null char to the field value.
         mLastFieldValue += aChr;
       }
 
       break;
 
     case PARSE_STATE_BEGIN_OF_LINE:
       if (aChr == CR_CHAR) {
         rv = DispatchCurrentMessageEvent();  // there is an empty line
@@ -1739,17 +1749,18 @@ EventSourceImpl::ParseCharacter(char16_t
         mStatus = PARSE_STATE_CR_CHAR;
       } else if (aChr == LF_CHAR) {
         rv = DispatchCurrentMessageEvent();  // there is an empty line
         NS_ENSURE_SUCCESS(rv, rv);
 
         mStatus = PARSE_STATE_BEGIN_OF_LINE;
       } else if (aChr == COLON_CHAR) {
         mStatus = PARSE_STATE_COMMENT;
-      } else {
+      } else if (aChr != 0) {
+        // Avoid appending the null char to the field name.
         mLastFieldName += aChr;
         mStatus = PARSE_STATE_FIELD_NAME;
       }
 
       break;
   }
 
   return NS_OK;
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1120,21 +1120,16 @@ public:
 
   bool isCallable(JSObject *obj) const override {
     return false;
   }
   bool isConstructor(JSObject *obj) const override {
     return false;
   }
 
-  bool watch(JSContext *cx, JS::Handle<JSObject*> proxy,
-             JS::Handle<jsid> id, JS::Handle<JSObject*> callable) const override;
-  bool unwatch(JSContext *cx, JS::Handle<JSObject*> proxy,
-               JS::Handle<jsid> id) const override;
-
   static const nsOuterWindowProxy singleton;
 
 protected:
   static nsGlobalWindow* GetOuterWindow(JSObject *proxy)
   {
     nsGlobalWindow* outerWindow = nsGlobalWindow::FromSupports(
       static_cast<nsISupports*>(js::GetProxyReservedSlot(proxy, 0).toPrivate()));
     MOZ_ASSERT_IF(outerWindow, outerWindow->IsOuterWindow());
@@ -1473,30 +1468,16 @@ nsOuterWindowProxy::AppendIndexedPropert
     if (!props.append(INT_TO_JSID(i))) {
       return false;
     }
   }
 
   return true;
 }
 
-bool
-nsOuterWindowProxy::watch(JSContext *cx, JS::Handle<JSObject*> proxy,
-                          JS::Handle<jsid> id, JS::Handle<JSObject*> callable) const
-{
-  return js::WatchGuts(cx, proxy, id, callable);
-}
-
-bool
-nsOuterWindowProxy::unwatch(JSContext *cx, JS::Handle<JSObject*> proxy,
-                            JS::Handle<jsid> id) const
-{
-  return js::UnwatchGuts(cx, proxy, id);
-}
-
 size_t
 nsOuterWindowProxy::objectMoved(JSObject *obj, JSObject *old) const
 {
   nsGlobalWindow* outerWindow = GetOuterWindow(obj);
   if (outerWindow) {
     outerWindow->UpdateWrapper(obj, old);
   }
   return 0;
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -2062,18 +2062,16 @@ const js::ClassOps sBoringInterfaceObjec
 const js::ObjectOps sInterfaceObjectClassObjectOps = {
   nullptr, /* lookupProperty */
   nullptr, /* defineProperty */
   nullptr, /* hasProperty */
   nullptr, /* getProperty */
   nullptr, /* setProperty */
   nullptr, /* getOwnPropertyDescriptor */
   nullptr, /* deleteProperty */
-  nullptr, /* watch */
-  nullptr, /* unwatch */
   nullptr, /* getElements */
   InterfaceObjectToString, /* funToString */
 };
 
 bool
 GetPropertyOnPrototype(JSContext* cx, JS::Handle<JSObject*> proxy,
                        JS::Handle<JS::Value> receiver, JS::Handle<jsid> id,
                        bool* found, JS::MutableHandle<JS::Value> vp)
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -13551,19 +13551,19 @@ class CGDictionary(CGThing):
         else:
             # The data is inside the Optional<>
             memberData = "%s.InternalValue()" % memberLoc
 
         # If you have to change this list (which you shouldn't!), make sure it
         # continues to match the list in test_Object.prototype_props.html
         if (member.identifier.name in
             ["constructor", "toSource", "toString", "toLocaleString", "valueOf",
-             "watch", "unwatch", "hasOwnProperty", "isPrototypeOf",
-             "propertyIsEnumerable", "__defineGetter__", "__defineSetter__",
-             "__lookupGetter__", "__lookupSetter__", "__proto__"]):
+             "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable",
+             "__defineGetter__", "__defineSetter__", "__lookupGetter__",
+             "__lookupSetter__", "__proto__"]):
             raise TypeError("'%s' member of %s dictionary shadows "
                             "a property of Object.prototype, and Xrays to "
                             "Object can't handle that.\n"
                             "%s" %
                             (member.identifier.name,
                              self.dictionary.identifier.name,
                              member.location))
 
--- a/dom/bindings/DOMJSProxyHandler.cpp
+++ b/dom/bindings/DOMJSProxyHandler.cpp
@@ -229,29 +229,16 @@ DOMProxyHandler::delete_(JSContext* cx, 
   if (!xpc::WrapperFactory::IsXrayWrapper(proxy) && (expando = GetExpandoObject(proxy))) {
     return JS_DeletePropertyById(cx, expando, id, result);
   }
 
   return result.succeed();
 }
 
 bool
-BaseDOMProxyHandler::watch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
-                           JS::Handle<JSObject*> callable) const
-{
-  return js::WatchGuts(cx, proxy, id, callable);
-}
-
-bool
-BaseDOMProxyHandler::unwatch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id) const
-{
-  return js::UnwatchGuts(cx, proxy, id);
-}
-
-bool
 BaseDOMProxyHandler::ownPropertyKeys(JSContext* cx,
                                      JS::Handle<JSObject*> proxy,
                                      JS::AutoIdVector& props) const
 {
   return ownPropNames(cx, proxy, JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS, props);
 }
 
 bool
--- a/dom/bindings/DOMJSProxyHandler.h
+++ b/dom/bindings/DOMJSProxyHandler.h
@@ -61,21 +61,16 @@ public:
 
   // We override getOwnEnumerablePropertyKeys() and implement it directly
   // instead of using the default implementation, which would call
   // ownPropertyKeys and then filter out the non-enumerable ones. This avoids
   // unnecessary work during enumeration.
   virtual bool getOwnEnumerablePropertyKeys(JSContext* cx, JS::Handle<JSObject*> proxy,
                                             JS::AutoIdVector &props) const override;
 
-  bool watch(JSContext* cx, JS::Handle<JSObject*> proxy, JS::Handle<jsid> id,
-             JS::Handle<JSObject*> callable) const override;
-  bool unwatch(JSContext* cx, JS::Handle<JSObject*> proxy,
-               JS::Handle<jsid> id) const override;
-
 protected:
   // Hook for subclasses to implement shared ownPropertyKeys()/keys()
   // functionality.  The "flags" argument is either JSITER_OWNONLY (for keys())
   // or JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS (for
   // ownPropertyKeys()).
   virtual bool ownPropNames(JSContext* cx, JS::Handle<JSObject*> proxy,
                             unsigned flags,
                             JS::AutoIdVector& props) const = 0;
--- a/dom/bindings/test/test_Object.prototype_props.html
+++ b/dom/bindings/test/test_Object.prototype_props.html
@@ -6,15 +6,15 @@
 <div id="log"></div>
 <script>
 test(function() {
   var props = Object.getOwnPropertyNames(Object.prototype);
   // If you change this list, make sure it continues to match the list in
   // Codegen.py's CGDictionary.getMemberDefinition method.
   var expected = [
       "constructor", "toSource", "toString", "toLocaleString", "valueOf",
-      "watch", "unwatch", "hasOwnProperty", "isPrototypeOf",
-      "propertyIsEnumerable", "__defineGetter__", "__defineSetter__",
-      "__lookupGetter__", "__lookupSetter__", "__proto__"
+      "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable",
+      "__defineGetter__", "__defineSetter__", "__lookupGetter__",
+      "__lookupSetter__", "__proto__"
     ];
   assert_array_equals(props.sort(), expected.sort());
 }, "Own properties of Object.prototype");
 </script>
--- a/dom/broadcastchannel/BroadcastChannel.cpp
+++ b/dom/broadcastchannel/BroadcastChannel.cpp
@@ -264,18 +264,16 @@ private:
 } // namespace
 
 BroadcastChannel::BroadcastChannel(nsPIDOMWindowInner* aWindow,
                                    const PrincipalInfo& aPrincipalInfo,
                                    const nsACString& aOrigin,
                                    const nsAString& aChannel)
   : DOMEventTargetHelper(aWindow)
   , mWorkerHolder(nullptr)
-  , mPrincipalInfo(new PrincipalInfo(aPrincipalInfo))
-  , mOrigin(aOrigin)
   , mChannel(aChannel)
   , mInnerID(0)
   , mState(StateActive)
 {
   // Window can be null in workers
 
   KeepAliveIfHasListenersFor(NS_LITERAL_STRING("message"));
 }
@@ -341,23 +339,30 @@ BroadcastChannel::Constructor(const Glob
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<BroadcastChannel> bc =
     new BroadcastChannel(window, principalInfo, origin, aChannel);
 
   // Register this component to PBackground.
-  PBackgroundChild* actor = BackgroundChild::GetForCurrentThread();
-  if (actor) {
-    bc->ActorCreated(actor);
-  } else {
-    BackgroundChild::GetOrCreateForCurrentThread(bc);
+  PBackgroundChild* actorChild = BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actorChild)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
   }
 
+  PBroadcastChannelChild* actor =
+    actorChild->SendPBroadcastChannelConstructor(principalInfo, origin,
+                                                 nsString(aChannel));
+
+  bc->mActor = static_cast<BroadcastChannelChild*>(actor);
+  MOZ_ASSERT(bc->mActor);
+
+  bc->mActor->SetParent(bc);
+
   if (!workerPrivate) {
     MOZ_ASSERT(window);
     MOZ_ASSERT(window->IsInnerWindow());
     bc->mInnerID = window->WindowID();
 
     // Register as observer for inner-window-destroyed.
     nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
     if (obs) {
@@ -402,86 +407,40 @@ BroadcastChannel::PostMessageInternal(JS
   PostMessageData(data);
 }
 
 void
 BroadcastChannel::PostMessageData(BroadcastChannelMessage* aData)
 {
   RemoveDocFromBFCache();
 
-  if (mActor) {
-    RefPtr<BCPostMessageRunnable> runnable =
-      new BCPostMessageRunnable(mActor, aData);
+  RefPtr<BCPostMessageRunnable> runnable =
+    new BCPostMessageRunnable(mActor, aData);
 
-    if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
-      NS_WARNING("Failed to dispatch to the current thread!");
-    }
-
-    return;
+  if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
+    NS_WARNING("Failed to dispatch to the current thread!");
   }
-
-  mPendingMessages.AppendElement(aData);
 }
 
 void
 BroadcastChannel::Close()
 {
   if (mState != StateActive) {
     return;
   }
 
-  if (mPendingMessages.IsEmpty()) {
-    // We cannot call Shutdown() immediatelly because we could have some
-    // postMessage runnable already dispatched. Instead, we change the state to
-    // StateClosed and we shutdown the actor asynchrounsly.
-
-    mState = StateClosed;
-    RefPtr<CloseRunnable> runnable = new CloseRunnable(this);
-
-    if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
-      NS_WARNING("Failed to dispatch to the current thread!");
-    }
-  } else {
-    MOZ_ASSERT(!mActor);
-    mState = StateClosing;
-  }
-}
-
-void
-BroadcastChannel::ActorFailed()
-{
-  MOZ_CRASH("Failed to create a PBackgroundChild actor!");
-}
+  // We cannot call Shutdown() immediatelly because we could have some
+  // postMessage runnable already dispatched. Instead, we change the state to
+  // StateClosed and we shutdown the actor asynchrounsly.
 
-void
-BroadcastChannel::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(aActor);
-
-  if (mState == StateClosed) {
-    return;
-  }
-
-  PBroadcastChannelChild* actor =
-    aActor->SendPBroadcastChannelConstructor(*mPrincipalInfo, mOrigin, mChannel);
+  mState = StateClosed;
+  RefPtr<CloseRunnable> runnable = new CloseRunnable(this);
 
-  mActor = static_cast<BroadcastChannelChild*>(actor);
-  MOZ_ASSERT(mActor);
-
-  mActor->SetParent(this);
-
-  // Flush pending messages.
-  for (uint32_t i = 0; i < mPendingMessages.Length(); ++i) {
-    PostMessageData(mPendingMessages[i]);
-  }
-
-  mPendingMessages.Clear();
-
-  if (mState == StateClosing) {
-    Shutdown();
+  if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
+    NS_WARNING("Failed to dispatch to the current thread!");
   }
 }
 
 void
 BroadcastChannel::Shutdown()
 {
   mState = StateClosed;
 
@@ -560,17 +519,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(BroadcastChannel,
                                                 DOMEventTargetHelper)
   tmp->Shutdown();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BroadcastChannel)
-  NS_INTERFACE_MAP_ENTRY(nsIIPCBackgroundChildCreateCallback)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(BroadcastChannel, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(BroadcastChannel, DOMEventTargetHelper)
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/broadcastchannel/BroadcastChannel.h
+++ b/dom/broadcastchannel/BroadcastChannel.h
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_BroadcastChannel_h
 #define mozilla_dom_BroadcastChannel_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "nsAutoPtr.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIObserver.h"
 #include "nsTArray.h"
 #include "mozilla/RefPtr.h"
 
 class nsPIDOMWindowInner;
 
 namespace mozilla {
 
@@ -29,22 +28,20 @@ namespace workers {
 class WorkerHolder;
 } // namespace workers
 
 class BroadcastChannelChild;
 class BroadcastChannelMessage;
 
 class BroadcastChannel final
   : public DOMEventTargetHelper
-  , public nsIIPCBackgroundChildCreateCallback
   , public nsIObserver
 {
   friend class BroadcastChannelChild;
 
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
   NS_DECL_NSIOBSERVER
 
   typedef mozilla::ipc::PrincipalInfo PrincipalInfo;
 
 public:
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(BroadcastChannel,
@@ -83,30 +80,25 @@ private:
   void PostMessageData(BroadcastChannelMessage* aData);
 
   void PostMessageInternal(JSContext* aCx, JS::Handle<JS::Value> aMessage,
                            ErrorResult& aRv);
 
   void RemoveDocFromBFCache();
 
   RefPtr<BroadcastChannelChild> mActor;
-  nsTArray<RefPtr<BroadcastChannelMessage>> mPendingMessages;
 
   nsAutoPtr<workers::WorkerHolder> mWorkerHolder;
 
-  nsAutoPtr<PrincipalInfo> mPrincipalInfo;
-
-  nsCString mOrigin;
   nsString mChannel;
 
   uint64_t mInnerID;
 
   enum {
     StateActive,
-    StateClosing,
     StateClosed
   } mState;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_BroadcastChannel_h
--- a/dom/cache/CacheStorage.cpp
+++ b/dom/cache/CacheStorage.cpp
@@ -45,21 +45,20 @@ using mozilla::ipc::PrincipalToPrincipal
 NS_IMPL_CYCLE_COLLECTING_ADDREF(mozilla::dom::cache::CacheStorage);
 NS_IMPL_CYCLE_COLLECTING_RELEASE(mozilla::dom::cache::CacheStorage);
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(mozilla::dom::cache::CacheStorage,
                                       mGlobal);
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CacheStorage)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
-  NS_INTERFACE_MAP_ENTRY(nsIIPCBackgroundChildCreateCallback)
 NS_INTERFACE_MAP_END
 
 // We cannot reference IPC types in a webidl binding implementation header.  So
-// define this in the .cpp and use heap storage in the mPendingRequests list.
+// define this in the .cpp.
 struct CacheStorage::Entry final
 {
   RefPtr<Promise> mPromise;
   CacheOpArgs mArgs;
   // We cannot add the requests until after the actor is present.  So store
   // the request data separately for now.
   RefPtr<InternalRequest> mRequest;
 };
@@ -270,37 +269,43 @@ CacheStorage::DefineCaches(JSContext* aC
 }
 
 CacheStorage::CacheStorage(Namespace aNamespace, nsIGlobalObject* aGlobal,
                            const PrincipalInfo& aPrincipalInfo,
                            CacheWorkerHolder* aWorkerHolder)
   : mNamespace(aNamespace)
   , mGlobal(aGlobal)
   , mPrincipalInfo(MakeUnique<PrincipalInfo>(aPrincipalInfo))
-  , mWorkerHolder(aWorkerHolder)
   , mActor(nullptr)
   , mStatus(NS_OK)
 {
   MOZ_DIAGNOSTIC_ASSERT(mGlobal);
 
   // If the PBackground actor is already initialized then we can
   // immediately use it
-  PBackgroundChild* actor = BackgroundChild::GetForCurrentThread();
-  if (actor) {
-    ActorCreated(actor);
+  PBackgroundChild* actor = BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actor)) {
+    mStatus = NS_ERROR_UNEXPECTED;
     return;
   }
 
-  // Otherwise we must begin the PBackground initialization process and
-  // wait for the async ActorCreated() callback.
-  MOZ_ASSERT(NS_IsMainThread());
-  bool ok = BackgroundChild::GetOrCreateForCurrentThread(this);
-  if (NS_WARN_IF(!ok)) {
-    ActorFailed();
+  // WorkerHolder ownership is passed to the CacheStorageChild actor and any
+  // actors it may create.  The WorkerHolder will keep the worker thread alive
+  // until the actors can gracefully shutdown.
+  CacheStorageChild* newActor = new CacheStorageChild(this, aWorkerHolder);
+  PCacheStorageChild* constructedActor =
+    actor->SendPCacheStorageConstructor(newActor, mNamespace, *mPrincipalInfo);
+
+  if (NS_WARN_IF(!constructedActor)) {
+    mStatus = NS_ERROR_UNEXPECTED;
+    return;
   }
+
+  MOZ_DIAGNOSTIC_ASSERT(constructedActor == newActor);
+  mActor = newActor;
 }
 
 CacheStorage::CacheStorage(nsresult aFailureResult)
   : mNamespace(INVALID_NAMESPACE)
   , mActor(nullptr)
   , mStatus(aFailureResult)
 {
   MOZ_DIAGNOSTIC_ASSERT(NS_FAILED(mStatus));
@@ -331,18 +336,17 @@ CacheStorage::Match(JSContext* aCx, cons
   CacheQueryParams params;
   ToCacheQueryParams(params, aOptions);
 
   nsAutoPtr<Entry> entry(new Entry());
   entry->mPromise = promise;
   entry->mArgs = StorageMatchArgs(CacheRequest(), params, GetOpenMode());
   entry->mRequest = request;
 
-  mPendingRequests.AppendElement(entry.forget());
-  MaybeRunPendingRequests();
+  RunRequest(Move(entry));
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 CacheStorage::Has(const nsAString& aKey, ErrorResult& aRv)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStorage);
@@ -356,18 +360,17 @@ CacheStorage::Has(const nsAString& aKey,
   if (NS_WARN_IF(!promise)) {
     return nullptr;
   }
 
   nsAutoPtr<Entry> entry(new Entry());
   entry->mPromise = promise;
   entry->mArgs = StorageHasArgs(nsString(aKey));
 
-  mPendingRequests.AppendElement(entry.forget());
-  MaybeRunPendingRequests();
+  RunRequest(Move(entry));
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 CacheStorage::Open(const nsAString& aKey, ErrorResult& aRv)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStorage);
@@ -381,18 +384,17 @@ CacheStorage::Open(const nsAString& aKey
   if (NS_WARN_IF(!promise)) {
     return nullptr;
   }
 
   nsAutoPtr<Entry> entry(new Entry());
   entry->mPromise = promise;
   entry->mArgs = StorageOpenArgs(nsString(aKey));
 
-  mPendingRequests.AppendElement(entry.forget());
-  MaybeRunPendingRequests();
+  RunRequest(Move(entry));
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 CacheStorage::Delete(const nsAString& aKey, ErrorResult& aRv)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStorage);
@@ -406,18 +408,17 @@ CacheStorage::Delete(const nsAString& aK
   if (NS_WARN_IF(!promise)) {
     return nullptr;
   }
 
   nsAutoPtr<Entry> entry(new Entry());
   entry->mPromise = promise;
   entry->mArgs = StorageDeleteArgs(nsString(aKey));
 
-  mPendingRequests.AppendElement(entry.forget());
-  MaybeRunPendingRequests();
+  RunRequest(Move(entry));
 
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 CacheStorage::Keys(ErrorResult& aRv)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStorage);
@@ -431,18 +432,17 @@ CacheStorage::Keys(ErrorResult& aRv)
   if (NS_WARN_IF(!promise)) {
     return nullptr;
   }
 
   nsAutoPtr<Entry> entry(new Entry());
   entry->mPromise = promise;
   entry->mArgs = StorageKeysArgs();
 
-  mPendingRequests.AppendElement(entry.forget());
-  MaybeRunPendingRequests();
+  RunRequest(Move(entry));
 
   return promise.forget();
 }
 
 // static
 bool
 CacheStorage::PrefEnabled(JSContext* aCx, JSObject* aObj)
 {
@@ -494,75 +494,28 @@ CacheStorage::GetParentObject() const
 
 JSObject*
 CacheStorage::WrapObject(JSContext* aContext, JS::Handle<JSObject*> aGivenProto)
 {
   return mozilla::dom::CacheStorageBinding::Wrap(aContext, this, aGivenProto);
 }
 
 void
-CacheStorage::ActorCreated(PBackgroundChild* aActor)
-{
-  NS_ASSERT_OWNINGTHREAD(CacheStorage);
-  MOZ_DIAGNOSTIC_ASSERT(aActor);
-
-  if (NS_WARN_IF(mWorkerHolder && mWorkerHolder->Notified())) {
-    ActorFailed();
-    return;
-  }
-
-  // WorkerHolder ownership is passed to the CacheStorageChild actor and any
-  // actors it may create.  The WorkerHolder will keep the worker thread alive
-  // until the actors can gracefully shutdown.
-  CacheStorageChild* newActor = new CacheStorageChild(this, mWorkerHolder);
-  PCacheStorageChild* constructedActor =
-    aActor->SendPCacheStorageConstructor(newActor, mNamespace, *mPrincipalInfo);
-
-  if (NS_WARN_IF(!constructedActor)) {
-    ActorFailed();
-    return;
-  }
-
-  mWorkerHolder = nullptr;
-
-  MOZ_DIAGNOSTIC_ASSERT(constructedActor == newActor);
-  mActor = newActor;
-
-  MaybeRunPendingRequests();
-  MOZ_DIAGNOSTIC_ASSERT(mPendingRequests.IsEmpty());
-}
-
-void
-CacheStorage::ActorFailed()
-{
-  NS_ASSERT_OWNINGTHREAD(CacheStorage);
-  MOZ_DIAGNOSTIC_ASSERT(!NS_FAILED(mStatus));
-
-  mStatus = NS_ERROR_UNEXPECTED;
-  mWorkerHolder = nullptr;
-
-  for (uint32_t i = 0; i < mPendingRequests.Length(); ++i) {
-    nsAutoPtr<Entry> entry(mPendingRequests[i].forget());
-    entry->mPromise->MaybeReject(NS_ERROR_UNEXPECTED);
-  }
-  mPendingRequests.Clear();
-}
-
-void
 CacheStorage::DestroyInternal(CacheStorageChild* aActor)
 {
   NS_ASSERT_OWNINGTHREAD(CacheStorage);
   MOZ_DIAGNOSTIC_ASSERT(mActor);
   MOZ_DIAGNOSTIC_ASSERT(mActor == aActor);
+  MOZ_DIAGNOSTIC_ASSERT(!NS_FAILED(mStatus));
   mActor->ClearListener();
   mActor = nullptr;
+  mStatus = NS_ERROR_UNEXPECTED;
 
   // Note that we will never get an actor again in case another request is
   // made before this object is destructed.
-  ActorFailed();
 }
 
 nsIGlobalObject*
 CacheStorage::GetGlobalObject() const
 {
   return mGlobal;
 }
 
@@ -590,36 +543,34 @@ CacheStorage::~CacheStorage()
     mActor->StartDestroyFromListener();
     // DestroyInternal() is called synchronously by StartDestroyFromListener().
     // So we should have already cleared the mActor.
     MOZ_DIAGNOSTIC_ASSERT(!mActor);
   }
 }
 
 void
-CacheStorage::MaybeRunPendingRequests()
+CacheStorage::RunRequest(nsAutoPtr<Entry>&& aEntry)
 {
-  if (!mActor) {
-    return;
+  MOZ_ASSERT(mActor);
+
+  nsAutoPtr<Entry> entry(Move(aEntry));
+
+  AutoChildOpArgs args(this, entry->mArgs, 1);
+
+  if (entry->mRequest) {
+    ErrorResult rv;
+    args.Add(entry->mRequest, IgnoreBody, IgnoreInvalidScheme, rv);
+    if (NS_WARN_IF(rv.Failed())) {
+      entry->mPromise->MaybeReject(rv);
+      return;
+    }
   }
 
-  for (uint32_t i = 0; i < mPendingRequests.Length(); ++i) {
-    ErrorResult rv;
-    nsAutoPtr<Entry> entry(mPendingRequests[i].forget());
-    AutoChildOpArgs args(this, entry->mArgs, 1);
-    if (entry->mRequest) {
-      args.Add(entry->mRequest, IgnoreBody, IgnoreInvalidScheme, rv);
-    }
-    if (NS_WARN_IF(rv.Failed())) {
-      entry->mPromise->MaybeReject(rv);
-      continue;
-    }
-    mActor->ExecuteOp(mGlobal, entry->mPromise, this, args.SendAsOpArgs());
-  }
-  mPendingRequests.Clear();
+  mActor->ExecuteOp(mGlobal, entry->mPromise, this, args.SendAsOpArgs());
 }
 
 OpenMode
 CacheStorage::GetOpenMode() const
 {
   return mNamespace == CHROME_ONLY_NAMESPACE ? OpenMode::Eager : OpenMode::Lazy;
 }
 
--- a/dom/cache/CacheStorage.h
+++ b/dom/cache/CacheStorage.h
@@ -9,17 +9,16 @@
 
 #include "mozilla/dom/cache/Types.h"
 #include "mozilla/dom/cache/TypeUtils.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsISupportsImpl.h"
 #include "nsTArray.h"
 #include "nsWrapperCache.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 
 class nsIGlobalObject;
 
 namespace mozilla {
 
 class ErrorResult;
 
 namespace ipc {
@@ -35,17 +34,17 @@ namespace workers {
   class WorkerPrivate;
 } // namespace workers
 
 namespace cache {
 
 class CacheStorageChild;
 class CacheWorkerHolder;
 
-class CacheStorage final : public nsIIPCBackgroundChildCreateCallback
+class CacheStorage final : public nsISupports
                          , public nsWrapperCache
                          , public TypeUtils
 {
   typedef mozilla::ipc::PBackgroundChild PBackgroundChild;
 
 public:
   static already_AddRefed<CacheStorage>
   CreateOnMainThread(Namespace aNamespace, nsIGlobalObject* aGlobal,
@@ -74,20 +73,16 @@ public:
               nsIPrincipal* aPrincipal, ErrorResult& aRv);
 
   // binding methods
   static bool PrefEnabled(JSContext* aCx, JSObject* aObj);
 
   nsISupports* GetParentObject() const;
   virtual JSObject* WrapObject(JSContext* aContext, JS::Handle<JSObject*> aGivenProto) override;
 
-  // nsIIPCbackgroundChildCreateCallback methods
-  virtual void ActorCreated(PBackgroundChild* aActor) override;
-  virtual void ActorFailed() override;
-
   // Called when CacheStorageChild actor is being destroyed
   void DestroyInternal(CacheStorageChild* aActor);
 
   // TypeUtils methods
   virtual nsIGlobalObject* GetGlobalObject() const override;
 #ifdef DEBUG
   virtual void AssertOwningThread() const override;
 #endif
@@ -97,37 +92,33 @@ public:
 
 private:
   CacheStorage(Namespace aNamespace, nsIGlobalObject* aGlobal,
                const mozilla::ipc::PrincipalInfo& aPrincipalInfo,
                CacheWorkerHolder* aWorkerHolder);
   explicit CacheStorage(nsresult aFailureResult);
   ~CacheStorage();
 
-  void MaybeRunPendingRequests();
+  struct Entry;
+  void RunRequest(nsAutoPtr<Entry>&& aEntry);
 
   OpenMode
   GetOpenMode() const;
 
   const Namespace mNamespace;
   nsCOMPtr<nsIGlobalObject> mGlobal;
   UniquePtr<mozilla::ipc::PrincipalInfo> mPrincipalInfo;
-  RefPtr<CacheWorkerHolder> mWorkerHolder;
 
   // weak ref cleared in DestroyInternal
   CacheStorageChild* mActor;
 
-  struct Entry;
-  nsTArray<nsAutoPtr<Entry>> mPendingRequests;
-
   nsresult mStatus;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
-  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(CacheStorage,
-                                           nsIIPCBackgroundChildCreateCallback)
+  NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(CacheStorage)
 };
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_cache_CacheStorage_h
--- a/dom/canvas/test/webgl-conf/generated-mochitest.ini
+++ b/dom/canvas/test/webgl-conf/generated-mochitest.ini
@@ -6565,17 +6565,17 @@ skip-if = (os == 'android' || os == 'lin
 skip-if = (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__sequence-operator-returns-constant.html]
 skip-if = (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__shader-precision-format-obeyed.html]
 skip-if = (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__shader-struct-scope.html]
 skip-if = (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html]
-skip-if = (os == 'android' || os == 'linux')
+skip-if = (os == 'win' && os_version == '6.1' && debug) || (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__shader-varying-packing-restrictions.html]
 skip-if = (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__shader-with-256-character-define.html]
 skip-if = (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__shader-with-256-character-identifier.frag.html]
 skip-if = (os == 'android' || os == 'linux')
 [generated/test_2_conformance__glsl__misc__shader-with-_webgl-identifier.vert.html]
 skip-if = (os == 'android' || os == 'linux')
--- a/dom/canvas/test/webgl-conf/mochitest-errata.ini
+++ b/dom/canvas/test/webgl-conf/mochitest-errata.ini
@@ -928,16 +928,19 @@ skip-if = (os == 'win' && os_version == 
 # Failure on win7 but got passed on win7 vm
 skip-if = (os == 'win' && os_version == '6.1')
 [generated/test_2_conformance__glsl__constructors__glsl-construct-vec3.html]
 # Failure on win7 but got passed on win7 vm
 skip-if = (os == 'win' && os_version == '6.1')
 [generated/test_2_conformance__glsl__constructors__glsl-construct-vec4.html]
 # Failure on win7 but got passed on win7 vm
 skip-if = (os == 'win' && os_version == '6.1')
+[generated/test_2_conformance__glsl__misc__shader-uniform-packing-restrictions.html]
+# Failures on win7/debug on oct 20th, 2017, bug 1410306
+skip-if = (os == 'win' && os_version == '6.1' && debug)
 [generated/test_2_conformance__textures__misc__tex-image-and-sub-image-2d-with-array-buffer-view.html]
 # Failure on win7 but got passed on win7 vm
 skip-if = (os == 'win' && os_version == '6.1')
 [generated/test_2_conformance__extensions__webgl-compressed-texture-size-limit.html]
 # Frequent but intermittent timeout on win7 debug no e10s.
 skip-if = (os == 'win' && os_version == '6.1' && debug && !e10s)
 [generated/test_2_conformance2__textures__misc__tex-input-validation.html]
 skip-if = (os == 'win')
--- a/dom/file/MutableBlobStorage.cpp
+++ b/dom/file/MutableBlobStorage.cpp
@@ -545,49 +545,28 @@ MutableBlobStorage::ShouldBeTemporarySto
   }
 
   return bufferSize.value() >= mMaxMemory;
 }
 
 void
 MutableBlobStorage::MaybeCreateTemporaryFile()
 {
+  MOZ_ASSERT(NS_IsMainThread());
+
   mStorageState = eWaitingForTemporaryFile;
 
-  mozilla::ipc::PBackgroundChild* actor =
-    mozilla::ipc::BackgroundChild::GetForCurrentThread();
-  if (actor) {
-    ActorCreated(actor);
-  } else {
-    mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread(this);
-  }
-}
-
-void
-MutableBlobStorage::ActorFailed()
-{
-  MOZ_CRASH("Failed to create a PBackgroundChild actor!");
-}
-
-void
-MutableBlobStorage::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(mStorageState == eWaitingForTemporaryFile ||
-             mStorageState == eClosed);
-  MOZ_ASSERT_IF(mPendingCallback, mStorageState == eClosed);
-
-  // If the object has been already closed and we don't need to execute a
-  // callback, we have nothing else to do.
-  if (mStorageState == eClosed && !mPendingCallback) {
-    return;
+  mozilla::ipc::PBackgroundChild* actorChild =
+    mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actorChild)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
   }
 
   mActor = new TemporaryIPCBlobChild(this);
-  aActor->SendPTemporaryIPCBlobConstructor(mActor);
+  actorChild->SendPTemporaryIPCBlobConstructor(mActor);
 
   // We need manually to increase the reference for this actor because the
   // IPC allocator method is not triggered. The Release() is called by IPDL
   // when the actor is deleted.
   mActor.get()->AddRef();
 
   // The actor will call us when the FileDescriptor is received.
 }
@@ -691,12 +670,10 @@ MutableBlobStorage::DispatchToIOThread(a
 
 size_t
 MutableBlobStorage::SizeOfCurrentMemoryBuffer() const
 {
   MOZ_ASSERT(NS_IsMainThread());
   return mStorageState < eInTemporaryFile ? mDataLen : 0;
 }
 
-NS_IMPL_ISUPPORTS(MutableBlobStorage, nsIIPCBackgroundChildCreateCallback)
-
 } // dom namespace
 } // mozilla namespace
--- a/dom/file/MutableBlobStorage.h
+++ b/dom/file/MutableBlobStorage.h
@@ -3,17 +3,16 @@
 /* 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/. */
 
 #ifndef mozilla_dom_MutableBlobStorage_h
 #define mozilla_dom_MutableBlobStorage_h
 
 #include "mozilla/RefPtr.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "prio.h"
 
 class nsIEventTarget;
 class nsIRunnable;
 
 namespace mozilla {
 
 class TaskQueue;
@@ -32,21 +31,20 @@ public:
   NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING
 
   virtual void BlobStoreCompleted(MutableBlobStorage* aBlobStorage,
                                   Blob* aBlob,
                                   nsresult aRv) = 0;
 };
 
 // This class is main-thread only.
-class MutableBlobStorage final : public nsIIPCBackgroundChildCreateCallback
+class MutableBlobStorage final
 {
 public:
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
-  NS_DECL_THREADSAFE_ISUPPORTS
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MutableBlobStorage)
 
   enum MutableBlobStorageType
   {
     eOnlyInMemory,
     eCouldBeInTemporaryFile,
   };
 
   explicit MutableBlobStorage(MutableBlobStorageType aType,
--- a/dom/file/ipc/IPCBlobInputStreamThread.cpp
+++ b/dom/file/ipc/IPCBlobInputStreamThread.cpp
@@ -6,17 +6,16 @@
 
 #include "IPCBlobInputStreamThread.h"
 
 #include "mozilla/StaticMutex.h"
 #include "mozilla/SystemGroup.h"
 #include "mozilla/TaskCategory.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/PBackgroundChild.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsXPCOMPrivate.h"
 
 namespace mozilla {
 
 using namespace ipc;
 
 namespace dom {
 
@@ -37,65 +36,54 @@ public:
      mozilla::StaticMutexAutoLock lock(gIPCBlobThreadMutex);
      MOZ_ASSERT(gIPCBlobThread);
      gIPCBlobThread->InitializeOnMainThread();
      return NS_OK;
   }
 };
 
 class MigrateActorRunnable final : public Runnable
-                                 , public nsIIPCBackgroundChildCreateCallback
 {
 public:
-  NS_DECL_ISUPPORTS_INHERITED
-
   explicit MigrateActorRunnable(IPCBlobInputStreamChild* aActor)
     : Runnable("dom::MigrateActorRunnable")
     , mActor(aActor)
   {
     MOZ_ASSERT(mActor);
   }
 
   NS_IMETHOD
   Run() override
   {
-    BackgroundChild::GetOrCreateForCurrentThread(this);
-    return NS_OK;
-  }
-
-  void
-  ActorFailed() override
-  {
-    // We cannot continue. We are probably shutting down.
-  }
-
-  void
-  ActorCreated(mozilla::ipc::PBackgroundChild* aActor) override
-  {
     MOZ_ASSERT(mActor->State() == IPCBlobInputStreamChild::eInactiveMigrating);
 
-    if (aActor->SendPIPCBlobInputStreamConstructor(mActor, mActor->ID(),
-                                                   mActor->Size())) {
+    PBackgroundChild* actorChild =
+      BackgroundChild::GetOrCreateForCurrentThread();
+    if (!actorChild) {
+      return NS_OK;
+    }
+
+    if (actorChild->SendPIPCBlobInputStreamConstructor(mActor, mActor->ID(),
+                                                       mActor->Size())) {
       // We need manually to increase the reference for this actor because the
       // IPC allocator method is not triggered. The Release() is called by IPDL
       // when the actor is deleted.
       mActor.get()->AddRef();
       mActor->Migrated();
     }
+
+    return NS_OK;
   }
 
 private:
   ~MigrateActorRunnable() = default;
 
   RefPtr<IPCBlobInputStreamChild> mActor;
 };
 
-NS_IMPL_ISUPPORTS_INHERITED(MigrateActorRunnable, Runnable,
-                  nsIIPCBackgroundChildCreateCallback)
-
 } // anonymous
 
 NS_IMPL_ISUPPORTS(IPCBlobInputStreamThread, nsIObserver, nsIEventTarget)
 
 /* static */ bool
 IPCBlobInputStreamThread::IsOnFileEventTarget(nsIEventTarget* aEventTarget)
 {
   MOZ_ASSERT(aEventTarget);
--- a/dom/filesystem/FileSystemTaskBase.cpp
+++ b/dom/filesystem/FileSystemTaskBase.cpp
@@ -100,18 +100,16 @@ public:
   }
 
 private:
   RefPtr<FileSystemTaskChildBase> mTask;
 };
 
 } // anonymous namespace
 
-NS_IMPL_ISUPPORTS(FileSystemTaskChildBase, nsIIPCBackgroundChildCreateCallback)
-
 /**
  * FileSystemTaskBase class
  */
 
 FileSystemTaskChildBase::FileSystemTaskChildBase(nsIGlobalObject* aGlobalObject,
                                                  FileSystemBase* aFileSystem)
   : mErrorValue(NS_OK)
   , mFileSystem(aFileSystem)
@@ -135,45 +133,19 @@ FileSystemTaskChildBase::GetFileSystem()
 }
 
 void
 FileSystemTaskChildBase::Start()
 {
   mFileSystem->AssertIsOnOwningThread();
 
   mozilla::ipc::PBackgroundChild* actor =
-    mozilla::ipc::BackgroundChild::GetForCurrentThread();
-  if (actor) {
-    ActorCreated(actor);
-  } else {
-    if (NS_WARN_IF(
-        !mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread(this))) {
-      MOZ_CRASH();
-    }
-  }
-}
-
-void
-FileSystemTaskChildBase::ActorFailed()
-{
-  MOZ_CRASH("Failed to create a PBackgroundChild actor!");
-}
-
-void
-FileSystemTaskChildBase::ActorCreated(mozilla::ipc::PBackgroundChild* aActor)
-{
-  if (HasError()) {
-    // In this case we don't want to use IPC at all.
-    RefPtr<ErrorRunnable> runnable = new ErrorRunnable(this);
-    FileSystemUtils::DispatchRunnable(mGlobalObject, runnable.forget());
-    return;
-  }
-
-  if (mFileSystem->IsShutdown()) {
-    return;
+    mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actor)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
   }
 
   nsAutoString serialization;
   mFileSystem->SerializeDOMPath(serialization);
 
   ErrorResult rv;
   FileSystemParams params = GetRequestParams(serialization, rv);
   if (NS_WARN_IF(rv.Failed())) {
@@ -185,20 +157,20 @@ FileSystemTaskChildBase::ActorCreated(mo
   // knowledge. The reference will be released by
   // mozilla::ipc::BackgroundChildImpl::DeallocPFileSystemRequestChild.
   NS_ADDREF_THIS();
 
   if (NS_IsMainThread()) {
     nsIEventTarget* target = mGlobalObject->EventTargetFor(TaskCategory::Other);
     MOZ_ASSERT(target);
 
-    aActor->SetEventTargetForActor(this, target);
+    actor->SetEventTargetForActor(this, target);
   }
 
-  aActor->SendPFileSystemRequestConstructor(this, params);
+  actor->SendPFileSystemRequestConstructor(this, params);
 }
 
 void
 FileSystemTaskChildBase::SetRequestResult(const FileSystemResponseValue& aValue)
 {
   mFileSystem->AssertIsOnOwningThread();
 
   if (aValue.type() == FileSystemResponseValue::TFileSystemErrorResponse) {
--- a/dom/filesystem/FileSystemTaskBase.h
+++ b/dom/filesystem/FileSystemTaskBase.h
@@ -5,17 +5,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_FileSystemTaskBase_h
 #define mozilla_dom_FileSystemTaskBase_h
 
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/FileSystemRequestParent.h"
 #include "mozilla/dom/PFileSystemRequestChild.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsThreadUtils.h"
 
 namespace mozilla {
 namespace dom {
 
 class BlobImpl;
 class FileSystemBase;
 class FileSystemParams;
@@ -94,21 +93,19 @@ class FileSystemParams;
  *   function -[GetSuccessRequestResult].
  * Child/Parent:
  *   (7) The process receives IPC and calls [SetRequestResult] to get the
  *   task result. Each task needs to implement its specific success result
  *   parsing function [SetSuccessRequestResult] to get the success result.
  *   (8) Call [HandlerCallback] to send the task result to the content page.
  */
 class FileSystemTaskChildBase : public PFileSystemRequestChild
-                              , public nsIIPCBackgroundChildCreateCallback
 {
 public:
-  NS_DECL_ISUPPORTS
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
+  NS_INLINE_DECL_REFCOUNTING(FileSystemTaskChildBase)
 
   /*
    * Start the task. It will dispatch all the information to the parent process,
    * PBackground thread. This method must be called from the owning thread.
    */
   void
   Start();
 
--- a/dom/gamepad/GamepadManager.cpp
+++ b/dom/gamepad/GamepadManager.cpp
@@ -135,22 +135,38 @@ void
 GamepadManager::AddListener(nsGlobalWindow* aWindow)
 {
   MOZ_ASSERT(aWindow);
   MOZ_ASSERT(aWindow->IsInnerWindow());
   MOZ_ASSERT(NS_IsMainThread());
 
   // IPDL child has not been created
   if (mChannelChildren.IsEmpty()) {
-    PBackgroundChild *actor = BackgroundChild::GetForCurrentThread();
-    //Try to get the PBackground Child actor
-    if (actor) {
-      ActorCreated(actor);
-    } else {
-      Unused << BackgroundChild::GetOrCreateForCurrentThread(this);
+    PBackgroundChild* actor = BackgroundChild::GetOrCreateForCurrentThread();
+    if (NS_WARN_IF(!actor)) {
+      MOZ_CRASH("Failed to create a PBackgroundChild actor!");
+    }
+
+    GamepadEventChannelChild *child = new GamepadEventChannelChild();
+    PGamepadEventChannelChild *initedChild =
+      actor->SendPGamepadEventChannelConstructor(child);
+    if (NS_WARN_IF(!initedChild)) {
+      MOZ_CRASH("Failed to create a PBackgroundChild actor!");
+      return;
+    }
+
+    MOZ_ASSERT(initedChild == child);
+    child->SendGamepadListenerAdded();
+    mChannelChildren.AppendElement(child);
+
+    if (gfx::VRManagerChild::IsCreated()) {
+      // Construct VRManagerChannel and ask adding the connected
+      // VR controllers to GamepadManager
+      gfx::VRManagerChild* vm = gfx::VRManagerChild::Get();
+      vm->SendControllerListenerAdded();
     }
   }
 
   if (!mEnabled || mShuttingDown || nsContentUtils::ShouldResistFingerprinting()) {
     return;
   }
 
   if (mListeners.IndexOf(aWindow) != NoIndex) {
@@ -688,41 +704,10 @@ GamepadManager::StopHaptics()
     } else {
       for (auto& channelChild : mChannelChildren) {
         channelChild->SendStopVibrateHaptic(gamepadIndex);
       }
     }
   }
 }
 
-//Override nsIIPCBackgroundChildCreateCallback
-void
-GamepadManager::ActorCreated(PBackgroundChild *aActor)
-{
-  MOZ_ASSERT(aActor);
-  GamepadEventChannelChild *child = new GamepadEventChannelChild();
-  PGamepadEventChannelChild *initedChild =
-    aActor->SendPGamepadEventChannelConstructor(child);
-  if (NS_WARN_IF(!initedChild)) {
-    ActorFailed();
-    return;
-  }
-  MOZ_ASSERT(initedChild == child);
-  child->SendGamepadListenerAdded();
-  mChannelChildren.AppendElement(child);
-
-  if (gfx::VRManagerChild::IsCreated()) {
-    // Construct VRManagerChannel and ask adding the connected
-    // VR controllers to GamepadManager
-    gfx::VRManagerChild* vm = gfx::VRManagerChild::Get();
-    vm->SendControllerListenerAdded();
-  }
-}
-
-//Override nsIIPCBackgroundChildCreateCallback
-void
-GamepadManager::ActorFailed()
-{
-  MOZ_CRASH("Gamepad IPC actor create failed!");
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/dom/gamepad/GamepadManager.h
+++ b/dom/gamepad/GamepadManager.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #ifndef mozilla_dom_GamepadManager_h_
 #define mozilla_dom_GamepadManager_h_
 
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIObserver.h"
 // Needed for GamepadMappingType
 #include "mozilla/dom/GamepadBinding.h"
 #include "mozilla/dom/GamepadServiceType.h"
 
 class nsGlobalWindow;
 
 namespace mozilla {
@@ -21,23 +20,21 @@ class VRManagerChild;
 } // namespace gfx
 namespace dom {
 
 class EventTarget;
 class Gamepad;
 class GamepadChangeEvent;
 class GamepadEventChannelChild;
 
-class GamepadManager final : public nsIObserver,
-                             public nsIIPCBackgroundChildCreateCallback
+class GamepadManager final : public nsIObserver
 {
  public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIOBSERVER
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
 
   // Returns true if we actually have a service up and running
   static bool IsServiceRunning();
   // Get the singleton service
   static already_AddRefed<GamepadManager> GetService();
   // Return true if the API is preffed on.
   static bool IsAPIEnabled();
 
--- a/dom/gamepad/GamepadServiceTest.cpp
+++ b/dom/gamepad/GamepadServiceTest.cpp
@@ -30,17 +30,16 @@ namespace dom {
  * of the GamepadService to JavaScript via WebIDL so that we can write Mochitests
  * that add and remove fake gamepads, avoiding the platform-specific backends.
  */
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(GamepadServiceTest, DOMEventTargetHelper,
                                    mWindow)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(GamepadServiceTest)
-  NS_INTERFACE_MAP_ENTRY(nsIIPCBackgroundChildCreateCallback)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(GamepadServiceTest, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(GamepadServiceTest, DOMEventTargetHelper)
 
 // static
 already_AddRefed<GamepadServiceTest>
 GamepadServiceTest::CreateTestService(nsPIDOMWindowInner* aWindow)
@@ -69,41 +68,35 @@ GamepadServiceTest::GamepadServiceTest(n
 {}
 
 GamepadServiceTest::~GamepadServiceTest() {}
 
 void
 GamepadServiceTest::InitPBackgroundActor()
 {
   MOZ_ASSERT(!mChild);
-  PBackgroundChild *actor = BackgroundChild::GetForCurrentThread();
-  //Try to get the PBackground Child actor
-  if (actor) {
-    ActorCreated(actor);
-  } else {
-    Unused << BackgroundChild::GetOrCreateForCurrentThread(this);
+
+  PBackgroundChild* actor = BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actor)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
+  }
+
+  mChild = new GamepadTestChannelChild();
+  PGamepadTestChannelChild* initedChild =
+    actor->SendPGamepadTestChannelConstructor(mChild);
+  if (NS_WARN_IF(!initedChild)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
   }
 }
 
 void
 GamepadServiceTest::DestroyPBackgroundActor()
 {
-  if (mChild) {
-    // If mChild exists, which means that IPDL channel
-    // has been created, our pending operations should
-    // be empty.
-    MOZ_ASSERT(mPendingOperations.IsEmpty());
-    mChild->SendShutdownChannel();
-    mChild = nullptr;
-  } else {
-    // If the IPDL channel has not been created and we
-    // want to destroy it now, just cancel all pending
-    // operations.
-    mPendingOperations.Clear();
-  }
+  mChild->SendShutdownChannel();
+  mChild = nullptr;
 }
 
 already_AddRefed<Promise>
 GamepadServiceTest::AddGamepad(const nsAString& aID,
                                GamepadMappingType aMapping,
                                GamepadHand aHand,
                                uint32_t aNumButtons,
                                uint32_t aNumAxes,
@@ -123,44 +116,36 @@ GamepadServiceTest::AddGamepad(const nsA
   nsCOMPtr<nsIGlobalObject> go = do_QueryInterface(mWindow);
 
   RefPtr<Promise> p = Promise::Create(go, aRv);
   if (aRv.Failed()) {
     return nullptr;
   }
 
   uint32_t id = ++mEventNumber;
-  if (mChild) {
-    mChild->AddPromise(id, p);
-    mChild->SendGamepadTestEvent(id, e);
-  } else {
-    PendingOperation op(id, e, p);
-    mPendingOperations.AppendElement(op);
-  }
+
+  mChild->AddPromise(id, p);
+  mChild->SendGamepadTestEvent(id, e);
+
   return p.forget();
 }
 
 void
 GamepadServiceTest::RemoveGamepad(uint32_t aIndex)
 {
   if (mShuttingDown) {
     return;
   }
 
   GamepadRemoved a;
   GamepadChangeEventBody body(a);
   GamepadChangeEvent e(aIndex, GamepadServiceType::Standard, body);
 
   uint32_t id = ++mEventNumber;
-  if (mChild) {
-    mChild->SendGamepadTestEvent(id, e);
-  } else {
-    PendingOperation op(id, e);
-    mPendingOperations.AppendElement(op);
-  }
+  mChild->SendGamepadTestEvent(id, e);
 }
 
 void
 GamepadServiceTest::NewButtonEvent(uint32_t aIndex,
                                    uint32_t aButton,
                                    bool aTouched,
                                    bool aPressed)
 {
@@ -168,22 +153,17 @@ GamepadServiceTest::NewButtonEvent(uint3
     return;
   }
 
   GamepadButtonInformation a(aButton, aPressed ? 1.0 : 0, aPressed, aTouched);
   GamepadChangeEventBody body(a);
   GamepadChangeEvent e(aIndex, GamepadServiceType::Standard, body);
 
   uint32_t id = ++mEventNumber;
-  if (mChild) {
-    mChild->SendGamepadTestEvent(id, e);
-  } else {
-    PendingOperation op(id, e);
-    mPendingOperations.AppendElement(op);
-  }
+  mChild->SendGamepadTestEvent(id, e);
 }
 
 void
 GamepadServiceTest::NewButtonValueEvent(uint32_t aIndex,
                                         uint32_t aButton,
                                         bool aPressed,
                                         bool aTouched,
                                         double aValue)
@@ -192,44 +172,34 @@ GamepadServiceTest::NewButtonValueEvent(
     return;
   }
 
   GamepadButtonInformation a(aButton, aValue, aPressed, aTouched);
   GamepadChangeEventBody body(a);
   GamepadChangeEvent e(aIndex, GamepadServiceType::Standard, body);
 
   uint32_t id = ++mEventNumber;
-  if (mChild) {
-    mChild->SendGamepadTestEvent(id, e);
-  } else {
-    PendingOperation op(id, e);
-    mPendingOperations.AppendElement(op);
-  }
+  mChild->SendGamepadTestEvent(id, e);
 }
 
 void
 GamepadServiceTest::NewAxisMoveEvent(uint32_t aIndex,
                                      uint32_t aAxis,
                                      double aValue)
 {
   if (mShuttingDown) {
     return;
   }
 
   GamepadAxisInformation a(aAxis, aValue);
   GamepadChangeEventBody body(a);
   GamepadChangeEvent e(aIndex, GamepadServiceType::Standard, body);
 
   uint32_t id = ++mEventNumber;
-  if (mChild) {
-    mChild->SendGamepadTestEvent(id, e);
-  } else {
-    PendingOperation op(id, e);
-    mPendingOperations.AppendElement(op);
-  }
+  mChild->SendGamepadTestEvent(id, e);
 }
 
 void
 GamepadServiceTest::NewPoseMove(uint32_t aIndex,
                                 const Nullable<Float32Array>& aOrient,
                                 const Nullable<Float32Array>& aPos,
                                 const Nullable<Float32Array>& aAngVelocity,
                                 const Nullable<Float32Array>& aAngAcceleration,
@@ -297,64 +267,17 @@ GamepadServiceTest::NewPoseMove(uint32_t
     poseState.linearAcceleration[2] = value.Data()[2];
   }
 
   GamepadPoseInformation a(poseState);
   GamepadChangeEventBody body(a);
   GamepadChangeEvent e(aIndex, GamepadServiceType::Standard, body);
 
   uint32_t id = ++mEventNumber;
-  if (mChild) {
-    mChild->SendGamepadTestEvent(id, e);
-  } else {
-    PendingOperation op(id, e);
-    mPendingOperations.AppendElement(op);
-  }
-}
-
-void
-GamepadServiceTest::FlushPendingOperations()
-{
-  for (uint32_t i=0; i < mPendingOperations.Length(); ++i) {
-    PendingOperation op = mPendingOperations[i];
-    if (op.mPromise) {
-      mChild->AddPromise(op.mID, op.mPromise);
-    }
-    mChild->SendGamepadTestEvent(op.mID, op.mEvent);
-  }
-  mPendingOperations.Clear();
-}
-
-void
-GamepadServiceTest::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(aActor);
-  // If we are shutting down, we don't need to create the
-  // IPDL child/parent pair anymore.
-  if (mShuttingDown) {
-    // mPendingOperations should be cleared in
-    // DestroyPBackgroundActor()
-    MOZ_ASSERT(mPendingOperations.IsEmpty());
-    return;
-  }
-
-  mChild = new GamepadTestChannelChild();
-  PGamepadTestChannelChild* initedChild =
-    aActor->SendPGamepadTestChannelConstructor(mChild);
-  if (NS_WARN_IF(!initedChild)) {
-    ActorFailed();
-    return;
-  }
-  FlushPendingOperations();
-}
-
-void
-GamepadServiceTest::ActorFailed()
-{
-  MOZ_CRASH("Failed to create background child actor!");
+  mChild->SendGamepadTestEvent(id, e);
 }
 
 JSObject*
 GamepadServiceTest::WrapObject(JSContext* aCx, JS::HandleObject aGivenProto)
 {
   return GamepadServiceTestBinding::Wrap(aCx, this, aGivenProto);
 }
 
--- a/dom/gamepad/GamepadServiceTest.h
+++ b/dom/gamepad/GamepadServiceTest.h
@@ -2,34 +2,31 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* 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/. */
 
 #ifndef mozilla_dom_GamepadServiceTest_h_
 #define mozilla_dom_GamepadServiceTest_h_
 
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "mozilla/dom/GamepadBinding.h"
 
 namespace mozilla {
 namespace dom {
 
 class GamepadChangeEvent;
 class GamepadManager;
 class GamepadTestChannelChild;
 class Promise;
 
 // Service for testing purposes
-class GamepadServiceTest final : public DOMEventTargetHelper,
-                                 public nsIIPCBackgroundChildCreateCallback
+class GamepadServiceTest final : public DOMEventTargetHelper
 {
 public:
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(GamepadServiceTest,
                                            DOMEventTargetHelper)
 
   GamepadMappingType NoMapping() const { return GamepadMappingType::_empty; }
   GamepadMappingType StandardMapping() const { return GamepadMappingType::Standard; }
   GamepadHand NoHand() const { return GamepadHand::_empty; }
   GamepadHand LeftHand() const { return GamepadHand::Left; }
@@ -57,46 +54,31 @@ public:
   void Shutdown();
 
   static already_AddRefed<GamepadServiceTest> CreateTestService(nsPIDOMWindowInner* aWindow);
   nsPIDOMWindowInner* GetParentObject() const { return mWindow; }
   JSObject* WrapObject(JSContext* aCx, JS::HandleObject aGivenProto) override;
 
 private:
 
-  // We need to asynchronously create IPDL channel, it is possible that
-  // we send commands before the channel is created, so we have to buffer
-  // them until the channel is created in that case.
-  struct PendingOperation {
-    explicit PendingOperation(const uint32_t& aID,
-                              const GamepadChangeEvent& aEvent,
-                              Promise* aPromise = nullptr)
-               : mID(aID), mEvent(aEvent), mPromise(aPromise) {}
-    uint32_t mID;
-    const GamepadChangeEvent& mEvent;
-    RefPtr<Promise> mPromise;
-  };
-
   // Hold a reference to the gamepad service so we don't have to worry about
   // execution order in tests.
   RefPtr<GamepadManager> mService;
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
-  nsTArray<PendingOperation> mPendingOperations;
   uint32_t mEventNumber;
   bool mShuttingDown;
 
   // IPDL Channel for us to send test events to GamepadPlatformService, it
   // will only be used in this singleton class and deleted during the IPDL
   // shutdown chain
   GamepadTestChannelChild* MOZ_NON_OWNING_REF mChild;
 
   explicit GamepadServiceTest(nsPIDOMWindowInner* aWindow);
   ~GamepadServiceTest();
   void InitPBackgroundActor();
   void DestroyPBackgroundActor();
-  void FlushPendingOperations();
 
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif
--- a/dom/html/test/mochitest.ini
+++ b/dom/html/test/mochitest.ini
@@ -541,17 +541,16 @@ skip-if = toolkit == "android" || toolki
 [test_bug403868.xhtml]
 [test_bug435128.html]
 skip-if = true # Disabled for timeouts.
 [test_bug463104.html]
 [test_form-parsing.html]
 [test_viewport.html]
 [test_documentAll.html]
 [test_document-element-inserted.html]
-[test_document.watch.html]
 [test_bug445004.html]
 skip-if = true || toolkit == 'android' # Disabled permanently (bug 559932).
 [test_bug446483.html]
 skip-if = toolkit == 'android'
 [test_bug448564.html]
 [test_bug478251.html]
 [test_bug481440.html]
 [test_bug481647.html]
deleted file mode 100644
--- a/dom/html/test/test_document.watch.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=903332
--->
-<head>
-  <meta charset="utf-8">
-  <title>Test for Bug 903332</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-  <script type="application/javascript">
-
-  /** Test for Bug 903332 **/
-
-  var watch1Called;
-  function watch1(prop, oldValue, newValue)
-  {
-    is(watch1Called, false, "watch1Called not reset properly?");
-    watch1Called = true;
-
-    is(prop, "cookie", "wrong property name passed to watch1");
-    return newValue;
-  }
-
-  var watch2Called;
-  function watch2(prop, oldValue, newValue)
-  {
-    is(watch2Called, false, "watch2Called not reset properly?");
-    watch2Called = true;
-
-    is(prop, "cookie", "wrong property name passed to watch2");
-    return newValue;
-  }
-
-  // Just in case subsequent tests depend on a particular value...
-  var originalValue = document.cookie;
-  ok(true, "originalValue: " + originalValue);
-
-  var originalPrefix = originalValue.length > 0 ? originalValue + "; " : "";
-
-  try
-  {
-    // trial set (no watch) to verify things work
-    document.cookie = "first=set";
-    is(document.cookie, originalPrefix + "first=set",
-       "first value correct");
-
-    // add a watch
-    document.watch("cookie", watch1);
-
-    // set, check for watch invoked
-    watch1Called = false;
-    document.cookie = "second=set";
-    is(watch1Called, true, "watch1 function should be called");
-    is(document.cookie, originalPrefix + "first=set; second=set",
-       "second value correct");
-
-    // and a second time, just in case
-    watch1Called = false;
-    document.cookie = "third=set";
-    is(watch1Called, true, "watch1 function should be called");
-    is(document.cookie, originalPrefix + "first=set; second=set; third=set",
-       "third value correct");
-
-    // overwrite the current watch with a new one
-    document.watch("cookie", watch2);
-
-    // set, check for watch invoked
-    watch1Called = false;
-    watch2Called = false;
-    document.cookie = "fourth=set";
-    is(watch1Called, false, "watch1 invoked erroneously");
-    is(watch2Called, true, "watch2 function should be called");
-    is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set",
-       "fourth value correct");
-
-    // and a second time, just in case
-    watch1Called = false;
-    watch2Called = false;
-    document.cookie = "fifth=set";
-    is(watch1Called, false, "watch1 invoked erroneously");
-    is(watch2Called, true, "watch2 function should be called");
-    is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set; fifth=set",
-       "fifth value correct");
-
-    // remove the watch
-    document.unwatch("cookie");
-
-    // check for non-invocation now
-    watch1Called = false;
-    watch2Called = false;
-    document.cookie = "sixth=set";
-    is(watch1Called, false, "watch1 shouldn't be called");
-    is(watch2Called, false, "watch2 shouldn't be called");
-    is(document.cookie, originalPrefix + "first=set; second=set; third=set; fourth=set; fifth=set; sixth=set",
-       "sixth value correct");
-  }
-  finally
-  {
-    // reset
-    document.unwatch("cookie"); // harmless, should be no-op except if bugs
-
-    var d = new Date();
-    d.setTime(0);
-    var suffix = "=; expires=" + d.toGMTString();
-
-    document.cookie = "first" + suffix;
-    document.cookie = "second" + suffix;
-    document.cookie = "third" + suffix;
-    document.cookie = "fourth" + suffix;
-    document.cookie = "fifth" + suffix;
-    document.cookie = "sixth" + suffix;
-  }
-
-  is(document.cookie, originalValue,
-     "document.cookie isn't what it was initially!  expect bustage further " +
-     "down the line");
-  </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=903332">Mozilla Bug 903332</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -20,17 +20,16 @@
 #include "mozilla/ipc/PBackground.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/Telemetry.h"
 #include "mozIThirdPartyUtil.h"
 #include "nsAboutProtocolUtils.h"
 #include "nsContentUtils.h"
 #include "nsGlobalWindow.h"
 #include "nsIAboutModule.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsILoadContext.h"
 #include "nsIPrincipal.h"
 #include "nsIURI.h"
 #include "nsIUUIDGenerator.h"
 #include "nsIWebNavigation.h"
 #include "nsSandboxFlags.h"
 #include "nsServiceManagerUtils.h"
 #include "ProfilerHelpers.h"
@@ -51,41 +50,16 @@ using namespace mozilla::dom::quota;
 using namespace mozilla::ipc;
 
 namespace {
 
 const char kPrefIndexedDBEnabled[] = "dom.indexedDB.enabled";
 
 } // namespace
 
-class IDBFactory::BackgroundCreateCallback final
-  : public nsIIPCBackgroundChildCreateCallback
-{
-  RefPtr<IDBFactory> mFactory;
-  LoggingInfo mLoggingInfo;
-
-public:
-  explicit
-  BackgroundCreateCallback(IDBFactory* aFactory,
-                           const LoggingInfo& aLoggingInfo)
-    : mFactory(aFactory)
-    , mLoggingInfo(aLoggingInfo)
-  {
-    MOZ_ASSERT(aFactory);
-  }
-
-  NS_DECL_ISUPPORTS
-
-private:
-  ~BackgroundCreateCallback()
-  { }
-
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
-};
-
 struct IDBFactory::PendingRequestInfo
 {
   RefPtr<IDBOpenDBRequest> mRequest;
   FactoryRequestParams mParams;
 
   PendingRequestInfo(IDBOpenDBRequest* aRequest,
                      const FactoryRequestParams& aParams)
   : mRequest(aRequest), mParams(aParams)
@@ -701,17 +675,17 @@ IDBFactory::OpenInternal(JSContext* aCx,
   if (aDeleting) {
     metadata.version() = 0;
     params = DeleteDatabaseRequestParams(commonParams);
   } else {
     metadata.version() = version;
     params = OpenDatabaseRequestParams(commonParams);
   }
 
-  if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
+  if (!mBackgroundActor) {
     BackgroundChildImpl::ThreadLocal* threadLocal =
       BackgroundChildImpl::GetThreadLocalForCurrentThread();
 
     nsAutoPtr<ThreadLocal> newIDBThreadLocal;
     ThreadLocal* idbThreadLocal;
 
     if (threadLocal && threadLocal->mIndexedDBThreadLocal) {
       idbThreadLocal = threadLocal->mIndexedDBThreadLocal;
@@ -721,24 +695,38 @@ IDBFactory::OpenInternal(JSContext* aCx,
       MOZ_ASSERT(uuidGen);
 
       nsID id;
       MOZ_ALWAYS_SUCCEEDS(uuidGen->GenerateUUIDInPlace(&id));
 
       newIDBThreadLocal = idbThreadLocal = new ThreadLocal(id);
     }
 
-    if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
-      BackgroundActorCreated(actor, idbThreadLocal->GetLoggingInfo());
-    } else {
-      // We need to start the sequence to create a background actor for this
-      // thread.
-      RefPtr<BackgroundCreateCallback> cb =
-        new BackgroundCreateCallback(this, idbThreadLocal->GetLoggingInfo());
-      if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
+    PBackgroundChild* backgroundActor =
+      BackgroundChild::GetOrCreateForCurrentThread();
+    if (NS_WARN_IF(!backgroundActor)) {
+      IDB_REPORT_INTERNAL_ERR();
+      aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
+      return nullptr;
+    }
+
+    {
+      BackgroundFactoryChild* actor = new BackgroundFactoryChild(this);
+
+      // Set EventTarget for the top-level actor.
+      // All child actors created later inherit the same event target.
+      backgroundActor->SetEventTargetForActor(actor, EventTarget());
+      MOZ_ASSERT(actor->GetActorEventTarget());
+      mBackgroundActor =
+        static_cast<BackgroundFactoryChild*>(
+          backgroundActor->SendPBackgroundIDBFactoryConstructor(actor,
+                                                                idbThreadLocal->GetLoggingInfo()));
+
+      if (NS_WARN_IF(!mBackgroundActor)) {
+        mBackgroundActorFailed = true;
         IDB_REPORT_INTERNAL_ERR();
         aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
         return nullptr;
       }
     }
 
     if (newIDBThreadLocal) {
       if (!threadLocal) {
@@ -784,99 +772,27 @@ IDBFactory::OpenInternal(JSContext* aCx,
                    "indexedDB.open(\"%s\", %s)",
                  "IndexedDB %s: C R[%llu]: IDBFactory.open()",
                  IDB_LOG_ID_STRING(),
                  request->LoggingSerialNumber(),
                  NS_ConvertUTF16toUTF8(aName).get(),
                  IDB_LOG_STRINGIFY(aVersion));
   }
 
-  // If we already have a background actor then we can start this request now.
-  if (mBackgroundActor) {
-    nsresult rv = InitiateRequest(request, params);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      IDB_REPORT_INTERNAL_ERR();
-      aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
-      return nullptr;
-    }
-  } else {
-    mPendingRequests.AppendElement(new PendingRequestInfo(request, params));
+  nsresult rv = InitiateRequest(request, params);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    IDB_REPORT_INTERNAL_ERR();
+    aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
+    return nullptr;
   }
 
   return request.forget();
 }
 
 nsresult
-IDBFactory::BackgroundActorCreated(PBackgroundChild* aBackgroundActor,
-                                   const LoggingInfo& aLoggingInfo)
-{
-  MOZ_ASSERT(aBackgroundActor);
-  MOZ_ASSERT(!mBackgroundActor);
-  MOZ_ASSERT(!mBackgroundActorFailed);
-
-  {
-    BackgroundFactoryChild* actor = new BackgroundFactoryChild(this);
-
-    // Set EventTarget for the top-level actor.
-    // All child actors created later inherit the same event target.
-    aBackgroundActor->SetEventTargetForActor(actor, EventTarget());
-    MOZ_ASSERT(actor->GetActorEventTarget());
-    mBackgroundActor =
-      static_cast<BackgroundFactoryChild*>(
-        aBackgroundActor->SendPBackgroundIDBFactoryConstructor(actor,
-                                                               aLoggingInfo));
-  }
-
-  if (NS_WARN_IF(!mBackgroundActor)) {
-    BackgroundActorFailed();
-    return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
-  }
-
-  nsresult rv = NS_OK;
-
-  for (uint32_t index = 0, count = mPendingRequests.Length();
-       index < count;
-       index++) {
-    nsAutoPtr<PendingRequestInfo> info(mPendingRequests[index].forget());
-
-    nsresult rv2 = InitiateRequest(info->mRequest, info->mParams);
-
-    // Warn for every failure, but just return the first failure if there are
-    // multiple failures.
-    if (NS_WARN_IF(NS_FAILED(rv2)) && NS_SUCCEEDED(rv)) {
-      rv = rv2;
-    }
-  }
-
-  mPendingRequests.Clear();
-
-  return rv;
-}
-
-void
-IDBFactory::BackgroundActorFailed()
-{
-  MOZ_ASSERT(!mPendingRequests.IsEmpty());
-  MOZ_ASSERT(!mBackgroundActor);
-  MOZ_ASSERT(!mBackgroundActorFailed);
-
-  mBackgroundActorFailed = true;
-
-  for (uint32_t index = 0, count = mPendingRequests.Length();
-       index < count;
-       index++) {
-    nsAutoPtr<PendingRequestInfo> info(mPendingRequests[index].forget());
-    info->mRequest->
-      DispatchNonTransactionError(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
-  }
-
-  mPendingRequests.Clear();
-}
-
-nsresult
 IDBFactory::InitiateRequest(IDBOpenDBRequest* aRequest,
                             const FactoryRequestParams& aParams)
 {
   MOZ_ASSERT(aRequest);
   MOZ_ASSERT(mBackgroundActor);
   MOZ_ASSERT(!mBackgroundActorFailed);
 
   bool deleting;
@@ -947,36 +863,10 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(IDB
 NS_IMPL_CYCLE_COLLECTION_TRACE_END
 
 JSObject*
 IDBFactory::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return IDBFactoryBinding::Wrap(aCx, this, aGivenProto);
 }
 
-NS_IMPL_ISUPPORTS(IDBFactory::BackgroundCreateCallback,
-                  nsIIPCBackgroundChildCreateCallback)
-
-void
-IDBFactory::BackgroundCreateCallback::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(aActor);
-  MOZ_ASSERT(mFactory);
-
-  RefPtr<IDBFactory> factory;
-  mFactory.swap(factory);
-
-  factory->BackgroundActorCreated(aActor, mLoggingInfo);
-}
-
-void
-IDBFactory::BackgroundCreateCallback::ActorFailed()
-{
-  MOZ_ASSERT(mFactory);
-
-  RefPtr<IDBFactory> factory;
-  mFactory.swap(factory);
-
-  factory->BackgroundActorFailed();
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/IDBFactory.h
+++ b/dom/indexedDB/IDBFactory.h
@@ -64,18 +64,16 @@ class IDBFactory final
   // mOwningObject must be non-null.
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
   JS::Heap<JSObject*> mOwningObject;
 
   // This will only be set if the factory belongs to a window in a child
   // process.
   RefPtr<TabChild> mTabChild;
 
-  nsTArray<nsAutoPtr<PendingRequestInfo>> mPendingRequests;
-
   indexedDB::BackgroundFactoryChild* mBackgroundActor;
 
   // A DocGroup-specific EventTarget if created by CreateForWindow().
   // Otherwise, it must either be set to SystemGroup on main thread or
   // NS_GetCurrentThread() off main thread.
   nsCOMPtr<nsIEventTarget> mEventTarget;
 
   uint64_t mInnerWindowID;
@@ -262,23 +260,16 @@ private:
                const nsAString& aName,
                const Optional<uint64_t>& aVersion,
                const Optional<StorageType>& aStorageType,
                bool aDeleting,
                CallerType aCallerType,
                ErrorResult& aRv);
 
   nsresult
-  BackgroundActorCreated(PBackgroundChild* aBackgroundActor,
-                         const indexedDB::LoggingInfo& aLoggingInfo);
-
-  void
-  BackgroundActorFailed();
-
-  nsresult
   InitiateRequest(IDBOpenDBRequest* aRequest,
                   const indexedDB::FactoryRequestParams& aParams);
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_idbfactory_h__
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -102,17 +102,16 @@
 
 #include "mozInlineSpellChecker.h"
 #include "nsDocShell.h"
 #include "nsIConsoleListener.h"
 #include "nsIContentViewer.h"
 #include "nsICycleCollectorListener.h"
 #include "nsIIdlePeriod.h"
 #include "nsIDragService.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsIMemoryReporter.h"
 #include "nsIMemoryInfoDumper.h"
 #include "nsIMutable.h"
 #include "nsIObserverService.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsMemoryInfoDumper.h"
 #include "nsServiceManagerUtils.h"
@@ -463,41 +462,16 @@ ConsoleListener::Observe(nsIConsoleMessa
 
   nsString msg;
   nsresult rv = aMessage->GetMessageMoz(getter_Copies(msg));
   NS_ENSURE_SUCCESS(rv, rv);
   mChild->SendConsoleMessage(msg);
   return NS_OK;
 }
 
-class BackgroundChildPrimer final :
-  public nsIIPCBackgroundChildCreateCallback
-{
-public:
-  BackgroundChildPrimer()
-  { }
-
-  NS_DECL_ISUPPORTS
-
-private:
-  ~BackgroundChildPrimer() = default;
-
-  void
-  ActorCreated(PBackgroundChild* aActor) override
-  {
-    MOZ_ASSERT(aActor, "Failed to create a PBackgroundChild actor!");
-  }
-
-  void
-  ActorFailed() override
-  {
-    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
-  }
-};
-
 #ifdef NIGHTLY_BUILD
 /**
  * The singleton of this class is registered with the HangMonitor as an
  * annotator, so that the hang monitor can record whether or not there were
  * pending input events when the thread hung.
  */
 class PendingInputEventHangAnnotator final
   : public HangMonitor::Annotator
@@ -511,18 +485,16 @@ public:
     }
   }
 
   static PendingInputEventHangAnnotator sSingleton;
 };
 PendingInputEventHangAnnotator PendingInputEventHangAnnotator::sSingleton;
 #endif
 
-NS_IMPL_ISUPPORTS(BackgroundChildPrimer, nsIIPCBackgroundChildCreateCallback)
-
 class ContentChild::ShutdownCanary final
 { };
 
 ContentChild* ContentChild::sSingleton;
 StaticAutoPtr<ContentChild::ShutdownCanary> ContentChild::sShutdownCanary;
 
 ContentChild::ContentChild()
  : mID(uint64_t(-1))
@@ -1162,19 +1134,18 @@ ContentChild::InitXPCOM(const XPCOMInitD
   for (unsigned int i = 0; i < aXPCOMInit.prefs().Length(); i++) {
     Preferences::SetPreference(aXPCOMInit.prefs().ElementAt(i));
   }
   SET_PREF_PHASE(pref_initPhase::END_ALL_PREFS);
   // Do this as early as possible to get the parent process to initialize the
   // background thread since we'll likely need database information very soon.
   BackgroundChild::Startup();
 
-  nsCOMPtr<nsIIPCBackgroundChildCreateCallback> callback =
-    new BackgroundChildPrimer();
-  if (!BackgroundChild::GetOrCreateForCurrentThread(callback)) {
+  PBackgroundChild* actorChild = BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actorChild)) {
     MOZ_CRASH("Failed to create PBackgroundChild!");
   }
 
   nsCOMPtr<nsIConsoleService> svc(do_GetService(NS_CONSOLESERVICE_CONTRACTID));
   if (!svc) {
     NS_WARNING("Couldn't acquire console service");
     return;
   }
--- a/dom/messagechannel/MessagePort.cpp
+++ b/dom/messagechannel/MessagePort.cpp
@@ -191,17 +191,16 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
   if (tmp->mPostMessageRunnable) {
     NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPostMessageRunnable->mPort);
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mUnshippedEntangledPort);
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MessagePort)
-  NS_INTERFACE_MAP_ENTRY(nsIIPCBackgroundChildCreateCallback)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(MessagePort, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(MessagePort, DOMEventTargetHelper)
 
 namespace {
 
@@ -230,60 +229,16 @@ public:
 
 private:
   ~MessagePortWorkerHolder()
   {
     MOZ_COUNT_DTOR(MessagePortWorkerHolder);
   }
 };
 
-class ForceCloseHelper final : public nsIIPCBackgroundChildCreateCallback
-{
-public:
-  NS_DECL_ISUPPORTS
-
-  static void ForceClose(const MessagePortIdentifier& aIdentifier)
-  {
-    PBackgroundChild* actor =
-      mozilla::ipc::BackgroundChild::GetForCurrentThread();
-    if (actor) {
-      Unused << actor->SendMessagePortForceClose(aIdentifier.uuid(),
-                                                 aIdentifier.destinationUuid(),
-                                                 aIdentifier.sequenceId());
-      return;
-    }
-
-    RefPtr<ForceCloseHelper> helper = new ForceCloseHelper(aIdentifier);
-    if (NS_WARN_IF(!mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread(helper))) {
-      MOZ_CRASH();
-    }
-  }
-
-private:
-  explicit ForceCloseHelper(const MessagePortIdentifier& aIdentifier)
-    : mIdentifier(aIdentifier)
-  {}
-
-  ~ForceCloseHelper() {}
-
-  void ActorFailed() override
-  {
-    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
-  }
-
-  void ActorCreated(mozilla::ipc::PBackgroundChild* aActor) override
-  {
-    ForceClose(mIdentifier);
-  }
-
-  const MessagePortIdentifier mIdentifier;
-};
-
-NS_IMPL_ISUPPORTS(ForceCloseHelper, nsIIPCBackgroundChildCreateCallback)
-
 } // namespace
 
 MessagePort::MessagePort(nsIGlobalObject* aGlobal)
   : DOMEventTargetHelper(aGlobal)
   , mInnerID(0)
   , mMessageQueueEnabled(false)
   , mIsKeptAlive(false)
 {
@@ -872,48 +827,26 @@ MessagePort::Closed()
   UpdateMustKeepAlive();
 }
 
 void
 MessagePort::ConnectToPBackground()
 {
   mState = eStateEntangling;
 
-  PBackgroundChild* actor =
-    mozilla::ipc::BackgroundChild::GetForCurrentThread();
-  if (actor) {
-    ActorCreated(actor);
-  } else {
-    if (NS_WARN_IF(
-        !mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread(this))) {
-      MOZ_CRASH();
-    }
+  mozilla::ipc::PBackgroundChild* actorChild =
+    mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actorChild)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
   }
-}
-
-void
-MessagePort::ActorFailed()
-{
-  MOZ_CRASH("Failed to create a PBackgroundChild actor!");
-}
-
-void
-MessagePort::ActorCreated(mozilla::ipc::PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(aActor);
-  MOZ_ASSERT(!mActor);
-  MOZ_ASSERT(mIdentifier);
-  MOZ_ASSERT(mState == eStateEntangling ||
-             mState == eStateEntanglingForDisentangle ||
-             mState == eStateEntanglingForClose);
 
   PMessagePortChild* actor =
-    aActor->SendPMessagePortConstructor(mIdentifier->uuid(),
-                                        mIdentifier->destinationUuid(),
-                                        mIdentifier->sequenceId());
+    actorChild->SendPMessagePortConstructor(mIdentifier->uuid(),
+                                            mIdentifier->destinationUuid(),
+                                            mIdentifier->sequenceId());
 
   mActor = static_cast<MessagePortChild*>(actor);
   MOZ_ASSERT(mActor);
 
   mActor->SetPort(this);
 }
 
 void
@@ -998,17 +931,25 @@ MessagePort::RemoveDocFromBFCache()
   }
 
   bfCacheEntry->RemoveFromBFCacheSync();
 }
 
 /* static */ void
 MessagePort::ForceClose(const MessagePortIdentifier& aIdentifier)
 {
-  ForceCloseHelper::ForceClose(aIdentifier);
+  mozilla::ipc::PBackgroundChild* actorChild =
+    mozilla::ipc::BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actorChild)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
+  }
+
+  Unused << actorChild->SendMessagePortForceClose(aIdentifier.uuid(),
+                                                  aIdentifier.destinationUuid(),
+                                                  aIdentifier.sequenceId());
 }
 
 void
 MessagePort::DispatchError()
 {
   nsCOMPtr<nsIGlobalObject> globalObject = GetParentObject();
 
   AutoJSAPI jsapi;
--- a/dom/messagechannel/MessagePort.h
+++ b/dom/messagechannel/MessagePort.h
@@ -5,17 +5,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_MessagePort_h
 #define mozilla_dom_MessagePort_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DOMEventTargetHelper.h"
 #include "nsAutoPtr.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsTArray.h"
 
 #ifdef XP_WIN
 #undef PostMessage
 #endif
 
 class nsIGlobalObject;
 
@@ -28,23 +27,21 @@ class MessagePortIdentifier;
 class PostMessageRunnable;
 class SharedMessagePortMessage;
 
 namespace workers {
 class WorkerHolder;
 } // namespace workers
 
 class MessagePort final : public DOMEventTargetHelper
-                        , public nsIIPCBackgroundChildCreateCallback
                         , public nsIObserver
 {
   friend class PostMessageRunnable;
 
 public:
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
   NS_DECL_NSIOBSERVER
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MessagePort,
                                            DOMEventTargetHelper)
 
   static already_AddRefed<MessagePort>
   Create(nsIGlobalObject* aGlobal, const nsID& aUUID,
          const nsID& aDestinationUUID, ErrorResult& aRv);
--- a/dom/network/UDPSocketChild.cpp
+++ b/dom/network/UDPSocketChild.cpp
@@ -9,17 +9,16 @@
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/net/NeckoChild.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/PermissionMessageUtils.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundSharedTypes.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 
 using mozilla::net::gNeckoChild;
 
 namespace mozilla {
 namespace dom {
 
 NS_IMPL_ISUPPORTS(UDPSocketChildBase, nsIUDPSocketChild)
 
@@ -64,100 +63,29 @@ UDPSocketChild::UDPSocketChild()
 ,mLocalPort(0)
 {
 }
 
 UDPSocketChild::~UDPSocketChild()
 {
 }
 
-class UDPSocketBackgroundChildCallback final :
-  public nsIIPCBackgroundChildCreateCallback
-{
-  bool* mDone;
-
-public:
-  explicit UDPSocketBackgroundChildCallback(bool* aDone)
-  : mDone(aDone)
-  {
-    MOZ_ASSERT(!NS_IsMainThread());
-    MOZ_ASSERT(mDone);
-    MOZ_ASSERT(!*mDone);
-  }
-
-  NS_DECL_ISUPPORTS
-
-private:
-  ~UDPSocketBackgroundChildCallback()
-  { }
-
-  virtual void
-  ActorCreated(PBackgroundChild* aActor) override
-  {
-    *mDone = true;
-  }
-
-  virtual void
-  ActorFailed() override
-  {
-    *mDone = true;
-  }
-};
-
-NS_IMPL_ISUPPORTS(UDPSocketBackgroundChildCallback, nsIIPCBackgroundChildCreateCallback)
-
-nsresult
-UDPSocketChild::CreatePBackgroundSpinUntilDone()
-{
-  using mozilla::ipc::BackgroundChild;
-
-  // Spinning the event loop in MainThread would be dangerous
-  MOZ_ASSERT(!NS_IsMainThread());
-  MOZ_ASSERT(!BackgroundChild::GetForCurrentThread());
-
-  bool done = false;
-  nsCOMPtr<nsIIPCBackgroundChildCreateCallback> callback =
-    new UDPSocketBackgroundChildCallback(&done);
-
-  if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(callback))) {
-    return NS_ERROR_FAILURE;
-  }
-
-  if (!SpinEventLoopUntil([&done]() { return done; })) {
-    return NS_ERROR_FAILURE;
-  }
-
-  if (NS_WARN_IF(!BackgroundChild::GetForCurrentThread())) {
-    return NS_ERROR_FAILURE;
-  }
-
-  return NS_OK;
-}
-
 // nsIUDPSocketChild Methods
 
 NS_IMETHODIMP
 UDPSocketChild::SetBackgroundSpinsEvents()
 {
   using mozilla::ipc::BackgroundChild;
 
-  PBackgroundChild* existingBackgroundChild =
-    BackgroundChild::GetForCurrentThread();
-  // If it's not spun up yet, block until it is, and retry
-  if (!existingBackgroundChild) {
-    nsresult rv = CreatePBackgroundSpinUntilDone();
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-    existingBackgroundChild =
-      BackgroundChild::GetForCurrentThread();
-    MOZ_ASSERT(existingBackgroundChild);
+  mBackgroundManager =
+    BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!mBackgroundManager)) {
+    return NS_ERROR_FAILURE;
   }
-  // By now PBackground is guaranteed to be/have-been up
-  mBackgroundManager = existingBackgroundChild;
+
   return NS_OK;
 }
 
 NS_IMETHODIMP
 UDPSocketChild::Bind(nsIUDPSocketInternal* aSocket,
                      nsIPrincipal* aPrincipal,
                      const nsACString& aHost,
                      uint16_t aPort,
--- a/dom/network/UDPSocketChild.h
+++ b/dom/network/UDPSocketChild.h
@@ -37,18 +37,16 @@ class UDPSocketChild : public mozilla::n
 {
 public:
   NS_DECL_NSIUDPSOCKETCHILD
   NS_IMETHOD_(MozExternalRefCountType) Release() override;
 
   UDPSocketChild();
   virtual ~UDPSocketChild();
 
-  nsresult CreatePBackgroundSpinUntilDone();
-
   virtual mozilla::ipc::IPCResult RecvCallbackOpened(const UDPAddressInfo& aAddressInfo) override;
   virtual mozilla::ipc::IPCResult RecvCallbackConnected(const UDPAddressInfo& aAddressInfo) override;
   virtual mozilla::ipc::IPCResult RecvCallbackClosed() override;
   virtual mozilla::ipc::IPCResult RecvCallbackReceivedData(const UDPAddressInfo& aAddressInfo,
                                                            InfallibleTArray<uint8_t>&& aData) override;
   virtual mozilla::ipc::IPCResult RecvCallbackError(const nsCString& aMessage,
                                                     const nsCString& aFilename,
                                                     const uint32_t& aLineNumber) override;
--- a/dom/payments/PaymentRequest.cpp
+++ b/dom/payments/PaymentRequest.cpp
@@ -46,17 +46,18 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(PaymentRequest, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(PaymentRequest, DOMEventTargetHelper)
 
 bool
 PaymentRequest::PrefEnabled(JSContext* aCx, JSObject* aObj)
 {
-  return Preferences::GetBool("dom.payments.request.enabled");
+  return XRE_IsContentProcess() &&
+         Preferences::GetBool("dom.payments.request.enabled");
 }
 
 nsresult
 PaymentRequest::IsValidStandardizedPMI(const nsAString& aIdentifier,
                                        nsAString& aErrorMsg)
 {
   /*
    *   The syntax of a standardized payment method identifier is given by the
--- a/dom/payments/test/mochitest.ini
+++ b/dom/payments/test/mochitest.ini
@@ -9,15 +9,17 @@ support-files =
   CurrencyAmountValidationChromeScript.js
   GeneralChromeScript.js
   PMIValidationChromeScript.js
   ShowPaymentChromeScript.js
 
 [test_abortPayment.html]
 run-if = nightly_build # Bug 1390018: Depends on the Nightly-only UI service
 [test_basiccard.html]
+[test_block_none10s.html]
+skip-if = e10s # Bug 1408250: Don't expose PaymentRequest Constructor in non-e10s
 [test_canMakePayment.html]
 run-if = nightly_build # Bug 1390737: Depends on the Nightly-only UI service
 [test_constructor.html]
 [test_currency_amount_validation.html]
 [test_payment-request-in-iframe.html]
 [test_pmi_validation.html]
 [test_showPayment.html]
new file mode 100644
--- /dev/null
+++ b/dom/payments/test/test_block_none10s.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <title>Test for Bug 1408250</title>
+    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
+    <meta content="utf-8" http-equiv="encoding">
+    <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+
+    <script type="text/javascript">
+    "use strict";
+    SimpleTest.waitForExplicitFinish();
+
+    function testInNone10s() {
+      return new Promise((resolve,reject) => {
+        const supportedInstruments = [{
+          supportedMethods: "basic-card",
+        }];
+        const details = {
+          id: "simple details",
+          total: {
+            label: "Donation",
+            amount: { currency: "USD", value: "55.00" }
+          },
+        };
+        try {
+          const payRequest = new PaymentRequest(supportedInstruments, details);
+          ok(false, "Unexpected, new PaymentRequest() can not be used in non-e10s.");
+        } catch (err) {
+          ok(err.name, "ReferenceError",
+             "Expected ReferenceError when calling new PaymentRequest()");
+        }
+        resolve();
+
+      });
+    }
+
+    function runTests() {
+      testInNone10s()
+      .then(SimpleTest.finish)
+      .catch( e => {
+        ok(false, "Unexpected error: " + e.name);
+        SimpleTest.finish();
+      });
+    }
+
+    window.addEventListener('load', function() {
+      SpecialPowers.pushPrefEnv({
+        'set': [
+          ['dom.payments.request.enabled', true],
+        ]
+      }, runTests);
+    });
+    </script>
+  </head>
+  <body>
+  <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1408250">Mozilla Bug 1408250</a>
+  </body>
+</html>
--- a/dom/quota/ActorsParent.cpp
+++ b/dom/quota/ActorsParent.cpp
@@ -533,17 +533,17 @@ public:
   }
 
 private:
   // Private destructor, to discourage deletion outside of Release():
   ~OriginInfo()
   {
     MOZ_COUNT_DTOR(OriginInfo);
 
-    MOZ_DIAGNOSTIC_ASSERT(!mQuotaObjects.Count());
+    MOZ_ASSERT(!mQuotaObjects.Count());
   }
 
   void
   LockedDecreaseUsage(int64_t aSize);
 
   void
   LockedUpdateAccessTime(int64_t aAccessTime)
   {
@@ -3131,20 +3131,19 @@ QuotaObject::LockedMaybeUpdateSize(int64
 
     NS_ASSERTION(mOriginInfo, "How come?!");
 
     for (DirectoryLockImpl* lock : locks) {
       MOZ_ASSERT(!lock->GetPersistenceType().IsNull());
       MOZ_ASSERT(!lock->GetGroup().IsEmpty());
       MOZ_ASSERT(lock->GetOriginScope().IsOrigin());
       MOZ_ASSERT(!lock->GetOriginScope().GetOrigin().IsEmpty());
-      MOZ_DIAGNOSTIC_ASSERT(
-             !(lock->GetOriginScope().GetOrigin() == mOriginInfo->mOrigin &&
-             lock->GetPersistenceType().Value() == groupInfo->mPersistenceType),
-             "Deleted itself!");
+      MOZ_ASSERT(!(lock->GetOriginScope().GetOrigin() == mOriginInfo->mOrigin &&
+                   lock->GetPersistenceType().Value() == groupInfo->mPersistenceType),
+                 "Deleted itself!");
 
       quotaManager->LockedRemoveQuotaForOrigin(
                                              lock->GetPersistenceType().Value(),
                                              lock->GetGroup(),
                                              lock->GetOriginScope().GetOrigin());
     }
 
     // We unlocked and relocked several times so we need to recompute all the
@@ -3477,18 +3476,18 @@ QuotaManager::CollectOriginsForEviction(
           DirectoryLockImpl* lock = aLocks[j - 1];
           if (originScope.Matches(lock->GetOriginScope())) {
             match = true;
             break;
           }
         }
 
         if (!match) {
-          MOZ_DIAGNOSTIC_ASSERT(!originInfo->mQuotaObjects.Count(),
-                                "Inactive origin shouldn't have open files!");
+          MOZ_ASSERT(!originInfo->mQuotaObjects.Count(),
+                     "Inactive origin shouldn't have open files!");
           aInactiveOriginInfos.InsertElementSorted(originInfo,
                                                    OriginInfoLRUComparator());
         }
       }
     }
   };
 
   // Split locks into separate arrays and filter out locks for persistent
--- a/dom/quota/QuotaManagerService.cpp
+++ b/dom/quota/QuotaManagerService.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/Hal.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/Unused.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundChild.h"
 #include "nsIIdleService.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIObserverService.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsXULAppAPI.h"
 #include "QuotaManager.h"
 #include "QuotaRequests.h"
 
 #define PROFILE_BEFORE_CHANGE_QM_OBSERVER_ID "profile-before-change-qm"
 
@@ -91,38 +90,16 @@ public:
   { }
 
 private:
   NS_DECL_NSIRUNNABLE
 };
 
 } // namespace
 
-class QuotaManagerService::BackgroundCreateCallback final
-  : public nsIIPCBackgroundChildCreateCallback
-{
-  RefPtr<QuotaManagerService> mService;
-
-public:
-  explicit
-  BackgroundCreateCallback(QuotaManagerService* aService)
-    : mService(aService)
-  {
-    MOZ_ASSERT(aService);
-  }
-
-  NS_DECL_ISUPPORTS
-
-private:
-  ~BackgroundCreateCallback()
-  { }
-
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
-};
-
 class QuotaManagerService::PendingRequestInfo
 {
 protected:
   RefPtr<RequestBase> mRequest;
 
 public:
   explicit PendingRequestInfo(RequestBase* aRequest)
     : mRequest(aRequest)
@@ -347,107 +324,46 @@ nsresult
 QuotaManagerService::InitiateRequest(nsAutoPtr<PendingRequestInfo>& aInfo)
 {
   // Nothing can be done here if we have previously failed to create a
   // background actor.
   if (mBackgroundActorFailed) {
     return NS_ERROR_FAILURE;
   }
 
-  if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
-    if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
-      BackgroundActorCreated(actor);
-    } else {
-      // We need to start the sequence to create a background actor for this
-      // thread.
-      RefPtr<BackgroundCreateCallback> cb = new BackgroundCreateCallback(this);
-      if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
-        return NS_ERROR_FAILURE;
-      }
+  if (!mBackgroundActor) {
+    PBackgroundChild* backgroundActor =
+      BackgroundChild::GetOrCreateForCurrentThread();
+    if (NS_WARN_IF(!backgroundActor)) {
+      mBackgroundActorFailed = true;
+      return NS_ERROR_FAILURE;
+    }
+
+    {
+      QuotaChild* actor = new QuotaChild(this);
+
+      mBackgroundActor =
+        static_cast<QuotaChild*>(backgroundActor->SendPQuotaConstructor(actor));
     }
   }
 
+  if (!mBackgroundActor) {
+    mBackgroundActorFailed = true;
+    return NS_ERROR_FAILURE;
+  }
+
   // If we already have a background actor then we can start this request now.
-  if (mBackgroundActor) {
-    nsresult rv = aInfo->InitiateRequest(mBackgroundActor);
-    if (NS_WARN_IF(NS_FAILED(rv))) {
-      return rv;
-    }
-  } else {
-    mPendingRequests.AppendElement(aInfo.forget());
+  nsresult rv = aInfo->InitiateRequest(mBackgroundActor);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    return rv;
   }
 
   return NS_OK;
 }
 
-nsresult
-QuotaManagerService::BackgroundActorCreated(PBackgroundChild* aBackgroundActor)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aBackgroundActor);
-  MOZ_ASSERT(!mBackgroundActor);
-  MOZ_ASSERT(!mBackgroundActorFailed);
-
-  {
-    QuotaChild* actor = new QuotaChild(this);
-
-    mBackgroundActor =
-      static_cast<QuotaChild*>(aBackgroundActor->SendPQuotaConstructor(actor));
-  }
-
-  if (NS_WARN_IF(!mBackgroundActor)) {
-    BackgroundActorFailed();
-    return NS_ERROR_FAILURE;
-  }
-
-  nsresult rv = NS_OK;
-
-  for (uint32_t index = 0, count = mPendingRequests.Length();
-       index < count;
-       index++) {
-    nsAutoPtr<PendingRequestInfo> info(mPendingRequests[index].forget());
-
-    nsresult rv2 = info->InitiateRequest(mBackgroundActor);
-
-    // Warn for every failure, but just return the first failure if there are
-    // multiple failures.
-    if (NS_WARN_IF(NS_FAILED(rv2)) && NS_SUCCEEDED(rv)) {
-      rv = rv2;
-    }
-  }
-
-  mPendingRequests.Clear();
-
-  return rv;
-}
-
-void
-QuotaManagerService::BackgroundActorFailed()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(!mPendingRequests.IsEmpty());
-  MOZ_ASSERT(!mBackgroundActor);
-  MOZ_ASSERT(!mBackgroundActorFailed);
-
-  mBackgroundActorFailed = true;
-
-  for (uint32_t index = 0, count = mPendingRequests.Length();
-       index < count;
-       index++) {
-    nsAutoPtr<PendingRequestInfo> info(mPendingRequests[index].forget());
-
-    RequestBase* request = info->GetRequest();
-    if (request) {
-      request->SetError(NS_ERROR_FAILURE);
-    }
-  }
-
-  mPendingRequests.Clear();
-}
-
 void
 QuotaManagerService::PerformIdleMaintenance()
 {
   using namespace mozilla::hal;
 
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -890,46 +806,16 @@ AbortOperationsRunnable::Run()
     return NS_OK;
   }
 
   quotaManager->AbortOperationsForProcess(mContentParentId);
 
   return NS_OK;
 }
 
-NS_IMPL_ISUPPORTS(QuotaManagerService::BackgroundCreateCallback,
-                  nsIIPCBackgroundChildCreateCallback)
-
-void
-QuotaManagerService::
-BackgroundCreateCallback::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aActor);
-  MOZ_ASSERT(mService);
-
-  RefPtr<QuotaManagerService> service;
-  mService.swap(service);
-
-  service->BackgroundActorCreated(aActor);
-}
-
-void
-QuotaManagerService::
-BackgroundCreateCallback::ActorFailed()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(mService);
-
-  RefPtr<QuotaManagerService> service;
-  mService.swap(service);
-
-  service->BackgroundActorFailed();
-}
-
 nsresult
 QuotaManagerService::
 UsageRequestInfo::InitiateRequest(QuotaChild* aActor)
 {
   MOZ_ASSERT(aActor);
 
   auto request = static_cast<UsageRequest*>(mRequest.get());
 
--- a/dom/quota/QuotaManagerService.h
+++ b/dom/quota/QuotaManagerService.h
@@ -44,18 +44,16 @@ class QuotaManagerService final
   class BackgroundCreateCallback;
   class PendingRequestInfo;
   class UsageRequestInfo;
   class RequestInfo;
   class IdleMaintenanceInfo;
 
   nsCOMPtr<nsIEventTarget> mBackgroundThread;
 
-  nsTArray<nsAutoPtr<PendingRequestInfo>> mPendingRequests;
-
   QuotaChild* mBackgroundActor;
 
   bool mBackgroundActorFailed;
   bool mIdleObserverRegistered;
 
 public:
   // Returns a non-owning reference.
   static QuotaManagerService*
deleted file mode 100644
--- a/dom/svg/crashtests/880544-1.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <script>//<![CDATA[
-
-function add_watch()
-{
-  document.getElementById("p").transform.baseVal.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
-  //]]></script>
-
-  <path id="p" transform="scale(1)" />
-
-</svg>
deleted file mode 100644
--- a/dom/svg/crashtests/880544-2.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <script>//<![CDATA[
-
-function add_watch()
-{
-  document.getElementById("e").x.baseVal.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
-  //]]></script>
-
-  <text id="e" x="10">foo</text>
-
-</svg>
deleted file mode 100644
--- a/dom/svg/crashtests/880544-3.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <script>//<![CDATA[
-
-function add_watch()
-{
-  document.getElementById("e").rotate.baseVal.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
-  //]]></script>
-
-  <text id="e" rotate="10">foo</text>
-
-</svg>
deleted file mode 100644
--- a/dom/svg/crashtests/880544-4.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <script>//<![CDATA[
-
-function add_watch()
-{
-  document.getElementById("e").pathSegList.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
-  //]]></script>
-
-  <path id="e" d="M0,0"/>
-
-</svg>
deleted file mode 100644
--- a/dom/svg/crashtests/880544-5.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-<svg xmlns="http://www.w3.org/2000/svg">
-  <script>//<![CDATA[
-
-function add_watch()
-{
-  document.getElementById("e").points.watch("0", function(){});
-}
-
-window.addEventListener("load", add_watch, false);
-
-  //]]></script>
-
-  <polygon id="e" points="0,0"/>
-
-</svg>
--- a/dom/svg/crashtests/crashtests.list
+++ b/dom/svg/crashtests/crashtests.list
@@ -61,21 +61,16 @@ load 719779-1.svg
 load 723441-1.html
 load 751515-1.svg
 load 761507-1.svg
 load 831561.html
 load 837450-1.svg
 load 842463-1.html
 load 847138-1.svg
 load 864509.svg
-load 880544-1.svg
-load 880544-2.svg
-load 880544-3.svg
-load 880544-4.svg
-load 880544-5.svg
 load 898915-1.svg
 load 1035248-1.svg
 load 1035248-2.svg
 load 1244898-1.xhtml
 load 1250725.html
 load 1267272-1.svg
 load 1282985-1.svg
 # Disabled for now due to it taking a very long time to run - bug 1259356
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/iframe_bug38959-1.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
-<head>
-	<title>Iframe test for bug 38959</title>
-</head>
-<body">
-<script>
-
-x = false;
-window.opener.postMessage(1, "http://mochi.test:8888");
-window.close();
-
-</script>
-</body>
-</html>
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/iframe_bug38959-2.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
-<head>
-	<title>Iframe test for bug 38959</title>
-</head>
-<body">
-<script>
-
-x = true;
-window.opener.postMessage(2, "http://mochi.test:8888");
-window.close();
-
-</script>
-</body>
-</html>
--- a/dom/tests/mochitest/bugs/mochitest.ini
+++ b/dom/tests/mochitest/bugs/mochitest.ini
@@ -16,18 +16,16 @@ support-files =
   file_bug809290_b1.html
   file_bug809290_b2.html
   file_bug809290_c.html
   file_empty.html
   file_window_bar.html
   grandchild_bug260264.html
   iframe_bug304459-1.html
   iframe_bug304459-2.html
-  iframe_bug38959-1.html
-  iframe_bug38959-2.html
   iframe_bug430276-2.html
   iframe_bug430276.html
   iframe_bug440572.html
   iframe_bug49312.html
   iframe_domparser_after_blank.html
   utils_bug260264.js
   utils_bug743615.js
   worker_bug743615.js
@@ -61,17 +59,16 @@ skip-if = toolkit == 'android'
 [test_bug346659.html]
 [test_bug351601.html]
 [test_bug369306.html]
 skip-if = toolkit == 'android' #TIMED_OUT
 [test_bug370098.html]
 [test_bug377539.html]
 [test_bug384122.html]
 [test_bug389366.html]
-[test_bug38959.html]
 [test_bug393974.html]
 [test_bug394769.html]
 [test_bug396843.html]
 [test_bug400204.html]
 [test_bug404748.html]
 [test_bug414291.html]
 tags = openwindow
 [test_bug427744.html]
deleted file mode 100644
--- a/dom/tests/mochitest/bugs/test_bug38959.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=38959
--->
-<head>
-  <title>Test for Bug 38959</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=38959">Mozilla Bug 38959</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-  <iframe id="frame"></iframe>
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 38959 **/
-
-var newValue;
-
-function watcher(id, ol, ne)
-{
-  newValue = ne;
-  return ne;
-}
-
-function openWindow(url, crossOrigin)
-{
-  newValue = true;
-  var w = window.open(url);
-  w.watch("x", watcher);
-}
-
-function receiveMessage(evt)
-{
-  ok(newValue, "Watchpoints only allowed same-origin.");
-  if (evt.data == 1) {
-    openWindow("/tests/dom/tests/mochitest/bugs/iframe_bug38959-2.html");
-  }
-  else {
-    SimpleTest.finish();
-  }
-}
-
-SimpleTest.waitForExplicitFinish();
-
-window.addEventListener("message", receiveMessage);
-
-openWindow("http://example.org/tests/dom/tests/mochitest/bugs/iframe_bug38959-1.html");
-
-</script>
-</pre>
-</body>
-</html>
--- a/dom/u2f/U2FManager.cpp
+++ b/dom/u2f/U2FManager.cpp
@@ -28,18 +28,17 @@ namespace dom {
 
 namespace {
 StaticRefPtr<U2FManager> gU2FManager;
 static mozilla::LazyLogModule gU2FManagerLog("u2fmanager");
 }
 
 NS_NAMED_LITERAL_STRING(kVisibilityChange, "visibilitychange");
 
-NS_IMPL_ISUPPORTS(U2FManager, nsIIPCBackgroundChildCreateCallback,
-                  nsIDOMEventListener);
+NS_IMPL_ISUPPORTS(U2FManager, nsIDOMEventListener);
 
 /***********************************************************************
  * Utility Functions
  **********************************************************************/
 
 static void
 ListenForVisibilityEvents(nsPIDOMWindowInner* aParent,
                           U2FManager* aListener)
@@ -138,35 +137,40 @@ U2FManager::~U2FManager()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (mTransaction.isSome()) {
     RejectTransaction(NS_ERROR_ABORT);
   }
 }
 
-RefPtr<U2FManager::BackgroundActorPromise>
+void
 U2FManager::GetOrCreateBackgroundActor()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  PBackgroundChild *actor = BackgroundChild::GetForCurrentThread();
-  RefPtr<U2FManager::BackgroundActorPromise> promise =
-    mPBackgroundCreationPromise.Ensure(__func__);
+  if (mChild) {
+    return;
+  }
 
-  if (actor) {
-    ActorCreated(actor);
-  } else {
-    bool ok = BackgroundChild::GetOrCreateForCurrentThread(this);
-    if (NS_WARN_IF(!ok)) {
-      ActorFailed();
-    }
+  PBackgroundChild* actorChild = BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actorChild)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
   }
 
-  return promise;
+  RefPtr<U2FTransactionChild> mgr(new U2FTransactionChild());
+  PWebAuthnTransactionChild* constructedMgr =
+    actorChild->SendPWebAuthnTransactionConstructor(mgr);
+
+  if (NS_WARN_IF(!constructedMgr)) {
+    return;
+  }
+
+  MOZ_ASSERT(constructedMgr == mgr);
+  mChild = mgr.forget();
 }
 
 //static
 U2FManager*
 U2FManager::GetOrCreate()
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (gU2FManager) {
@@ -254,42 +258,37 @@ U2FManager::Register(nsPIDOMWindowInner*
   }
 
   CryptoBuffer rpIdHash, clientDataHash;
   if (NS_FAILED(BuildTransactionHashes(aRpId, aClientDataJSON,
                                        rpIdHash, clientDataHash))) {
     return U2FPromise::CreateAndReject(ErrorCode::OTHER_ERROR, __func__).forget();
   }
 
-  RefPtr<MozPromise<nsresult, nsresult, false>> p = GetOrCreateBackgroundActor();
-  p->Then(GetMainThreadSerialEventTarget(), __func__,
-          []() {
-            U2FManager* mgr = U2FManager::Get();
-            if (mgr && mgr->mChild && mgr->mTransaction.isSome()) {
-              mgr->mChild->SendRequestRegister(mgr->mTransaction.ref().mInfo);
-            }
-          },
-          []() {
-            // This case can't actually happen, we'll have crashed if the child
-            // failed to create.
-          });
-
   ListenForVisibilityEvents(aParent, this);
 
   // Always blank for U2F
   nsTArray<WebAuthnExtension> extensions;
 
   WebAuthnTransactionInfo info(rpIdHash,
                                clientDataHash,
                                aTimeoutMillis,
                                aExcludeList,
                                extensions);
 
   MOZ_ASSERT(mTransaction.isNothing());
+
   mTransaction = Some(U2FTransaction(aParent, Move(info), aClientDataJSON));
+
+  GetOrCreateBackgroundActor();
+
+  if (mChild) {
+    mChild->SendRequestRegister(mTransaction.ref().mInfo);
+  }
+
   return mTransaction.ref().mPromise.Ensure(__func__);
 }
 
 already_AddRefed<U2FPromise>
 U2FManager::Sign(nsPIDOMWindowInner* aParent,
                  const nsCString& aRpId,
                  const nsCString& aClientDataJSON,
                  const uint32_t& aTimeoutMillis,
@@ -303,42 +302,36 @@ U2FManager::Sign(nsPIDOMWindowInner* aPa
   }
 
   CryptoBuffer rpIdHash, clientDataHash;
   if (NS_FAILED(BuildTransactionHashes(aRpId, aClientDataJSON,
                                        rpIdHash, clientDataHash))) {
     return U2FPromise::CreateAndReject(ErrorCode::OTHER_ERROR, __func__).forget();
   }
 
-  RefPtr<MozPromise<nsresult, nsresult, false>> p = GetOrCreateBackgroundActor();
-  p->Then(GetMainThreadSerialEventTarget(), __func__,
-          []() {
-            U2FManager* mgr = U2FManager::Get();
-            if (mgr && mgr->mChild && mgr->mTransaction.isSome()) {
-              mgr->mChild->SendRequestSign(mgr->mTransaction.ref().mInfo);
-            }
-          },
-          []() {
-            // This case can't actually happen, we'll have crashed if the child
-            // failed to create.
-          });
-
   ListenForVisibilityEvents(aParent, this);
 
   // Always blank for U2F
   nsTArray<WebAuthnExtension> extensions;
 
   WebAuthnTransactionInfo info(rpIdHash,
                                clientDataHash,
                                aTimeoutMillis,
                                aAllowList,
                                extensions);
 
   MOZ_ASSERT(mTransaction.isNothing());
   mTransaction = Some(U2FTransaction(aParent, Move(info), aClientDataJSON));
+
+  GetOrCreateBackgroundActor();
+
+  if (mChild) {
+    mChild->SendRequestSign(mTransaction.ref().mInfo);
+  }
+
   return mTransaction.ref().mPromise.Ensure(__func__);
 }
 
 void
 U2FManager::FinishRegister(nsTArray<uint8_t>& aRegBuffer)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -479,44 +472,15 @@ U2FManager::HandleEvent(nsIDOMEvent* aEv
 
     CancelTransaction(NS_ERROR_ABORT);
   }
 
   return NS_OK;
 }
 
 void
-U2FManager::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aActor);
-
-  if (mChild) {
-    return;
-  }
-
-  RefPtr<U2FTransactionChild> mgr(new U2FTransactionChild());
-  PWebAuthnTransactionChild* constructedMgr =
-    aActor->SendPWebAuthnTransactionConstructor(mgr);
-
-  if (NS_WARN_IF(!constructedMgr)) {
-    ActorFailed();
-    return;
-  }
-  MOZ_ASSERT(constructedMgr == mgr);
-  mChild = mgr.forget();
-  mPBackgroundCreationPromise.Resolve(NS_OK, __func__);
-}
-
-void
 U2FManager::ActorDestroyed()
 {
   mChild = nullptr;
 }
 
-void
-U2FManager::ActorFailed()
-{
-  MOZ_CRASH("We shouldn't be here!");
-}
-
 } // namespace dom
 } // namespace mozilla
--- a/dom/u2f/U2FManager.h
+++ b/dom/u2f/U2FManager.h
@@ -7,17 +7,16 @@
 #ifndef mozilla_dom_U2FManager_h
 #define mozilla_dom_U2FManager_h
 
 #include "U2FAuthenticator.h"
 #include "mozilla/MozPromise.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/PWebAuthnTransaction.h"
 #include "nsIDOMEventListener.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 
 /*
  * Content process manager for the U2F protocol. Created on calls to the
  * U2F DOM object, this manager handles establishing IPC channels
  * for U2F transactions, as well as keeping track of MozPromise objects
  * representing transactions in flight.
  *
  * The U2F spec (http://fidoalliance.org/specs/fido-u2f-v1.1-id-20160915.zip)
@@ -73,23 +72,21 @@ public:
   // Holds the parameters of the current transaction, as we need them both
   // before the transaction request is sent, and on successful return.
   WebAuthnTransactionInfo mInfo;
 
   // Client data used to assemble reply objects.
   nsCString mClientData;
 };
 
-class U2FManager final : public nsIIPCBackgroundChildCreateCallback
-                       , public nsIDOMEventListener
+class U2FManager final : public nsIDOMEventListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
 
   static U2FManager* GetOrCreate();
   static U2FManager* Get();
 
   already_AddRefed<U2FPromise> Register(nsPIDOMWindowInner* aParent,
               const nsCString& aRpId,
               const nsCString& aClientDataJSON,
               const uint32_t& aTimeoutMillis,
@@ -129,24 +126,21 @@ private:
   // Rejects the current transaction and calls ClearTransaction().
   void RejectTransaction(const nsresult& aError);
   // Cancels the current transaction (by sending a Cancel message to the
   // parent) and rejects it by calling RejectTransaction().
   void CancelTransaction(const nsresult& aError);
 
   typedef MozPromise<nsresult, nsresult, false> BackgroundActorPromise;
 
-  RefPtr<BackgroundActorPromise> GetOrCreateBackgroundActor();
+  void GetOrCreateBackgroundActor();
 
   // IPC Channel for the current transaction.
   RefPtr<U2FTransactionChild> mChild;
 
   // The current transaction, if any.
   Maybe<U2FTransaction> mTransaction;
-
-  // Promise for dealing with PBackground Actor creation.
-  MozPromiseHolder<BackgroundActorPromise> mPBackgroundCreationPromise;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_U2FManager_h
--- a/dom/webauthn/WebAuthnManager.cpp
+++ b/dom/webauthn/WebAuthnManager.cpp
@@ -41,18 +41,17 @@ const uint8_t FLAG_UV = 0x04; // User wa
 
 namespace {
 StaticRefPtr<WebAuthnManager> gWebAuthnManager;
 static mozilla::LazyLogModule gWebAuthnManagerLog("webauthnmanager");
 }
 
 NS_NAMED_LITERAL_STRING(kVisibilityChange, "visibilitychange");
 
-NS_IMPL_ISUPPORTS(WebAuthnManager, nsIIPCBackgroundChildCreateCallback,
-                  nsIDOMEventListener);
+NS_IMPL_ISUPPORTS(WebAuthnManager, nsIDOMEventListener);
 
 /***********************************************************************
  * Utility Functions
  **********************************************************************/
 
 static nsresult
 AssembleClientData(const nsAString& aOrigin, const CryptoBuffer& aChallenge,
                    /* out */ nsACString& aJsonOut)
@@ -232,35 +231,41 @@ WebAuthnManager::~WebAuthnManager()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (mTransaction.isSome()) {
     RejectTransaction(NS_ERROR_ABORT);
   }
 }
 
-RefPtr<WebAuthnManager::BackgroundActorPromise>
+void
 WebAuthnManager::GetOrCreateBackgroundActor()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
-  PBackgroundChild *actor = BackgroundChild::GetForCurrentThread();
-  RefPtr<WebAuthnManager::BackgroundActorPromise> promise =
-    mPBackgroundCreationPromise.Ensure(__func__);
+  if (mChild) {
+    return;
+  }
 
-  if (actor) {
-    ActorCreated(actor);
-  } else {
-    bool ok = BackgroundChild::GetOrCreateForCurrentThread(this);
-    if (NS_WARN_IF(!ok)) {
-      ActorFailed();
-    }
+  PBackgroundChild* actor = BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actor)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
   }
 
-  return promise;
+  RefPtr<WebAuthnTransactionChild> mgr(new WebAuthnTransactionChild());
+  PWebAuthnTransactionChild* constructedMgr =
+    actor->SendPWebAuthnTransactionConstructor(mgr);
+
+  if (NS_WARN_IF(!constructedMgr)) {
+    MOZ_CRASH("Failed to create a PBackgroundChild actor!");
+    return;
+  }
+
+  MOZ_ASSERT(constructedMgr == mgr);
+  mChild = mgr.forget();
 }
 
 //static
 WebAuthnManager*
 WebAuthnManager::GetOrCreate()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -456,37 +461,30 @@ WebAuthnManager::MakeCredential(nsPIDOMW
   // TODO: Add extension list building
   nsTArray<WebAuthnExtension> extensions;
 
   WebAuthnTransactionInfo info(rpIdHash,
                                clientDataHash,
                                adjustedTimeout,
                                excludeList,
                                extensions);
-  RefPtr<MozPromise<nsresult, nsresult, false>> p = GetOrCreateBackgroundActor();
-  p->Then(GetMainThreadSerialEventTarget(), __func__,
-          []() {
-            WebAuthnManager* mgr = WebAuthnManager::Get();
-            if (mgr && mgr->mChild && mgr->mTransaction.isSome()) {
-              mgr->mChild->SendRequestRegister(mgr->mTransaction.ref().mInfo);
-            }
-          },
-          []() {
-            // This case can't actually happen, we'll have crashed if the child
-            // failed to create.
-          });
 
   ListenForVisibilityEvents(aParent, this);
 
   MOZ_ASSERT(mTransaction.isNothing());
   mTransaction = Some(WebAuthnTransaction(aParent,
                                           promise,
                                           Move(info),
                                           Move(clientDataJSON)));
 
+  GetOrCreateBackgroundActor();
+  if (mChild) {
+    mChild->SendRequestRegister(mTransaction.ref().mInfo);
+  }
+
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 WebAuthnManager::GetAssertion(nsPIDOMWindowInner* aParent,
                               const PublicKeyCredentialRequestOptions& aOptions)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -611,37 +609,30 @@ WebAuthnManager::GetAssertion(nsPIDOMWin
   // result of this processing clientExtensions.
   nsTArray<WebAuthnExtension> extensions;
 
   WebAuthnTransactionInfo info(rpIdHash,
                                clientDataHash,
                                adjustedTimeout,
                                allowList,
                                extensions);
-  RefPtr<MozPromise<nsresult, nsresult, false>> p = GetOrCreateBackgroundActor();
-  p->Then(GetMainThreadSerialEventTarget(), __func__,
-          []() {
-            WebAuthnManager* mgr = WebAuthnManager::Get();
-            if (mgr && mgr->mChild && mgr->mTransaction.isSome()) {
-              mgr->mChild->SendRequestSign(mgr->mTransaction.ref().mInfo);
-            }
-          },
-          []() {
-            // This case can't actually happen, we'll have crashed if the child
-            // failed to create.
-          });
 
   ListenForVisibilityEvents(aParent, this);
 
   MOZ_ASSERT(mTransaction.isNothing());
   mTransaction = Some(WebAuthnTransaction(aParent,
                                           promise,
                                           Move(info),
                                           Move(clientDataJSON)));
 
+  GetOrCreateBackgroundActor();
+  if (mChild) {
+    mChild->SendRequestSign(mTransaction.ref().mInfo);
+  }
+
   return promise.forget();
 }
 
 already_AddRefed<Promise>
 WebAuthnManager::Store(nsPIDOMWindowInner* aParent,
                        const Credential& aCredential)
 {
   MOZ_ASSERT(NS_IsMainThread());
@@ -907,46 +898,16 @@ WebAuthnManager::HandleEvent(nsIDOMEvent
 
     CancelTransaction(NS_ERROR_ABORT);
   }
 
   return NS_OK;
 }
 
 void
-WebAuthnManager::ActorCreated(PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(aActor);
-
-  if (mChild) {
-    return;
-  }
-
-  RefPtr<WebAuthnTransactionChild> mgr(new WebAuthnTransactionChild());
-  PWebAuthnTransactionChild* constructedMgr =
-    aActor->SendPWebAuthnTransactionConstructor(mgr);
-
-  if (NS_WARN_IF(!constructedMgr)) {
-    ActorFailed();
-    return;
-  }
-  MOZ_ASSERT(constructedMgr == mgr);
-  mChild = mgr.forget();
-  mPBackgroundCreationPromise.Resolve(NS_OK, __func__);
-}
-
-void
 WebAuthnManager::ActorDestroyed()
 {
   MOZ_ASSERT(NS_IsMainThread());
   mChild = nullptr;
 }
 
-void
-WebAuthnManager::ActorFailed()
-{
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_CRASH("We shouldn't be here!");
-}
-
 }
 }
--- a/dom/webauthn/WebAuthnManager.h
+++ b/dom/webauthn/WebAuthnManager.h
@@ -6,17 +6,16 @@
 
 #ifndef mozilla_dom_WebAuthnManager_h
 #define mozilla_dom_WebAuthnManager_h
 
 #include "mozilla/MozPromise.h"
 #include "mozilla/dom/Event.h"
 #include "mozilla/dom/PWebAuthnTransaction.h"
 #include "nsIDOMEventListener.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 
 /*
  * Content process manager for the WebAuthn protocol. Created on calls to the
  * WebAuthentication DOM object, this manager handles establishing IPC channels
  * for WebAuthn transactions, as well as keeping track of JS Promise objects
  * representing transactions in flight.
  *
  * The WebAuthn spec (https://www.w3.org/TR/webauthn/) allows for two different
@@ -83,23 +82,21 @@ public:
   // Holds the parameters of the current transaction, as we need them both
   // before the transaction request is sent, and on successful return.
   WebAuthnTransactionInfo mInfo;
 
   // Client data used to assemble reply objects.
   nsCString mClientData;
 };
 
-class WebAuthnManager final : public nsIIPCBackgroundChildCreateCallback,
-                              public nsIDOMEventListener
+class WebAuthnManager final : public nsIDOMEventListener
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIDOMEVENTLISTENER
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
 
   static WebAuthnManager* GetOrCreate();
   static WebAuthnManager* Get();
 
   already_AddRefed<Promise>
   MakeCredential(nsPIDOMWindowInner* aParent,
                  const MakePublicKeyCredentialOptions& aOptions);
 
@@ -131,24 +128,21 @@ private:
   // Rejects the current transaction and calls ClearTransaction().
   void RejectTransaction(const nsresult& aError);
   // Cancels the current transaction (by sending a Cancel message to the
   // parent) and rejects it by calling RejectTransaction().
   void CancelTransaction(const nsresult& aError);
 
   typedef MozPromise<nsresult, nsresult, false> BackgroundActorPromise;
 
-  RefPtr<BackgroundActorPromise> GetOrCreateBackgroundActor();
+  void GetOrCreateBackgroundActor();
 
   // IPC Channel for the current transaction.
   RefPtr<WebAuthnTransactionChild> mChild;
 
   // The current transaction, if any.
   Maybe<WebAuthnTransaction> mTransaction;
-
-  // Promise for dealing with PBackground Actor creation.
-  MozPromiseHolder<BackgroundActorPromise> mPBackgroundCreationPromise;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_WebAuthnManager_h
--- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp
+++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ -2317,18 +2317,19 @@ nsWebBrowserPersist::MakeOutputStreamFro
 
     // XXX brade:  get the right flags here!
     int32_t ioFlags = -1;
     if (mPersistFlags & nsIWebBrowserPersist::PERSIST_FLAGS_APPEND_TO_FILE)
       ioFlags = PR_APPEND | PR_CREATE_FILE | PR_WRONLY;
     rv = fileOutputStream->Init(aFile, ioFlags, -1, 0);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    *aOutputStream = NS_BufferOutputStream(fileOutputStream,
-                                           BUFFERED_OUTPUT_SIZE).take();
+    rv = NS_NewBufferedOutputStream(aOutputStream, fileOutputStream.forget(),
+                                    BUFFERED_OUTPUT_SIZE);
+    NS_ENSURE_SUCCESS(rv, rv);
 
     if (mPersistFlags & PERSIST_FLAGS_CLEANUP_ON_FAILURE)
     {
         // Add to cleanup list in event of failure
         auto *cleanupData = new CleanupData;
         if (!cleanupData) {
           NS_RELEASE(*aOutputStream);
           return NS_ERROR_OUT_OF_MEMORY;
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -49,17 +49,16 @@
 #include "mozilla/dom/IndexedDatabaseManager.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/dom/Navigator.h"
 #include "nsContentUtils.h"
 #include "nsCycleCollector.h"
 #include "nsDOMJSUtils.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsISupportsImpl.h"
 #include "nsLayoutStatics.h"
 #include "nsNetUtil.h"
 #include "nsServiceManagerUtils.h"
 #include "nsThreadUtils.h"
 #include "nsXPCOM.h"
 #include "nsXPCOMPrivate.h"
 #include "OSFileConstants.h"
@@ -1302,50 +1301,16 @@ PlatformOverrideChanged(const char* /* a
   Preferences::GetString("general.platform.override", override);
 
   RuntimeService* runtime = RuntimeService::GetService();
   if (runtime) {
     runtime->UpdatePlatformOverridePreference(override);
   }
 }
 
-class BackgroundChildCallback final
-  : public nsIIPCBackgroundChildCreateCallback
-{
-public:
-  BackgroundChildCallback()
-  {
-    AssertIsOnMainThread();
-  }
-
-  NS_DECL_ISUPPORTS
-
-private:
-  ~BackgroundChildCallback()
-  {
-    AssertIsOnMainThread();
-  }
-
-  virtual void
-  ActorCreated(PBackgroundChild* aActor) override
-  {
-    AssertIsOnMainThread();
-    MOZ_ASSERT(aActor);
-  }
-
-  virtual void
-  ActorFailed() override
-  {
-    AssertIsOnMainThread();
-    MOZ_CRASH("Unable to connect PBackground actor for the main thread!");
-  }
-};
-
-NS_IMPL_ISUPPORTS(BackgroundChildCallback, nsIIPCBackgroundChildCreateCallback)
-
 } /* anonymous namespace */
 
 BEGIN_WORKERS_NAMESPACE
 
 void
 CancelWorkersForWindow(nsPIDOMWindowInner* aWindow)
 {
   AssertIsOnMainThread();
@@ -1948,25 +1913,16 @@ RuntimeService::ShutdownIdleThreads(nsIT
 
 nsresult
 RuntimeService::Init()
 {
   AssertIsOnMainThread();
 
   nsLayoutStatics::AddRef();
 
-  // Make sure PBackground actors are connected as soon as possible for the main
-  // thread in case workers clone remote blobs here.
-  if (!BackgroundChild::GetForCurrentThread()) {
-    RefPtr<BackgroundChildCallback> callback = new BackgroundChildCallback();
-    if (!BackgroundChild::GetOrCreateForCurrentThread(callback)) {
-      MOZ_CRASH("Unable to connect PBackground actor for the main thread!");
-    }
-  }
-
   // Initialize JSSettings.
   if (sDefaultJSSettings.gcSettings[0].key.isNothing()) {
     sDefaultJSSettings.contextOptions = JS::ContextOptions();
     sDefaultJSSettings.chrome.maxScriptRuntime = -1;
     sDefaultJSSettings.chrome.compartmentOptions.behaviors().setVersion(JSVERSION_DEFAULT);
     sDefaultJSSettings.content.maxScriptRuntime = MAX_SCRIPT_RUN_TIME_SEC;
 #ifdef JS_GC_ZEAL
     sDefaultJSSettings.gcZealFrequency = JS_DEFAULT_ZEAL_FREQ;
--- a/dom/workers/ServiceWorkerJob.cpp
+++ b/dom/workers/ServiceWorkerJob.cpp
@@ -101,21 +101,16 @@ ServiceWorkerJob::Start(Callback* aFinal
   // We may have to wait for the PBackground actor to be initialized
   // before proceeding.  We should always be able to get a ServiceWorkerManager,
   // however, since Start() should not be called during shutdown.
   RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
   if (!swm) {
     // browser shutdown
     return;
   }
-  if (!swm->HasBackgroundActor()) {
-    // waiting to initialize
-    swm->AppendPendingOperation(runnable);
-    return;
-  }
 
   // Otherwise start asynchronously.  We should never run a job synchronously.
   MOZ_ALWAYS_TRUE(NS_SUCCEEDED(
     NS_DispatchToMainThread(runnable.forget())));
 }
 
 void
 ServiceWorkerJob::Cancel()
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -245,17 +245,16 @@ private:
 // ServiceWorkerManager //
 //////////////////////////
 
 NS_IMPL_ADDREF(ServiceWorkerManager)
 NS_IMPL_RELEASE(ServiceWorkerManager)
 
 NS_INTERFACE_MAP_BEGIN(ServiceWorkerManager)
   NS_INTERFACE_MAP_ENTRY(nsIServiceWorkerManager)
-  NS_INTERFACE_MAP_ENTRY(nsIIPCBackgroundChildCreateCallback)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIServiceWorkerManager)
 NS_INTERFACE_MAP_END
 
 ServiceWorkerManager::ServiceWorkerManager()
   : mActor(nullptr)
   , mShuttingDown(false)
 {
@@ -291,21 +290,30 @@ ServiceWorkerManager::Init(ServiceWorker
       MOZ_ASSERT(NS_SUCCEEDED(rv));
       rv = obs->AddObserver(this, PURGE_DOMAIN_DATA, false /* ownsWeak */);
       MOZ_ASSERT(NS_SUCCEEDED(rv));
       rv = obs->AddObserver(this, CLEAR_ORIGIN_DATA, false /* ownsWeak */);
       MOZ_ASSERT(NS_SUCCEEDED(rv));
     }
   }
 
-  if (!BackgroundChild::GetOrCreateForCurrentThread(this)) {
-    // Make sure to do this last as our failure cleanup expects Init() to have
-    // executed.
-    ActorFailed();
-  }
+  PBackgroundChild* actorChild = BackgroundChild::GetOrCreateForCurrentThread();
+  if (NS_WARN_IF(!actorChild)) {
+    MaybeStartShutdown();
+    return;
+  }
+
+  PServiceWorkerManagerChild* actor =
+    actorChild->SendPServiceWorkerManagerConstructor();
+  if (!actor) {
+    MaybeStartShutdown();
+    return;
+  }
+
+  mActor = static_cast<ServiceWorkerManagerChild*>(actor);
 }
 
 void
 ServiceWorkerManager::MaybeStartShutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   if (mShuttingDown) {
@@ -334,18 +342,16 @@ ServiceWorkerManager::MaybeStartShutdown
 
     if (XRE_IsParentProcess()) {
       obs->RemoveObserver(this, PURGE_SESSION_HISTORY);
       obs->RemoveObserver(this, PURGE_DOMAIN_DATA);
       obs->RemoveObserver(this, CLEAR_ORIGIN_DATA);
     }
   }
 
-  mPendingOperations.Clear();
-
   if (!mActor) {
     return;
   }
 
   mActor->ManagerShuttingDown();
 
   RefPtr<TeardownRunnable> runnable = new TeardownRunnable(mActor);
   nsresult rv = NS_DispatchToMainThread(runnable);
@@ -421,130 +427,16 @@ public:
 private:
   ~PropagateSoftUpdateRunnable()
   {}
 
   const OriginAttributes mOriginAttributes;
   const nsString mScope;
 };
 
-class PropagateUnregisterRunnable final : public Runnable
-{
-public:
-  PropagateUnregisterRunnable(nsIPrincipal* aPrincipal,
-                              nsIServiceWorkerUnregisterCallback* aCallback,
-                              const nsAString& aScope)
-    : Runnable("dom::workers::PropagateUnregisterRunnable")
-    , mPrincipal(aPrincipal)
-    , mCallback(aCallback)
-    , mScope(aScope)
-  {
-    MOZ_ASSERT(aPrincipal);
-  }
-
-  NS_IMETHOD Run() override
-  {
-    AssertIsOnMainThread();
-
-    RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
-    if (swm) {
-      swm->PropagateUnregister(mPrincipal, mCallback, mScope);
-    }
-
-    return NS_OK;
-  }
-
-private:
-  ~PropagateUnregisterRunnable()
-  {}
-
-  nsCOMPtr<nsIPrincipal> mPrincipal;
-  nsCOMPtr<nsIServiceWorkerUnregisterCallback> mCallback;
-  const nsString mScope;
-};
-
-class RemoveRunnable final : public Runnable
-{
-public:
-  explicit RemoveRunnable(const nsACString& aHost)
-    : Runnable("dom::workers::RemoveRunnable")
-  {
-  }
-
-  NS_IMETHOD Run() override
-  {
-    AssertIsOnMainThread();
-
-    RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
-    if (swm) {
-      swm->Remove(mHost);
-    }
-
-    return NS_OK;
-  }
-
-private:
-  ~RemoveRunnable()
-  {}
-
-  const nsCString mHost;
-};
-
-class PropagateRemoveRunnable final : public Runnable
-{
-public:
-  explicit PropagateRemoveRunnable(const nsACString& aHost)
-    : Runnable("dom::workers::PropagateRemoveRunnable")
-  {
-  }
-
-  NS_IMETHOD Run() override
-  {
-    AssertIsOnMainThread();
-
-    RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
-    if (swm) {
-      swm->PropagateRemove(mHost);
-    }
-
-    return NS_OK;
-  }
-
-private:
-  ~PropagateRemoveRunnable()
-  {}
-
-  const nsCString mHost;
-};
-
-class PropagateRemoveAllRunnable final : public Runnable
-{
-public:
-  PropagateRemoveAllRunnable()
-    : Runnable("dom::workers::PropagateRemoveAllRunnable")
-  {
-  }
-
-  NS_IMETHOD Run() override
-  {
-    AssertIsOnMainThread();
-
-    RefPtr<ServiceWorkerManager> swm = ServiceWorkerManager::GetInstance();
-    if (swm) {
-      swm->PropagateRemoveAll();
-    }
-
-    return NS_OK;
-  }
-
-private:
-  ~PropagateRemoveAllRunnable()
-  {}
-};
-
 class PromiseResolverCallback final : public ServiceWorkerUpdateFinishCallback
 {
 public:
   PromiseResolverCallback(ServiceWorkerUpdateFinishCallback* aCallback,
                           GenericPromise::Private* aPromise)
     : mCallback(aCallback)
     , mPromise(aPromise)
   {
@@ -959,27 +851,16 @@ ServiceWorkerManager::Register(mozIDOMWi
 
   AssertIsOnMainThread();
   Telemetry::Accumulate(Telemetry::SERVICE_WORKER_REGISTRATIONS, 1);
 
   promise.forget(aPromise);
   return NS_OK;
 }
 
-void
-ServiceWorkerManager::AppendPendingOperation(nsIRunnable* aRunnable)
-{
-  MOZ_ASSERT(!mActor);
-  MOZ_ASSERT(aRunnable);
-
-  if (!mShuttingDown) {
-    mPendingOperations.AppendElement(aRunnable);
-  }
-}
-
 /*
  * Implements the async aspects of the getRegistrations algorithm.
  */
 class GetRegistrationsRunnable final : public Runnable
 {
   nsCOMPtr<nsPIDOMWindowInner> mWindow;
   RefPtr<Promise> mPromise;
 public:
@@ -2105,71 +1986,27 @@ ServiceWorkerManager::LoadRegistrations(
   AssertIsOnMainThread();
 
   for (uint32_t i = 0, len = aRegistrations.Length(); i < len; ++i) {
     LoadRegistration(aRegistrations[i]);
   }
 }
 
 void
-ServiceWorkerManager::ActorFailed()
-{
-  MOZ_DIAGNOSTIC_ASSERT(!mActor);
-  MaybeStartShutdown();
-}
-
-void
-ServiceWorkerManager::ActorCreated(mozilla::ipc::PBackgroundChild* aActor)
-{
-  MOZ_ASSERT(aActor);
-  MOZ_ASSERT(!mActor);
-
-  if (mShuttingDown) {
-    MOZ_DIAGNOSTIC_ASSERT(mPendingOperations.IsEmpty());
-    return;
-  }
-
-  PServiceWorkerManagerChild* actor =
-    aActor->SendPServiceWorkerManagerConstructor();
-  if (!actor) {
-    ActorFailed();
-    return;
-  }
-
-  mActor = static_cast<ServiceWorkerManagerChild*>(actor);
-
-  // Flush the pending requests.
-  for (uint32_t i = 0, len = mPendingOperations.Length(); i < len; ++i) {
-    MOZ_ASSERT(mPendingOperations[i]);
-    nsresult rv = NS_DispatchToCurrentThread(mPendingOperations[i].forget());
-    if (NS_FAILED(rv)) {
-      NS_WARNING("Failed to dispatch a runnable.");
-    }
-  }
-
-  mPendingOperations.Clear();
-}
-
-void
 ServiceWorkerManager::StoreRegistration(
                                    nsIPrincipal* aPrincipal,
                                    ServiceWorkerRegistrationInfo* aRegistration)
 {
   MOZ_ASSERT(aPrincipal);
   MOZ_ASSERT(aRegistration);
 
   if (mShuttingDown) {
     return;
   }
 
-  MOZ_DIAGNOSTIC_ASSERT(mActor);
-  if (!mActor) {
-    return;
-  }
-
   ServiceWorkerRegistrationData data;
   nsresult rv = PopulateRegistrationData(aPrincipal, aRegistration, data);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return;
   }
 
   PrincipalInfo principalInfo;
   if (NS_WARN_IF(NS_FAILED(PrincipalToPrincipalInfo(aPrincipal,
@@ -3033,23 +2870,16 @@ ServiceWorkerManager::SoftUpdate(const O
                                  const nsACString& aScope)
 {
   AssertIsOnMainThread();
 
   if (mShuttingDown) {
     return;
   }
 
-  if (!mActor) {
-    RefPtr<Runnable> runnable =
-      new SoftUpdateRunnable(aOriginAttributes, aScope, false, nullptr);
-    AppendPendingOperation(runnable);
-    return;
-  }
-
   RefPtr<GenericPromise::Private> promise =
     new GenericPromise::Private(__func__);
 
   RefPtr<CancelableRunnable> successRunnable =
     new SoftUpdateRunnable(aOriginAttributes, aScope, true, promise);
 
   RefPtr<CancelableRunnable> failureRunnable =
     new ResolvePromiseRunnable(promise);
@@ -3174,24 +3004,16 @@ ServiceWorkerManager::SoftUpdateInternal
 
 void
 ServiceWorkerManager::Update(nsIPrincipal* aPrincipal,
                              const nsACString& aScope,
                              ServiceWorkerUpdateFinishCallback* aCallback)
 {
   AssertIsOnMainThread();
 
-  if (!mActor) {
-    RefPtr<Runnable> runnable =
-      new UpdateRunnable(aPrincipal, aScope, aCallback,
-                         UpdateRunnable::ePostpone, nullptr);
-    AppendPendingOperation(runnable);
-    return;
-  }
-
   RefPtr<GenericPromise::Private> promise =
     new GenericPromise::Private(__func__);
 
   RefPtr<CancelableRunnable> successRunnable =
     new UpdateRunnable(aPrincipal, aScope, aCallback,
                        UpdateRunnable::eSuccess, promise);
 
   RefPtr<CancelableRunnable> failureRunnable =
@@ -3773,24 +3595,16 @@ ServiceWorkerManager::RemoveAndPropagate
   return NS_OK;
 }
 
 void
 ServiceWorkerManager::Remove(const nsACString& aHost)
 {
   AssertIsOnMainThread();
 
-  // We need to postpone this operation in case we don't have an actor because
-  // this is needed by the ForceUnregister.
-  if (!mActor) {
-    RefPtr<nsIRunnable> runnable = new RemoveRunnable(aHost);
-    AppendPendingOperation(runnable);
-    return;
-  }
-
   for (auto it1 = mRegistrationInfos.Iter(); !it1.Done(); it1.Next()) {
     ServiceWorkerManager::RegistrationDataPerPrincipal* data = it1.UserData();
     for (auto it2 = data->mInfos.Iter(); !it2.Done(); it2.Next()) {
       ServiceWorkerRegistrationInfo* reg = it2.UserData();
       nsCOMPtr<nsIURI> scopeURI;
       nsresult rv = NS_NewURI(getter_AddRefs(scopeURI), it2.Key(),
                               nullptr, nullptr);
       // This way subdomains are also cleared.
@@ -3800,23 +3614,16 @@ ServiceWorkerManager::Remove(const nsACS
     }
   }
 }
 
 void
 ServiceWorkerManager::PropagateRemove(const nsACString& aHost)
 {
   AssertIsOnMainThread();
-
-  if (!mActor) {
-    RefPtr<nsIRunnable> runnable = new PropagateRemoveRunnable(aHost);
-    AppendPendingOperation(runnable);
-    return;
-  }
-
   mActor->SendPropagateRemove(nsCString(aHost));
 }
 
 void
 ServiceWorkerManager::RemoveAll()
 {
   AssertIsOnMainThread();
 
@@ -3829,23 +3636,16 @@ ServiceWorkerManager::RemoveAll()
   }
 }
 
 void
 ServiceWorkerManager::PropagateRemoveAll()
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(XRE_IsParentProcess());
-
-  if (!mActor) {
-    RefPtr<nsIRunnable> runnable = new PropagateRemoveAllRunnable();
-    AppendPendingOperation(runnable);
-    return;
-  }
-
   mActor->SendPropagateRemoveAll();
 }
 
 void
 ServiceWorkerManager::RemoveAllRegistrations(OriginAttributesPattern* aPattern)
 {
   AssertIsOnMainThread();
 
@@ -4073,42 +3873,27 @@ ServiceWorkerManager::PropagateSoftUpdat
   return NS_OK;
 }
 
 void
 ServiceWorkerManager::PropagateSoftUpdate(const OriginAttributes& aOriginAttributes,
                                           const nsAString& aScope)
 {
   AssertIsOnMainThread();
-
-  if (!mActor) {
-    RefPtr<nsIRunnable> runnable =
-      new PropagateSoftUpdateRunnable(aOriginAttributes, aScope);
-    AppendPendingOperation(runnable);
-    return;
-  }
-
   mActor->SendPropagateSoftUpdate(aOriginAttributes, nsString(aScope));
 }
 
 NS_IMETHODIMP
 ServiceWorkerManager::PropagateUnregister(nsIPrincipal* aPrincipal,
                                           nsIServiceWorkerUnregisterCallback* aCallback,
                                           const nsAString& aScope)
 {
   AssertIsOnMainThread();
   MOZ_ASSERT(aPrincipal);
 
-  if (!mActor) {
-    RefPtr<nsIRunnable> runnable =
-      new PropagateUnregisterRunnable(aPrincipal, aCallback, aScope);
-    AppendPendingOperation(runnable);
-    return NS_OK;
-  }
-
   PrincipalInfo principalInfo;
   if (NS_WARN_IF(NS_FAILED(PrincipalToPrincipalInfo(aPrincipal,
                                                     &principalInfo)))) {
     return NS_ERROR_FAILURE;
   }
 
   mActor->SendPropagateUnregister(principalInfo, nsString(aScope));
 
--- a/dom/workers/ServiceWorkerManager.h
+++ b/dom/workers/ServiceWorkerManager.h
@@ -23,17 +23,16 @@
 #include "mozilla/dom/Promise.h"
 #include "mozilla/dom/ServiceWorkerCommon.h"
 #include "mozilla/dom/ServiceWorkerRegistrar.h"
 #include "mozilla/dom/ServiceWorkerRegistrarTypes.h"
 #include "mozilla/dom/workers/ServiceWorkerRegistrationInfo.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "nsClassHashtable.h"
 #include "nsDataHashtable.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsRefPtrHashtable.h"
 #include "nsTArrayForwardDeclare.h"
 #include "nsTObserverArray.h"
 
 class nsIConsoleReportCollector;
 
 namespace mozilla {
 
@@ -78,32 +77,30 @@ public:
 
 /*
  * The ServiceWorkerManager is a per-process global that deals with the
  * installation, querying and event dispatch of ServiceWorkers for all the
  * origins in the process.
  */
 class ServiceWorkerManager final
   : public nsIServiceWorkerManager
-  , public nsIIPCBackgroundChildCreateCallback
   , public nsIObserver
 {
   friend class GetReadyPromiseRunnable;
   friend class GetRegistrationsRunnable;
   friend class GetRegistrationRunnable;
   friend class ServiceWorkerJob;
   friend class ServiceWorkerRegistrationInfo;
   friend class ServiceWorkerUnregisterJob;
   friend class ServiceWorkerUpdateJob;
   friend class UpdateTimerCallback;
 
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSISERVICEWORKERMANAGER
-  NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK
   NS_DECL_NSIOBSERVER
 
   struct RegistrationDataPerPrincipal;
   nsClassHashtable<nsCStringHashKey, RegistrationDataPerPrincipal> mRegistrationInfos;
 
   nsTObserverArray<ServiceWorkerRegistrationListener*> mServiceWorkerRegistrationListeners;
 
   nsRefPtrHashtable<nsISupportsHashKey, ServiceWorkerRegistrationInfo> mControlledDocuments;
@@ -458,36 +455,27 @@ private:
     PendingReadyPromise(nsIURI* aURI, Promise* aPromise)
       : mURI(aURI), mPromise(aPromise)
     {}
 
     nsCOMPtr<nsIURI> mURI;
     RefPtr<Promise> mPromise;
   };
 
-  void AppendPendingOperation(nsIRunnable* aRunnable);
-
-  bool HasBackgroundActor() const
-  {
-    return !!mActor;
-  }
-
   nsClassHashtable<nsISupportsHashKey, PendingReadyPromise> mPendingReadyPromises;
 
   void
   MaybeRemoveRegistration(ServiceWorkerRegistrationInfo* aRegistration);
 
   // Removes all service worker registrations that matches the given pattern.
   void
   RemoveAllRegistrations(OriginAttributesPattern* aPattern);
 
   RefPtr<ServiceWorkerManagerChild> mActor;
 
-  nsTArray<nsCOMPtr<nsIRunnable>> mPendingOperations;
-
   bool mShuttingDown;
 
   nsTArray<nsCOMPtr<nsIServiceWorkerManagerListener>> mListeners;
 
   void
   NotifyListenersOnRegister(nsIServiceWorkerRegistrationInfo* aRegistration);
 
   void
--- a/dom/workers/ServiceWorkerScriptCache.cpp
+++ b/dom/workers/ServiceWorkerScriptCache.cpp
@@ -95,22 +95,23 @@ public:
   NS_DECL_NSISTREAMLOADEROBSERVER
   NS_DECL_NSIREQUESTOBSERVER
 
   CompareNetwork(CompareManager* aManager,
                  ServiceWorkerRegistrationInfo* aRegistration,
                  bool aIsMainScript)
     : mManager(aManager)
     , mRegistration(aRegistration)
-    , mIsMainScript(aIsMainScript)
     , mInternalHeaders(new InternalHeaders())
     , mLoadFlags(nsIChannel::LOAD_BYPASS_SERVICE_WORKER)
     , mState(WaitingForInitialization)
     , mNetworkResult(NS_OK)
     , mCacheResult(NS_OK)
+    , mIsMainScript(aIsMainScript)
+    , mIsFromCache(false)
   {
     MOZ_ASSERT(aManager);
     AssertIsOnMainThread();
   }
 
   nsresult
   Initialize(nsIPrincipal* aPrincipal,
              const nsAString& aURL,
@@ -175,18 +176,16 @@ private:
 
   nsresult
   SetPrincipalInfo(nsIChannel* aChannel);
 
   RefPtr<CompareManager> mManager;
   RefPtr<CompareCache> mCC;
   RefPtr<ServiceWorkerRegistrationInfo> mRegistration;
 
-  bool mIsMainScript;
-
   nsCOMPtr<nsIChannel> mChannel;
   nsString mBuffer;
   nsString mURL;
   ChannelInfo mChannelInfo;
   RefPtr<InternalHeaders> mInternalHeaders;
   UniquePtr<PrincipalInfo> mPrincipalInfo;
 
   nsCString mMaxScope;
@@ -197,16 +196,19 @@ private:
     WaitingForBothFinished,
     WaitingForNetworkFinished,
     WaitingForCacheFinished,
     Finished
   } mState;
 
   nsresult mNetworkResult;
   nsresult mCacheResult;
+
+  const bool mIsMainScript;
+  bool mIsFromCache;
 };
 
 NS_IMPL_ISUPPORTS(CompareNetwork, nsIStreamLoaderObserver,
                   nsIRequestObserver)
 
 // This class gets a cached Response from the CacheStorage and then it calls
 // CacheFinish() in the CompareNetwork.
 class CompareCache final : public PromiseNativeHandler
@@ -858,16 +860,22 @@ CompareNetwork::OnStartRequest(nsIReques
   mChannelInfo.InitFromChannel(mChannel);
 
   nsresult rv = SetPrincipalInfo(mChannel);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   mInternalHeaders->FillResponseHeaders(mChannel);
+
+  nsCOMPtr<nsICacheInfoChannel> cacheChannel(do_QueryInterface(channel));
+  if (cacheChannel) {
+    cacheChannel->IsFromCache(&mIsFromCache);
+  }
+
   return NS_OK;
 }
 
 nsresult
 CompareNetwork::SetPrincipalInfo(nsIChannel* aChannel)
 {
   nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
   if (!ssm) {
@@ -954,25 +962,19 @@ CompareNetwork::OnStreamComplete(nsIStre
   }
 
   // Note: we explicitly don't check for the return value here, because the
   // absence of the header is not an error condition.
   Unused << httpChannel->GetResponseHeader(
       NS_LITERAL_CSTRING("Service-Worker-Allowed"),
       mMaxScope);
 
-  bool isFromCache = false;
-  nsCOMPtr<nsICacheInfoChannel> cacheChannel(do_QueryInterface(httpChannel));
-  if (cacheChannel) {
-    cacheChannel->IsFromCache(&isFromCache);
-  }
-
   // [9.2 Update]4.13, If response's cache state is not "local",
   // set registration's last update check time to the current time
-  if (!isFromCache) {
+  if (!mIsFromCache) {
     mRegistration->RefreshLastUpdateCheckTime();
   }
 
   nsAutoCString mimeType;
   nsresult rv2 = httpChannel->GetContentType(mimeType);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     // We should only end up here if !mResponseHead in the channel.  If headers
     // were received but no content type was specified, we'll be given
--- a/dom/workers/test/serviceworkers/browser.ini
+++ b/dom/workers/test/serviceworkers/browser.ini
@@ -8,11 +8,11 @@ support-files =
   file_userContextId_openWindow.js
   force_refresh_browser_worker.js
   empty.html
   server_multie10s_update.sjs
 
 [browser_force_refresh.js]
 [browser_download.js]
 [browser_multie10s_update.js]
-run-if=e10s
+skip-if = !e10s || os != "win" # Bug 1404914
 [browser_userContextId_openWindow.js]
-run-if=e10s
+skip-if = !e10s
--- a/dom/workers/test/serviceworkers/mochitest.ini
+++ b/dom/workers/test/serviceworkers/mochitest.ini
@@ -227,16 +227,17 @@ support-files =
 [test_bug1240436.html]
 [test_claim.html]
 [test_claim_oninstall.html]
 [test_controller.html]
 [test_cookie_fetch.html]
 [test_cross_origin_url_after_redirect.html]
 skip-if = debug # Bug 1262224
 [test_csp_upgrade-insecure_intercept.html]
+[test_devtools_bypass_serviceworker.html]
 [test_empty_serviceworker.html]
 [test_error_reporting.html]
 [test_escapedSlashes.html]
 [test_eval_allowed.html]
 [test_eventsource_intercept.html]
 [test_fetch_event.html]
 skip-if = (debug && e10s) # Bug 1262224
 [test_fetch_event_with_thirdpartypref.html]
--- a/dom/workers/test/serviceworkers/serviceworkerinfo_iframe.html
+++ b/dom/workers/test/serviceworkers/serviceworkerinfo_iframe.html
@@ -2,17 +2,18 @@
 <html lang="en">
   <head>
     <meta charset="utf-8">
     <script>
       window.onmessage = function (event) {
         if (event.data !== "register") {
           return;
         }
-        var promise = navigator.serviceWorker.register("worker.js");
+        var promise = navigator.serviceWorker.register("worker.js",
+                                                       { updateViaCache: 'all' });
         window.onmessage = function (event) {
           if (event.data !== "unregister") {
             return;
           }
           promise.then(function (registration) {
             registration.unregister();
           });
           window.onmessage = null;
new file mode 100644
--- /dev/null
+++ b/dom/workers/test/serviceworkers/test_devtools_bypass_serviceworker.html
@@ -0,0 +1,118 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title> Verify devtools can utilize nsIChannel::LOAD_BYPASS_SERVICE_WORKER to bypass the service worker </title>
+  <script src="/tests/SimpleTest/SimpleTest.js"></script>
+  <script src="/tests/SimpleTest/SpawnTask.js"></script>
+  <script src="error_reporting_helpers.js"></script>
+  <link rel="stylesheet" href="/tests/SimpleTest/test.css"/>
+  <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
+</head>
+<body>
+<div id="content" style="display: none"></div>
+<script type="text/javascript">
+"use strict";
+
+async function testBypassSW () {
+  // Bypass SW imitates the "Disable Cache" option in dev-tools.
+  // Note: if we put the setter/getter into dev-tools, we should take care of
+  // the implementation of enabling/disabling cache since it just overwrite the
+  // defaultLoadFlags of docShell.
+  function setBypassServiceWorker(aDocShell, aBypass) {
+    if (aBypass) {
+      aDocShell.defaultLoadFlags |= Ci.nsIChannel.LOAD_BYPASS_SERVICE_WORKER;
+      return;
+    }
+
+    aDocShell.defaultLoadFlags &= ~Ci.nsIChannel.LOAD_BYPASS_SERVICE_WORKER;
+  }
+
+  function getBypassServiceWorker(aDocShell) {
+    return !!(aDocShell.defaultLoadFlags &
+              Ci.nsIChannel.LOAD_BYPASS_SERVICE_WORKER);
+  }
+
+  async function fetchFakeDocAndCheckIfIntercepted(aWindow) {
+    const fakeDoc = "fake.html";
+
+    // Note: The fetching document doesn't exist, so the expected status of the
+    //       repsonse is 404 unless the request is hijacked.
+    let response = await aWindow.fetch(fakeDoc);
+    if (response.status === 404) {
+      return false;
+    } else if (!response.ok) {
+      throw(response.statusText);
+    }
+
+    let text = await response.text();
+    if (text.includes("Hello")) {
+      // Intercepted
+      return true;
+    }
+
+    throw("Unexpected error");
+    return;
+  }
+
+  let Ci = SpecialPowers.Ci;
+  let docShell = SpecialPowers.wrap(window)
+                              .QueryInterface(Ci.nsIInterfaceRequestor)
+                              .getInterface(Ci.nsIWebNavigation)
+                              .QueryInterface(Ci.nsIDocShell);
+
+  info("Test 1: Enable bypass service worker for the docShell");
+
+  setBypassServiceWorker(docShell, true);
+  ok(getBypassServiceWorker(docShell),
+     "The loadFlags in docShell does bypass the serviceWorker by default");
+
+  let intercepted = await fetchFakeDocAndCheckIfIntercepted(window);
+  ok(!intercepted,
+     "The fetched document wasn't intercepted by the serviceWorker");
+
+  info("Test 2: Disable the bypass service worker for the docShell");
+
+  setBypassServiceWorker(docShell, false);
+  ok(!getBypassServiceWorker(docShell),
+     "The loadFlags in docShell doesn't bypass the serviceWorker by default");
+
+  intercepted = await fetchFakeDocAndCheckIfIntercepted(window);
+  ok(intercepted,
+     "The fetched document was intercepted by the serviceWorker");
+}
+
+// (This doesn't really need to be its own task, but it allows the actual test
+// case to be self-contained.)
+add_task(function setupPrefs() {
+  return SpecialPowers.pushPrefEnv({"set": [
+    ["dom.serviceWorkers.enabled", true],
+    ["dom.serviceWorkers.testing.enabled", true],
+  ]});
+});
+
+add_task(async function test_bypassServiceWorker() {
+  const swURL = "fetch.js";
+  let registration = await navigator.serviceWorker.register(swURL);
+
+  // Wait for the service worker to control the document
+  let waitForControlled = new Promise(resolve => {
+    navigator.serviceWorker.oncontrollerchange = resolve;
+  });
+
+  let sw =
+    registration.active || registration.waiting || registration.installing;
+  sw.postMessage("claim");
+  await waitForControlled;
+
+  try {
+    await testBypassSW();
+  } catch (e) {
+    ok(false, "Reason:" + e);
+  }
+
+  await registration.unregister();
+});
+
+</script>
+</body>
+</html>
--- a/dom/workers/test/serviceworkers/test_devtools_track_serviceworker_time.html
+++ b/dom/workers/test/serviceworkers/test_devtools_track_serviceworker_time.html
@@ -48,16 +48,18 @@ let expectedResults = [
   {
     state: State.ACTIVATING, installedTimeRecorded: true,
     activatedTimeRecorded: false, redundantTimeRecorded: false
   },
   {
     state: State.ACTIVATED, installedTimeRecorded: true,
     activatedTimeRecorded: true, redundantTimeRecorded: false
   },
+
+  // On unregister
   {
     state: State.REDUNDANT, installedTimeRecorded: true,
     activatedTimeRecorded: true, redundantTimeRecorded: true
   }
 ];
 
 function waitForRegister(aScope, aCallback) {
   return new Promise(function (aResolve) {
@@ -165,16 +167,25 @@ function testServiceWorkerInfo() {
     }
   };
 
   registrationInfo.addListener(swrlistener);
 
   return promise;
 }
 
+async function testHttpCacheUpdateTime() {
+  let iframe = document.querySelector("iframe");
+  let reg = await iframe.contentWindow.navigator.serviceWorker.getRegistration();
+  let lastUpdateTime = registrationInfo.lastUpdateTime;
+  await reg.update();
+  is(lastUpdateTime, registrationInfo.lastUpdateTime,
+     "The update time should not change when SW script is read from http cache.");
+}
+
 function unregister() {
   info("Unregister the ServiceWorker");
 
   let iframe = document.querySelector("iframe");
   iframe.contentWindow.postMessage("unregister", "*");
   return waitForUnregister(EXAMPLE_URL);
 }
 
@@ -191,16 +202,17 @@ function cleanAll() {
     aResolve();
   })
 }
 
 function runTest() {
   return Promise.resolve()
     .then(register)
     .then(testServiceWorkerInfo)
+    .then(testHttpCacheUpdateTime)
     .then(unregister)
     .catch(aError => ok(false, "Some test failed with error " + aError))
     .then(cleanAll)
     .then(SimpleTest.finish);
 }
 
 SimpleTest.waitForExplicitFinish();
 SpecialPowers.pushPrefEnv({"set": [
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -5888,17 +5888,20 @@ HTMLEditRules::GetNodesForOperation(
       rv = BustUpInlinesAtRangeEndpoints(*item);
       if (NS_FAILED(rv)) {
         break;
       }
     }
     // Then unregister the ranges
     for (auto& item : rangeItemArray) {
       htmlEditor->mRangeUpdater.DropRangeItem(item);
-      aArrayOfRanges.AppendElement(item->GetRange());
+      RefPtr<nsRange> range = item->GetRange();
+      if (range) {
+        aArrayOfRanges.AppendElement(range);
+      }
     }
     NS_ENSURE_SUCCESS(rv, rv);
   }
   // Gather up a list of all the nodes
   for (auto& range : aArrayOfRanges) {
     DOMSubtreeIterator iter;
     nsresult rv = iter.Init(*range);
     NS_ENSURE_SUCCESS(rv, rv);
new file mode 100644
--- /dev/null
+++ b/editor/libeditor/crashtests/1402196.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script>
+function load() {
+  document.getElementById("p").addEventListener("DOMNodeInserted", () => {
+    document.getElementById("style").appendChild(
+                                       document.getElementById("table"));
+    document.documentElement.classList.remove("reftest-wait");
+  });
+  document.execCommand("insertOrderedList", false);
+}
+</script>
+</head>
+<body onload="load()">
+<table id="table"></table>
+<style id="style"></style>
+<spacer id="spacer" contenteditable="true">
+<p id="p"></p>
+</body>
+</html>
--- a/editor/libeditor/crashtests/crashtests.list
+++ b/editor/libeditor/crashtests/crashtests.list
@@ -83,12 +83,13 @@ load 1366176.html
 load 1375131.html
 load 1381541.html
 load 1383747.html
 load 1383755.html
 load 1383763.html
 load 1384161.html
 load 1388075.html
 load 1393171.html
+needs-focus load 1402196.html
 load 1402469.html
 load 1402904.html
 load 1405747.html
 load 1408170.html
--- a/extensions/spellcheck/src/mozPersonalDictionary.cpp
+++ b/extensions/spellcheck/src/mozPersonalDictionary.cpp
@@ -100,17 +100,17 @@ public:
       nsCOMPtr<nsIOutputStream> outStream;
       NS_NewSafeLocalFileOutputStream(getter_AddRefs(outStream), mFile,
                                       PR_CREATE_FILE | PR_WRONLY | PR_TRUNCATE,
                                       0664);
 
       // Get a buffered output stream 4096 bytes big, to optimize writes.
       nsCOMPtr<nsIOutputStream> bufferedOutputStream;
       res = NS_NewBufferedOutputStream(getter_AddRefs(bufferedOutputStream),
-                                       outStream, 4096);
+                                       outStream.forget(), 4096);
       if (NS_FAILED(res)) {
         return res;
       }
 
       uint32_t bytesWritten;
       nsAutoCString utf8Key;
       for (uint32_t i = 0; i < mDictWords.Length(); ++i) {
         CopyUTF16toUTF8(mDictWords[i], utf8Key);
--- a/ipc/glue/BackgroundChild.h
+++ b/ipc/glue/BackgroundChild.h
@@ -7,17 +7,16 @@
 #ifndef mozilla_ipc_backgroundchild_h__
 #define mozilla_ipc_backgroundchild_h__
 
 #include "base/process.h"
 #include "mozilla/Attributes.h"
 #include "mozilla/ipc/Transport.h"
 
 class nsIDOMBlob;
-class nsIIPCBackgroundChildCreateCallback;
 
 namespace mozilla {
 namespace dom {
 
 class BlobImpl;
 class ContentChild;
 class ContentParent;
 
@@ -32,18 +31,16 @@ class PBackgroundChild;
 // single background thread in the parent process. Each PBackgroundChild
 // instance is tied to the thread on which it is created and must not be shared
 // across threads. Each PBackgroundChild is unique and valid as long as its
 // designated thread lives.
 //
 // Creation of PBackground is synchronous. GetOrCreateForCurrentThread will
 // create the actor if it doesn't exist yet. Thereafter (assuming success)
 // GetForCurrentThread() will return the same actor every time.
-// GetOrCreateForCurrentThread(nsIIPCBackgroundChildCreateCallback* aCallback)
-// emulates former asynchronous behavior and might be removed in future.
 //
 // CloseForCurrentThread() will close the current PBackground actor.  Subsequent
 // calls to GetForCurrentThread will return null.  CloseForCurrentThread() may
 // only be called exactly once for each thread-specific actor.  Currently it is
 // illegal to call this before the PBackground actor has been created.
 //
 // The PBackgroundChild actor and all its sub-protocol actors will be
 // automatically destroyed when its designated thread completes.
@@ -56,20 +53,16 @@ class BackgroundChild final
   typedef mozilla::ipc::Transport Transport;
 
 public:
   // See above.
   static PBackgroundChild*
   GetForCurrentThread();
 
   // See above.
-  static bool
-  GetOrCreateForCurrentThread(nsIIPCBackgroundChildCreateCallback* aCallback);
-
-  // See above.
   static PBackgroundChild*
   GetOrCreateForCurrentThread();
 
   // See above.
   static void
   CloseForCurrentThread();
 
 private:
--- a/ipc/glue/BackgroundImpl.cpp
+++ b/ipc/glue/BackgroundImpl.cpp
@@ -23,17 +23,16 @@
 #include "mozilla/Unused.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/dom/ContentParent.h"
 #include "mozilla/dom/File.h"
 #include "mozilla/ipc/ProtocolTypes.h"
 #include "nsAutoPtr.h"
 #include "nsCOMPtr.h"
 #include "nsIEventTarget.h"
-#include "nsIIPCBackgroundChildCreateCallback.h"
 #include "nsIMutable.h"
 #include "nsIObserver.h"
 #include "nsIObserverService.h"
 #include "nsIRunnable.h"
 #include "nsISupportsImpl.h"
 #include "nsIThread.h"
 #include "nsITimer.h"
 #include "nsTArray.h"
@@ -394,20 +393,16 @@ private:
   static void
   Startup();
 
   // Forwarded from BackgroundChild.
   static PBackgroundChild*
   GetForCurrentThread();
 
   // Forwarded from BackgroundChild.
-  static bool
-  GetOrCreateForCurrentThread(nsIIPCBackgroundChildCreateCallback* aCallback);
-
-  // Forwarded from BackgroundChild.
   static PBackgroundChild*
   GetOrCreateForCurrentThread();
 
   // Forwarded from BackgroundChild.
   static void
   CloseForCurrentThread();
 
   // Forwarded from BackgroundChildImpl.
@@ -622,45 +617,16 @@ public:
 
 private:
   ~ShutdownObserver()
   {
     AssertIsOnMainThread();
   }
 };
 
-// Must be cancelable in order to dispatch on active worker threads
-class ChildImpl::ActorCreatedRunnable final :
-  public CancelableRunnable
-{
-  nsCOMPtr<nsIIPCBackgroundChildCreateCallback> mCallback;
-  RefPtr<ChildImpl> mActor;
-
-public:
-  ActorCreatedRunnable(nsIIPCBackgroundChildCreateCallback* aCallback,
-                       ChildImpl* aActor)
-    : CancelableRunnable("Background::ChildImpl::ActorCreatedRunnable")
-    , mCallback(aCallback)
-    , mActor(aActor)
-  {
-    // May be created on any thread!
-    MOZ_ASSERT(aCallback);
-    MOZ_ASSERT(aActor);
-  }
-
-protected:
-  virtual ~ActorCreatedRunnable()
-  { }
-
-  NS_DECL_NSIRUNNABLE
-
-  nsresult
-  Cancel() override;
-};
-
 } // namespace
 
 namespace mozilla {
 namespace ipc {
 
 bool
 IsOnBackgroundThread()
 {
@@ -744,24 +710,16 @@ BackgroundChild::Startup()
 // static
 PBackgroundChild*
 BackgroundChild::GetForCurrentThread()
 {
   return ChildImpl::GetForCurrentThread();
 }
 
 // static
-bool
-BackgroundChild::GetOrCreateForCurrentThread(
-                                 nsIIPCBackgroundChildCreateCallback* aCallback)
-{
-  return ChildImpl::GetOrCreateForCurrentThread(aCallback);
-}
-
-// static
 PBackgroundChild*
 BackgroundChild::GetOrCreateForCurrentThread()
 {
   return ChildImpl::GetOrCreateForCurrentThread();
 }
 
 // static
 void
@@ -1483,35 +1441,16 @@ ChildImpl::GetForCurrentThread()
 
   if (!threadLocalInfo) {
     return nullptr;
   }
 
   return threadLocalInfo->mActor;
 }
 
-// static
-bool
-ChildImpl::GetOrCreateForCurrentThread(
-                                 nsIIPCBackgroundChildCreateCallback* aCallback)
-{
-  MOZ_ASSERT(aCallback);
-
-  RefPtr<ChildImpl> actor =
-    static_cast<ChildImpl*>(GetOrCreateForCurrentThread());
-  if (NS_WARN_IF(!actor)) {
-    return false;
-  }
-
-  nsCOMPtr<nsIRunnable> runnable = new ActorCreatedRunnable(aCallback, actor);
-  MOZ_ALWAYS_SUCCEEDS(NS_DispatchToCurrentThread(runnable));
-
-  return true;
-}
-
 /* static */
 PBackgroundChild*
 ChildImpl::GetOrCreateForCurrentThread()
 {
   MOZ_ASSERT(sThreadLocalIndex != kBadThreadLocalIndex,
              "BackgroundChild::Startup() was never called!");
 
   auto threadLocalInfo = NS_IsMainThread() ? sMainThreadInfo :
@@ -1644,37 +1583,16 @@ ChildImpl::GetThreadLocalForCurrentThrea
   if (!threadLocalInfo->mConsumerThreadLocal) {
     threadLocalInfo->mConsumerThreadLocal =
       new BackgroundChildImpl::ThreadLocal();
   }
 
   return threadLocalInfo->mConsumerThreadLocal;
 }
 
-NS_IMETHODIMP
-ChildImpl::ActorCreatedRunnable::Run()
-{
-  // May run on any thread!
-
-  MOZ_ASSERT(mCallback);
-  MOZ_ASSERT(mActor);
-
-  mCallback->ActorCreated(mActor);
-
-  return NS_OK;
-}
-
-nsresult
-ChildImpl::ActorCreatedRunnable::Cancel()
-{
-  // These are IPC infrastructure objects and need to run unconditionally.
-  Run();
-  return NS_OK;
-}
-
 void
 ChildImpl::ActorDestroy(ActorDestroyReason aWhy)
 {
   AssertIsOnOwningThread();
 
 #ifdef DEBUG
   MOZ_ASSERT(!mActorDestroyed);
   mActorDestroyed = true;
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -1,17 +1,16 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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('/media/webrtc/webrtc.mozbuild')
 
 EXPORTS += [
-    'nsIIPCBackgroundChildCreateCallback.h',
     'nsIIPCSerializableInputStream.h',
     'nsIIPCSerializableURI.h',
 ]
 
 EXPORTS.mozilla.ipc += [
     'BackgroundChild.h',
     'BackgroundParent.h',
     'BackgroundUtils.h',
deleted file mode 100644
--- a/ipc/glue/nsIIPCBackgroundChildCreateCallback.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* 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/. */
-
-#ifndef mozilla_ipc_nsiipcbackgroundchildcreatecallback_h
-#define mozilla_ipc_nsiipcbackgroundchildcreatecallback_h
-
-#include "mozilla/Attributes.h"
-#include "nsISupports.h"
-
-namespace mozilla {
-namespace ipc {
-
-class PBackgroundChild;
-
-} // namespace ipc
-} // namespace mozilla
-
-#define NS_IIPCBACKGROUNDCHILDCREATECALLBACK_IID                               \
-  {0x4de01707, 0x70e3, 0x4181, {0xbc, 0x9f, 0xa3, 0xec, 0xfe, 0x74, 0x1a, 0xe3}}
-
-class NS_NO_VTABLE nsIIPCBackgroundChildCreateCallback : public nsISupports
-{
-public:
-  typedef mozilla::ipc::PBackgroundChild PBackgroundChild;
-
-  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIPCBACKGROUNDCHILDCREATECALLBACK_IID)
-
-  // This will be called upon successful creation of a PBackgroundChild actor.
-  // The actor is unique per-thread and must not be shared across threads. It
-  // may be saved and reused on the same thread for as long as the thread lives.
-  // After this callback BackgroundChild::GetForCurrentThread() will return the
-  // same actor.
-  virtual void
-  ActorCreated(PBackgroundChild*) = 0;
-
-  // This will be called if for some reason the PBackgroundChild actor cannot be
-  // created. This should never be called in child processes as the failure to
-  // create the actor should result in the termination of the child process
-  // first. This may be called for cross-thread actors in the main process.
-  virtual void
-  ActorFailed() = 0;
-};
-
-NS_DEFINE_STATIC_IID_ACCESSOR(nsIIPCBackgroundChildCreateCallback,
-                              NS_IIPCBACKGROUNDCHILDCREATECALLBACK_IID)
-
-#define NS_DECL_NSIIPCBACKGROUNDCHILDCREATECALLBACK                            \
-  virtual void                                                                 \
-  ActorCreated(mozilla::ipc::PBackgroundChild*) override;                      \
-  virtual void                                                                 \
-  ActorFailed() override;
-
-#define NS_FORWARD_NSIIPCBACKGROUNDCHILDCREATECALLBACK(_to)                    \
-  virtual void                                                                 \
-  ActorCreated(mozilla::ipc::PBackgroundChild* aActor) override                \
-  { _to ActorCreated(aActor); }                                                \
-  virtual void                                                                 \
-  ActorFailed() override                                                       \
-  { _to ActorFailed(); }
-
-#define NS_FORWARD_SAFE_NSIIPCBACKGROUNDCHILDCREATECALLBACK(_to)               \
-  virtual void                                                                 \
-  ActorCreated(mozilla::ipc::PBackgroundChild* aActor) override                \
-  { if (_to) { _to->ActorCreated(aActor); } }                                  \
-  virtual void                                                                 \
-  ActorFailed() override                                                       \
-  { if (_to) { _to->ActorFailed(); } }
-
-#endif // mozilla_ipc_nsiipcbackgroundchildcreatecallback_h
--- a/js/public/Class.h
+++ b/js/public/Class.h
@@ -532,22 +532,16 @@ typedef bool
                   JS::HandleValue receiver, JS::ObjectOpResult& result);
 typedef bool
 (* GetOwnPropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
                      JS::MutableHandle<JS::PropertyDescriptor> desc);
 typedef bool
 (* DeletePropertyOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id,
                      JS::ObjectOpResult& result);
 
-typedef bool
-(* WatchOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleObject callable);
-
-typedef bool
-(* UnwatchOp)(JSContext* cx, JS::HandleObject obj, JS::HandleId id);
-
 class JS_FRIEND_API(ElementAdder)
 {
   public:
     enum GetBehavior {
         // Check if the element exists before performing the Get and preserve
         // holes.
         CheckHasElemPreserveHoles,
 
@@ -736,18 +730,16 @@ struct JS_STATIC_CLASS ObjectOps
 {
     LookupPropertyOp lookupProperty;
     DefinePropertyOp defineProperty;
     HasPropertyOp    hasProperty;
     GetPropertyOp    getProperty;
     SetPropertyOp    setProperty;
     GetOwnPropertyOp getOwnPropertyDescriptor;
     DeletePropertyOp deleteProperty;
-    WatchOp          watch;
-    UnwatchOp        unwatch;
     GetElementsOp    getElements;
     JSFunToStringOp  funToString;
 };
 
 #define JS_NULL_OBJECT_OPS nullptr
 
 } // namespace js
 
@@ -891,18 +883,18 @@ struct JS_STATIC_CLASS Class
     const ClassSpec* spec;
     const ClassExtension* ext;
     const ObjectOps* oOps;
 
     /*
      * Objects of this class aren't native objects. They don't have Shapes that
      * describe their properties and layout. Classes using this flag must
      * provide their own property behavior, either by being proxy classes (do
-     * this) or by overriding all the ObjectOps except getElements, watch and
-     * unwatch (don't do this).
+     * this) or by overriding all the ObjectOps except getElements
+     * (don't do this).
      */
     static const uint32_t NON_NATIVE = JSCLASS_INTERNAL_FLAG2;
 
     bool isNative() const {
         return !(flags & NON_NATIVE);
     }
 
     bool hasPrivate() const {
@@ -969,18 +961,16 @@ struct JS_STATIC_CLASS Class
     DefinePropertyOp getOpsDefineProperty() const { return oOps ? oOps->defineProperty : nullptr; }
     HasPropertyOp    getOpsHasProperty()    const { return oOps ? oOps->hasProperty    : nullptr; }
     GetPropertyOp    getOpsGetProperty()    const { return oOps ? oOps->getProperty    : nullptr; }
     SetPropertyOp    getOpsSetProperty()    const { return oOps ? oOps->setProperty    : nullptr; }
     GetOwnPropertyOp getOpsGetOwnPropertyDescriptor()
                                             const { return oOps ? oOps->getOwnPropertyDescriptor
                                                                                      : nullptr; }
     DeletePropertyOp getOpsDeleteProperty() const { return oOps ? oOps->deleteProperty : nullptr; }
-    WatchOp          getOpsWatch()          const { return oOps ? oOps->watch          : nullptr; }
-    UnwatchOp        getOpsUnwatch()        const { return oOps ? oOps->unwatch        : nullptr; }
     GetElementsOp    getOpsGetElements()    const { return oOps ? oOps->getElements    : nullptr; }
     JSFunToStringOp  getOpsFunToString()    const { return oOps ? oOps->funToString    : nullptr; }
 };
 
 static_assert(offsetof(JSClassOps, addProperty) == offsetof(ClassOps, addProperty),
               "ClassOps and JSClassOps must be consistent");
 static_assert(offsetof(JSClassOps, delProperty) == offsetof(ClassOps, delProperty),
               "ClassOps and JSClassOps must be consistent");
--- a/js/public/Proxy.h
+++ b/js/public/Proxy.h
@@ -339,22 +339,16 @@ class JS_FRIEND_API(BaseProxyHandler)
 
     // Allow proxies, wrappers in particular, to specify callability at runtime.
     // Note: These do not take const JSObject*, but they do in spirit.
     //       We are not prepared to do this, as there's little const correctness
     //       in the external APIs that handle proxies.
     virtual bool isCallable(JSObject* obj) const;
     virtual bool isConstructor(JSObject* obj) const;
 
-    // These two hooks must be overridden, or not overridden, in tandem -- no
-    // overriding just one!
-    virtual bool watch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
-                       JS::HandleObject callable) const;
-    virtual bool unwatch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id) const;
-
     virtual bool getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
                              ElementAdder* adder) const;
 
     /* See comment for weakmapKeyDelegateOp in js/Class.h. */
     virtual JSObject* weakmapKeyDelegate(JSObject* proxy) const;
     virtual bool isScripted() const { return false; }
 };
 
--- a/js/rust/src/jsglue.cpp
+++ b/js/rust/src/jsglue.cpp
@@ -85,18 +85,16 @@ struct ProxyTraps {
     bool (*defaultValue)(JSContext *cx, JS::HandleObject obj, JSType hint, JS::MutableHandleValue vp);
     void (*trace)(JSTracer *trc, JSObject *proxy);
     void (*finalize)(JSFreeOp *fop, JSObject *proxy);
     size_t (*objectMoved)(JSObject *proxy, JSObject *old);
 
     bool (*isCallable)(JSObject *obj);
     bool (*isConstructor)(JSObject *obj);
 
-    // watch
-    // unwatch
     // getElements
 
     // weakmapKeyDelegate
     // isScripted
 };
 
 static int HandlerFamily;
 
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -861,119 +861,16 @@ obj_assign(JSContext* cx, unsigned argc,
             return false;
     }
 
     // Step 5.
     args.rval().setObject(*to);
     return true;
 }
 
-#if JS_HAS_OBJ_WATCHPOINT
-
-bool
-js::WatchHandler(JSContext* cx, JSObject* obj_, jsid id_, const JS::Value& old,
-                 JS::Value* nvp, void* closure)
-{
-    RootedObject obj(cx, obj_);
-    RootedId id(cx, id_);
-
-    /* Avoid recursion on (obj, id) already being watched on cx. */
-    AutoResolving resolving(cx, obj, id, AutoResolving::WATCH);
-    if (resolving.alreadyStarted())
-        return true;
-
-    FixedInvokeArgs<3> args(cx);
-
-    args[0].set(IdToValue(id));
-    args[1].set(old);
-    args[2].set(*nvp);
-
-    RootedValue callable(cx, ObjectValue(*static_cast<JSObject*>(closure)));
-    RootedValue thisv(cx, ObjectValue(*obj));
-    RootedValue rv(cx);
-    if (!Call(cx, callable, thisv, args, &rv))
-        return false;
-
-    *nvp = rv;
-    return true;
-}
-
-static bool
-obj_watch(JSContext* cx, unsigned argc, Value* vp)
-{
-    CallArgs args = CallArgsFromVp(argc, vp);
-
-    RootedObject obj(cx, ToObject(cx, args.thisv()));
-    if (!obj)
-        return false;
-
-    if (!cx->compartment()->warnedAboutObjectWatch) {
-        if (!JS_ReportErrorFlagsAndNumberASCII(cx, JSREPORT_WARNING, GetErrorMessage, nullptr,
-                                               JSMSG_OBJECT_WATCH_DEPRECATED))
-        {
-            return false;
-        }
-        cx->compartment()->warnedAboutObjectWatch = true;
-    }
-
-    if (args.length() <= 1) {
-        ReportMissingArg(cx, args.calleev(), 1);
-        return false;
-    }
-
-    RootedObject callable(cx, ValueToCallable(cx, args[1], args.length() - 2));
-    if (!callable)
-        return false;
-
-    RootedId propid(cx);
-    if (!ValueToId<CanGC>(cx, args[0], &propid))
-        return false;
-
-    if (!WatchProperty(cx, obj, propid, callable))
-        return false;
-
-    args.rval().setUndefined();
-    return true;
-}
-
-static bool
-obj_unwatch(JSContext* cx, unsigned argc, Value* vp)
-{
-    CallArgs args = CallArgsFromVp(argc, vp);
-
-    RootedObject obj(cx, ToObject(cx, args.thisv()));
-    if (!obj)
-        return false;
-
-    if (!cx->compartment()->warnedAboutObjectWatch) {
-        if (!JS_ReportErrorFlagsAndNumberASCII(cx, JSREPORT_WARNING, GetErrorMessage, nullptr,
-                                               JSMSG_OBJECT_WATCH_DEPRECATED))
-        {
-            return false;
-        }
-        cx->compartment()->warnedAboutObjectWatch = true;
-    }
-
-    RootedId id(cx);
-    if (args.length() != 0) {
-        if (!ValueToId<CanGC>(cx, args[0], &id))
-            return false;
-    } else {
-        id = JSID_VOID;
-    }
-
-    if (!UnwatchProperty(cx, obj, id))
-        return false;
-
-    args.rval().setUndefined();
-    return true;
-}
-
-#endif /* JS_HAS_OBJ_WATCHPOINT */
-
 /* ES5 15.2.4.6. */
 static bool
 obj_isPrototypeOf(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     /* Step 1. */
     if (args.length() < 1 || !args[0].isObject()) {
@@ -1622,20 +1519,16 @@ ProtoSetter(JSContext* cx, unsigned argc
 
 static const JSFunctionSpec object_methods[] = {
 #if JS_HAS_TOSOURCE
     JS_FN(js_toSource_str,             obj_toSource,                0,0),
 #endif
     JS_INLINABLE_FN(js_toString_str,   obj_toString,                0,0, ObjectToString),
     JS_SELF_HOSTED_FN(js_toLocaleString_str, "Object_toLocaleString", 0, 0),
     JS_SELF_HOSTED_FN(js_valueOf_str,  "Object_valueOf",            0,0),
-#if JS_HAS_OBJ_WATCHPOINT
-    JS_FN(js_watch_str,                obj_watch,                   2,0),
-    JS_FN(js_unwatch_str,              obj_unwatch,                 1,0),
-#endif
     JS_SELF_HOSTED_FN(js_hasOwnProperty_str, "Object_hasOwnProperty", 1,0),
     JS_FN(js_isPrototypeOf_str,        obj_isPrototypeOf,           1,0),
     JS_FN(js_propertyIsEnumerable_str, obj_propertyIsEnumerable,    1,0),
 #if JS_OLD_GETTER_SETTER_METHODS
     JS_SELF_HOSTED_FN(js_defineGetter_str, "ObjectDefineGetter",    2,0),
     JS_SELF_HOSTED_FN(js_defineSetter_str, "ObjectDefineSetter",    2,0),
     JS_SELF_HOSTED_FN(js_lookupGetter_str, "ObjectLookupGetter",    1,0),
     JS_SELF_HOSTED_FN(js_lookupSetter_str, "ObjectLookupSetter",    1,0),
--- a/js/src/builtin/TypedObject.cpp
+++ b/js/src/builtin/TypedObject.cpp
@@ -2216,17 +2216,16 @@ OutlineTransparentTypedObject::getOrCrea
 const ObjectOps TypedObject::objectOps_ = {
     TypedObject::obj_lookupProperty,
     TypedObject::obj_defineProperty,
     TypedObject::obj_hasProperty,
     TypedObject::obj_getProperty,
     TypedObject::obj_setProperty,
     TypedObject::obj_getOwnPropertyDescriptor,
     TypedObject::obj_deleteProperty,
-    nullptr, nullptr, /* watch/unwatch */
     nullptr,   /* getElements */
     nullptr, /* thisValue */
 };
 
 #define DEFINE_TYPEDOBJ_CLASS(Name, Trace, Moved, flag)   \
     static const ClassOps Name##ClassOps = {             \
         nullptr,        /* addProperty */                \
         nullptr,        /* delProperty */                \
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -682,38 +682,36 @@ class MemoryCounter
         if (isTooMuchMalloc())
             maxBytes_ *= 2;
         else
             maxBytes_ = std::max(initialMaxBytes_.ref(), size_t(maxBytes_ * 0.9));
         reset();
     }
 
     void setMax(size_t newMax, const AutoLockGC& lock) {
-        // For compatibility treat any value that exceeds PTRDIFF_T_MAX to
-        // mean that value.
-        initialMaxBytes_ = (ptrdiff_t(newMax) >= 0) ? newMax : size_t(-1) >> 1;
+        initialMaxBytes_ = newMax;
         maxBytes_ = initialMaxBytes_;
         reset();
     }
 
     bool update(T* owner, size_t bytes) {
-        bytes_ += ptrdiff_t(bytes);
+        bytes_ += bytes;
         if (MOZ_UNLIKELY(isTooMuchMalloc())) {
             if (!triggered_)
                 triggered_ = owner->triggerGCForTooMuchMalloc();
         }
         return triggered_;
     }
 
     void adopt(MemoryCounter<T>& other) {
         bytes_ += other.bytes();
         other.reset();
     }
 
-    ptrdiff_t bytes() const { return bytes_; }
+    size_t bytes() const { return bytes_; }
     size_t maxBytes() const { return maxBytes_; }
     size_t initialMaxBytes(const AutoLockGC& lock) const { return initialMaxBytes_; }
     bool isTooMuchMalloc() const { return bytes_ >= maxBytes_; }
 
   private:
     void reset() {
         bytes_ = 0;
         triggered_ = false;
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -3353,19 +3353,18 @@ FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(I
  * To prevent this badness, we unmark the gray bit of an object when it is
  * accessed by callers outside XPConnect. This would cause the object to go
  * black in step 2 above. This must be done on everything reachable from the
  * object being returned. The following code takes care of the recursive
  * re-coloring.
  *
  * There is an additional complication for certain kinds of edges that are not
  * contained explicitly in the source object itself, such as from a weakmap key
- * to its value, and from an object being watched by a watchpoint to the
- * watchpoint's closure. These "implicit edges" are represented in some other
- * container object, such as the weakmap or the watchpoint itself. In these
+ * to its value. These "implicit edges" are represented in some other
+ * container object, such as the weakmap itself. In these
  * cases, calling unmark gray on an object won't find all of its children.
  *
  * Handling these implicit edges has two parts:
  * - A special pass enumerating all of the containers that know about the
  *   implicit edges to fix any black-gray edges that have been created. This
  *   is implemented in nsXPConnect::FixWeakMappingGrayBits.
  * - To prevent any incorrectly gray objects from escaping to live JS outside
  *   of the containers, we must add unmark-graying read barriers to these
--- a/js/src/gc/RootMarking.cpp
+++ b/js/src/gc/RootMarking.cpp
@@ -9,17 +9,16 @@
 #ifdef MOZ_VALGRIND
 # include <valgrind/memcheck.h>
 #endif
 
 #include "jscntxt.h"
 #include "jsgc.h"
 #include "jsprf.h"
 #include "jstypes.h"
-#include "jswatchpoint.h"
 
 #include "builtin/MapObject.h"
 #include "frontend/BytecodeCompiler.h"
 #include "gc/GCInternals.h"
 #include "gc/Marking.h"
 #include "jit/MacroAssembler.h"
 #include "js/HashTable.h"
 #include "vm/Debugger.h"
--- a/js/src/gc/Zone.h
+++ b/js/src/gc/Zone.h
@@ -437,36 +437,33 @@ struct Zone : public JS::shadow::Zone,
 
         if (js::CurrentThreadCanAccessRuntime(rt)) {
             return rt->gc.triggerZoneGC(this, JS::gcreason::TOO_MUCH_MALLOC,
                                         gcMallocCounter.bytes(), gcMallocCounter.maxBytes());
         }
         return false;
     }
 
-    void updateGCMallocBytesOnGC(const js::AutoLockGC& lock) {
-        gcMallocCounter.updateOnGC(lock);
-    }
     void setGCMaxMallocBytes(size_t value, const js::AutoLockGC& lock) {
         gcMallocCounter.setMax(value, lock);
     }
     void updateMallocCounter(size_t nbytes) {
         gcMallocCounter.update(this, nbytes);
     }
     void adoptMallocBytes(Zone* other) {
         gcMallocCounter.adopt(other->gcMallocCounter);
     }
     size_t GCMaxMallocBytes() const { return gcMallocCounter.maxBytes(); }
     size_t GCMallocBytes() const { return gcMallocCounter.bytes(); }
 
     void updateJitCodeMallocBytes(size_t size) { jitCodeCounter.update(this, size); }
 
     // Updates all the memory counters after GC.
     void updateAllMallocBytesOnGC(const js::AutoLockGC& lock) {
-        updateGCMallocBytesOnGC(lock);
+        gcMallocCounter.updateOnGC(lock);
         jitCodeCounter.updateOnGC(lock);
     }
     bool isTooMuchMalloc() const {
         return gcMallocCounter.isTooMuchMalloc() ||
                jitCodeCounter.isTooMuchMalloc();
     }
 
   private:
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug466654.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// |jit-test| error:TypeError; need-for-each
-
-// Binary: cache/js-dbg-32-29add08d84ae-linux
-// Flags: -j
-//
-this.watch('y',  /x/g );
-for each (y in ['q', 'q', 'q']) continue;
-gc();
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug516897.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// Binary: cache/js-dbg-64-38754465ffde-linux
-// Flags:
-//
-this.__defineSetter__("x", gc);
-this.watch("x",function(){return});
-x = 3;
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug537854.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// Binary: cache/js-dbg-64-9d51f2a931f7-linux
-// Flags:
-//
-({x:function(){}}).watch('x',function(){});
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug560796.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Binary: cache/js-dbg-64-a6d7a5677b4c-linux
-// Flags:
-//
-this.__defineSetter__("x", function(){})
-this.watch("x", "".localeCompare)
-window = x
-Object.defineProperty(this, "x", ({
-    set: window
-}))
--- a/js/src/jit-test/tests/auto-regress/bug638735.js
+++ b/js/src/jit-test/tests/auto-regress/bug638735.js
@@ -1,15 +1,14 @@
 // Binary: cache/js-dbg-64-290712e55ade-linux
 // Flags: -j
 //
 var o9 = Function.prototype;
 var o13 = Array;
 function f5(o) {
-o.watch('p3', function() {});
 ox1 = new Proxy(o, {});
 }
 f5(o9);
 f5(o13);
 var o0 = [];
 function f3(o) {
             var prop = Object.getOwnPropertyNames(ox1)[0];
             if (prop) { Object.defineProperty(ox1, prop, {configurable: true,enumerable: true,unused: 1 }); }
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug639413.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// |jit-test| error:TypeError
-
-// Binary: cache/js-dbg-32-1c8e91b2e3a4-linux
-// Flags:
-//
-a = evalcx("lazy");
-a.watch("x", function() {});
-({}).watch("x", function() {});
-a.__defineGetter__("y", {});
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug698899.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// Binary: cache/js-dbg-32-f951e9151626-linux
-// Flags: -m -n
-//
-o = evalcx("lazy").__proto__
-gc()
-try {
-    o.watch()
-} catch (e) {}
-o.constructor()
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug746397.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// |jit-test| error:ReferenceError
-
-// Binary: cache/js-dbg-64-67bf9a4a1f77-linux
-// Flags: --ion-eager
-//
-
-(function () {
-  var a = ['x', 'y'];
-  obj.watch(a[+("0")], counter);
-})();
deleted file mode 100644
--- a/js/src/jit-test/tests/auto-regress/bug769192.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// |jit-test| error:TypeError
-
-// Binary: cache/js-dbg-64-bf8f2961d0cc-linux
-// Flags:
-//
-Object.watch.call(new Uint8ClampedArray, "length", function() {});
deleted file mode 100644
--- a/js/src/jit-test/tests/baseline/bug843444.js
+++ /dev/null
@@ -1,8 +0,0 @@
-gczeal(8, 1)
-function recurse(x) {
-    recurse;
-    if (x < 20)
-	recurse(x + 1);
-};
-this.watch(5, (function () {}))
-recurse(0)
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/bug510437.js
+++ /dev/null
@@ -1,13 +0,0 @@
-// Don't crash or assert.
-
-var d;
-this.watch("d", eval);
-(function () {
-    (eval("\
-    (function () {\
-        for (let x = 0; x < 2; ++x) {\
-            d = x\
-        }\
-    })\
-"))()
-})()
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/bug605015.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// |jit-test| error: TypeError 
-// don't assert
-
-print(this.watch("x",
-function() {
-  Object.defineProperty(this, "x", ({
-    get: (Int8Array)
-  }))
-}))(x = /x/)
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/bug631305.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var n = 0;
-var a = [];
-for (var i = 0; i < 20; i++)
-    a[i] = {};
-a[18].watch("p", function () { n++; });
-delete a[18].p;
-for (var i = 0; i < 20; i++)
-    a[i].p = 0;
-assertEq(n, 1);
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/bug662562.js
+++ /dev/null
@@ -1,6 +0,0 @@
-// |jit-test| error: TypeError
-function f(o) {
-    o.watch("x", this);
-}
-var c = evalcx("");
-f(c);
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/bug690292.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-done = false;
-try {
-    function x() {}
-    print(this.watch("d", Object.create))
-    var d = {}
-} catch (e) {}
-try {
-  eval("d = ''")
-  done = true;
-} catch (e) {}
-assertEq(done, false);
--- a/js/src/jit-test/tests/basic/bug696748.js
+++ b/js/src/jit-test/tests/basic/bug696748.js
@@ -1,11 +1,8 @@
-try {
-this.watch("b", "".substring);
-} catch(exc1) {}
 eval("\
 var URI = '';\
 test();\
 function test() {\
   URI += '<zcti application=\"xxxx_demo\">';\
   URI += '<pstn_data>';\
   URI += '<dnis>877-485-xxxx</dnis>';\
   URI += '</pstn_data>';\
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/bug831846.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// |jit-test| error:TypeError
-
-evalcx('').watch("", /()/);
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testAssigningWatchedDeletedProperty.js
+++ /dev/null
@@ -1,7 +0,0 @@
-var o = {};
-o.watch("p", function() { });
-
-for (var i = 0; i < 10; i++) {
-    o.p = 123;
-    delete o.p;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testBug566556.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var msg = "";
-try {
-    this.__defineSetter__('x', Object.create);
-    this.watch('x', function() {});
-    x = 3;
-} catch (e) {
-    msg = e.toString();
-}
-assertEq(msg, "TypeError: undefined is not an object or null");
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testBug578044.js
+++ /dev/null
@@ -1,13 +0,0 @@
-this.watch("x", Object.create)
-try {
-  (function() {
-    this.__defineGetter__("x",
-    function() {
-      return this
-    })
-  })()
-} catch(e) {}
-Object.defineProperty(x, "x", ({
-  set: Uint16Array
-}))
-
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testBug584650.js
+++ /dev/null
@@ -1,9 +0,0 @@
-if (typeof gczeal != "function")
-    gczeal = function() {}
-
-// don't crash
-x = (evalcx('lazy'))
-x.watch("", function () {})
-gczeal(1)
-for (w in x) {}
-
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testBug780288-1.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// |jit-test| need-for-each
-
-s = newGlobal()
-try {
-  evalcx("\
-	Object.defineProperty(this,\"i\",{enumerable:true,get:function(){t}});\
-	for each(y in this)true\
-  ", s)
-} catch (e) {}
-try {
-  evalcx("\
-	for(z=0,(7).watch(\"\",eval);;g){\
-	  if(z=1){({t:function(){}})\
-	}\
-	", s)
-} catch (e) {}
-try {
-  evalcx("\
-	Object.defineProperty(this,\"g2\",{get:function(){return this}});\
-	g2.y()\
-  ", s)
-} catch (e) {}
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testBug780288-2.js
+++ /dev/null
@@ -1,22 +0,0 @@
-// |jit-test| need-for-each
-
-s = newGlobal()
-try {
-  evalcx("\
-	Object.defineProperty(this,\"i\",{enumerable:true,get:function(){t}});\
-	for each(y in this)true\
-  ", s)
-} catch (e) {}
-try {
-  evalcx("\
-	for(z=0,(7).watch(\"\",eval);;g){\
-	  if(z=1){({t:function(){}})\
-	}\
-	", s)
-} catch (e) {}
-try {
-  evalcx("\
-	Object.defineProperty(this,\"g2\",{get:function(){return this}});\
-	g2.y(\"\")\
-  ", s)
-} catch (e) {}
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testEvalCalledFromWatchOverSetter.js
+++ /dev/null
@@ -1,3 +0,0 @@
-this.__defineSetter__("x", function(){});
-this.watch("x", eval);
-x = 0;
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testNonStubGetter.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// |jit-test| need-for-each
-
-function testNonStubGetter() {
-    { let [] = []; (this.watch("x", function(p, o, n) { return /a/g.exec(p, o, n); })); };
-    (function () { (eval("(function(){for each (x in [1, 2, 2]);});"))(); })();
-    this.unwatch("x");
-    return "ok";
-}
-assertEq(testNonStubGetter(), "ok");
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testSettingWatchPointOnReadOnlyProp.js
+++ /dev/null
@@ -1,7 +0,0 @@
-for (var i = 0; i < 5; ++i) {
-    var o = {}
-    Object.defineProperty(o, 'x', { value:"cow", writable:false });
-    var r = o.watch('x', function() {});
-    assertEq(r, undefined);
-    o.x = 4;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testTrueShiftTrue.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Test no assert or crash from outer recorders (bug 465145)
-function testBug465145() {
-    this.__defineSetter__("x", function(){});
-    this.watch("x", function(){});
-    y = this;
-    for (var z = 0; z < 2; ++z) { x = y };
-    this.__defineSetter__("x", function(){});
-    for (var z = 0; z < 2; ++z) { x = y };
-}
-
-function testTrueShiftTrue() {
-    var a = new Array(5);
-    for (var i=0;i<5;++i) a[i] = "" + (true << true);
-    return a.join(",");
-}
-assertEq(testTrueShiftTrue(), "2,2,2,2,2");
deleted file mode 100644
--- a/js/src/jit-test/tests/basic/testWatchRecursion.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Test that the watch handler is not called recursively for the same object
-// and property.
-(function() {
-    var obj1 = {}, obj2 = {};
-    var handler_entry_count = 0;
-    var handler_exit_count = 0;
-
-    obj1.watch('x', handler);
-    obj1.watch('y', handler);
-    obj2.watch('x', handler);
-    obj1.x = 1;
-    assertEq(handler_entry_count, 3);
-    assertEq(handler_exit_count, 3);
-
-    function handler(id) {
-        handler_entry_count++;
-        assertEq(handler_exit_count, 0);
-        switch (true) {
-          case this === obj1 && id === "x":
-            assertEq(handler_entry_count, 1);
-            obj2.x = 3;
-            assertEq(handler_exit_count, 2);
-            break;
-          case this === obj2 && id === "x":
-            assertEq(handler_entry_count, 2);
-            obj1.y = 4;
-            assertEq(handler_exit_count, 1);
-            break;
-          default:
-            assertEq(this, obj1);
-            assertEq(id, "y");
-            assertEq(handler_entry_count, 3);
-
-            // We expect no more watch handler invocations
-            obj1.x = 5;
-            obj1.y = 6;
-            obj2.x = 7;
-            assertEq(handler_exit_count, 0);
-            break;
-        }
-        ++handler_exit_count;
-        assertEq(handler_entry_count, 3);
-    }
-})();
-
-
-// Test that run-away recursion in watch handlers is properly handled.  
-(function() {
-    var obj = {};
-    var i = 0;
-    try {
-        handler();
-        throw new Error("Unreachable");
-    } catch(e) {
-        assertEq(e instanceof InternalError, true);
-    }
-    
-    function handler() {
-        var prop = "a" + ++i;
-        obj.watch(prop, handler);
-        obj[prop] = 2;
-    }
-})();
deleted file mode 100644
--- a/js/src/jit-test/tests/cacheir/bug1350171.js
+++ /dev/null
@@ -1,8 +0,0 @@
-function test() {
-    var o = {};
-    o.watch('x', test);
-    try {
-        o.x = 3;
-    } catch(e) {}
-}
-test();
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-900405.js
+++ /dev/null
@@ -1,3 +0,0 @@
-(function() {
-    [{ "9": [] }.watch([], function(){})]
-})()
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-913261.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// |jit-test| error: InternalError: too much recursion
-(function f() {
-    "".watch(2, function() {});
-    f();
-})()
deleted file mode 100644
--- a/js/src/jit-test/tests/gc/bug-986864.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// |jit-test| slow
-function x() {}
-for (var j = 0; j < 9999; ++j) {
-    (function() {
-        x += x.watch("endsWith", ArrayBuffer);
-        return 0 >> Function(x)
-    })()
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug1063182.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// |jit-test| error: ReferenceError
-
-eval("(function() { " + "\
-var o = {};\
-o.watch('p', function() { });\
-for (var i = 0; i < 10; \u5ede ++)\
-    o.p = 123;\
-" + " })();");
--- a/js/src/jit-test/tests/ion/bug772901.js
+++ b/js/src/jit-test/tests/ion/bug772901.js
@@ -1,7 +1,7 @@
 // vim: set ts=8 sts=4 et sw=4 tw=99:
 
 function f(x) {
     delete ((x)++);
     arguments[0] !== undefined;
 }
-f(1, x = [f.ArrayBuffer,unwatch.Int32Array], this, this, this) ;
+f(1, x = [f.ArrayBuffer, undefined], this, this, this) ;
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug774257-1.js
+++ /dev/null
@@ -1,8 +0,0 @@
-Object.defineProperty(Object.prototype, 'x', { 
-    set: function() { evalcx('lazy'); } 
-});
-var obj = {};
-obj.watch("x", function (id, oldval, newval) {});
-for (var str in 'A') {
-    obj.x = 1;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug774257-2.js
+++ /dev/null
@@ -1,10 +0,0 @@
-Object.defineProperty(Object.prototype, 'x', { 
-    set: function() { evalcx('lazy'); } 
-});
-var obj = {};
-var prot = {};
-obj.__proto__ = prot;
-obj.watch("x", function (id, oldval, newval) {});
-for (var str in 'A') {
-    obj.x = 1;
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/ion/bug779631.js
+++ /dev/null
@@ -1,9 +0,0 @@
-var flag = 0;
-var a = {};
-Object.defineProperty(a, "value", {set: function(x) {}});
-a.watch("value", function(){flag++;});
-
-for(var i = 0; i < 100; i++) {
-    a.value = i;
-    assertEq(flag, i+1);
-}
--- a/js/src/jit-test/tests/ion/bug783590.js
+++ b/js/src/jit-test/tests/ion/bug783590.js
@@ -2,13 +2,12 @@
 
 var glob = this;
 var arr = [];
 Object.defineProperty(arr, 0, {
   get: (function() {
     glob.__proto__;
   })
 });
-this.watch("s", function() {});
 try {
   arr.pop();
 } catch (e) {}
 arr.pop();
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/bug550665.js
+++ /dev/null
@@ -1,8 +0,0 @@
-(function () {
-  var a;
-  eval("for(w in ((function(x,y){b:0})())) ;");
-})();
-
-this.__defineSetter__("l", function() { gc() });
-this.watch("l", function(x) { yield {} });
-l = true;
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/bug557063.js
+++ /dev/null
@@ -1,7 +0,0 @@
-(function() {
-  for (a = 0; a < 2; a++)
-    ''.watch("", function() {})
-})()
-
-/* Don't crash or assert. */
-
--- a/js/src/jit-test/tests/jaeger/bug588338.js
+++ b/js/src/jit-test/tests/jaeger/bug588338.js
@@ -4,13 +4,12 @@ function f() {
 }
 (x = new Proxy(Function, (function(x) {
   return {
     get: function(r, b) {
       return x[b]
     }
   }
 })(/x/)))
-for (z = 0; z < 100; x.unwatch(), z++)
 for (e in [0]) {
   gczeal(2)
 } ( [1,2,3])("")
 
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/bug625438.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// vim: set ts=8 sts=4 et sw=4 tw=99:
-
-var count = 0;
-this.watch("x", function() {
-    count++;
-});
-for(var i=0; i<10; i++) {
-    x = 2;
-}
-assertEq(count, 10);
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/bug630366.js
+++ /dev/null
@@ -1,7 +0,0 @@
-var o = {};
-for(var i=0; i<5; i++) {
-    o.p = 2;
-    o.watch("p", function() { });
-    o.p = 2;
-    delete o.p;
-}
--- a/js/src/jit-test/tests/jaeger/recompile/bug641225.js
+++ b/js/src/jit-test/tests/jaeger/recompile/bug641225.js
@@ -113,17 +113,16 @@ for(var o2 in f5) {
     Object.freeze(f0);
     f4(o3);
     o7.p0 = o3;
     f1(f5);
     f4(o10);
     f2(o5);
     f2(o5);
     f0(o3);
-    o9.watch('p3', function() {});
     o8[o8] = o8;
     f0(o5);
     f1(o6);
     f2 = Object.create(o5);
     var key = Object.getOwnPropertyNames(o11)[23]; if(key) f2 = o11[key];
     f5(o9);
     o12 = o6.bind(o12, o12, o12);
     f5(f4);
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/fuzz1.js
+++ /dev/null
@@ -1,4 +0,0 @@
-(function() {
-  for (a = 0; a < 2; a++)
-    ''.watch("", function() {})
-})()
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/fuzz3.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// |jit-test| need-for-each
-
-for each(let w in [[], 0, [], 0]) {
-  w.unwatch()
-}
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch1.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// assignments to watched objects must not be cached
-var obj = {x: 0};
-var hits = 0;
-obj.watch("x", function (id, oldval, newval) { hits++; return newval; });
-for (var i = 0; i < 10; i++)
-    obj.x = i;
-assertEq(hits, 10);
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch1a.js
+++ /dev/null
@@ -1,17 +0,0 @@
-// assignments to watched objects must not be traced
-var hits = 0;
-function counter(id, oldval, newval) {
-    hits++;
-    return newval;
-}
-
-(function () {
-    var obj = {x: 0, y: 0};
-    var a = ['x', 'y'];
-    obj.watch('z', counter);
-    for (var i = 0; i < 14; i++) {
-        obj.watch(a[+(i > 8)], counter);
-        obj.y = i;
-    }
-})();
-assertEq(hits, 5);
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch2.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// assignments to watched properties via ++ must not be cached
-var obj = {x: 0};
-var hits = 0;
-obj.watch("x", function (id, oldval, newval) { hits++; return newval; });
-for (var i = 0; i < 10; i++)
-    obj.x++;
-assertEq(hits, 10);
-
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch2a.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// assignments to watched properties via ++ must not be traced
-var hits = 0;
-function counter(id, oldval, newval) {
-    hits++;
-    return newval;
-}
-
-(function () {
-    var obj = {x: 0, y: 0};
-    var a = ['x', 'y'];
-    obj.watch('z', counter);
-    for (var i = 0; i < 14; i++) {
-        obj.watch(a[+(i > 8)], counter);
-        obj.y++;
-    }
-})();
-assertEq(hits, 5);
-
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch3.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// assignment to watched global properties must not be cached
-x = 0;
-var hits = 0;
-this.watch("x", function (id, oldval, newval) { hits++; return newval; });
-for (var i = 0; i < 10; i++)
-    x = i;
-assertEq(hits, 10);
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch3a.js
+++ /dev/null
@@ -1,19 +0,0 @@
-// assignment to watched global properties must not be traced
-var hits = 0;
-function counter(id, oldval, newval) {
-    hits++;
-    return newval;
-}
-
-var x = 0;
-var y = 0;
-(function () {
-    var a = ['x', 'y'];
-    this.watch('z', counter);
-    for (var i = 0; i < 14; i++) {
-        this.watch(a[+(i > 8)], counter);
-        y = 1;
-    }
-})();
-assertEq(hits, 5);
-
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch3b.js
+++ /dev/null
@@ -1,20 +0,0 @@
-// assignment to watched global properties must not be traced
-var hits = 0;
-function counter(id, oldval, newval) {
-    hits++;
-    return newval;
-}
-
-var x = 0;
-var y = 0;
-function f() {
-    var a = [{}, this];
-    for (var i = 0; i < 14; i++) {
-        print(shapeOf(this));
-        Object.prototype.watch.call(a[+(i > 8)], "y", counter);
-        y++;
-    }
-}
-f();
-assertEq(hits, 5);
-
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch4.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// adding assignment + watchpoint vs. caching
-var hits = 0;
-var obj = {};
-obj.watch("x", function (id, oldval, newval) { hits++; return newval; });
-for (var i = 0; i < 10; i++) {
-    obj.x = 1;
-    delete obj.x;
-}
-assertEq(hits, 10);
deleted file mode 100644
--- a/js/src/jit-test/tests/pic/watch5.js
+++ /dev/null
@@ -1,27 +0,0 @@
-// test against future pic support for symbols
-
-// assignments to watched objects must not be cached
-var obj = {};
-var x = Symbol.for("x");
-obj[x] = 0;
-var hits = 0;
-obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
-for (var i = 0; i < 10; i++)
-    obj[x] = i;
-assertEq(hits, 10);
-
-// assignments to watched properties via ++ must not be cached
-hits = 0;
-for (var i = 0; i < 10; i++)
-    obj[x]++;
-assertEq(hits, 10);
-
-// adding assignment + watchpoint vs. caching
-hits = 0;
-obj = {};
-obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
-for (var i = 0; i < 10; i++) {
-    obj[x] = 1;
-    delete obj[x];
-}
-assertEq(hits, 10);
deleted file mode 100644
--- a/js/src/jit-test/tests/profiler/bug1140643.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// |jit-test| allow-oom; allow-unhandlable-oom
-enableGeckoProfiling();
-loadFile('\
-for (var i = 0; i < 2; i++) {\
-    obj = { m: function () {} };\
-    obj.watch("m", function () { float32 = 0 + obj.foo; });\
-    obj.m = 0;\
-}\
-');
-gcparam("maxBytes", gcparam("gcBytes") + (1)*1024);
-newGlobal("same-compartment");
-function loadFile(lfVarx) {
-  evaluate(lfVarx, { noScriptRval : true, isRunOnce : true }); 
-}
--- a/js/src/jit-test/tests/wasm/binary.js
+++ b/js/src/jit-test/tests/wasm/binary.js
@@ -285,17 +285,17 @@ wasmEval(moduleWithSections([v2vSigSecti
 wasmEval(moduleWithSections([sigSection([i2vSig])]));
 wasmEval(moduleWithSections([sigSection([v2vSig, i2vSig])]));
 
 assertErrorMessage(() => wasmEval(moduleWithSections([sigSection([{args:[], ret:100}])])), CompileError, /bad type/);
 assertErrorMessage(() => wasmEval(moduleWithSections([sigSection([{args:[100], ret:VoidCode}])])), CompileError, /bad type/);
 
 assertThrowsInstanceOf(() => wasmEval(moduleWithSections([sigSection([]), declSection([0])])), CompileError, /signature index out of range/);
 assertThrowsInstanceOf(() => wasmEval(moduleWithSections([v2vSigSection, declSection([1])])), CompileError, /signature index out of range/);
-assertErrorMessage(() => wasmEval(moduleWithSections([v2vSigSection, declSection([0])])), CompileError, /expected function bodies/);
+assertErrorMessage(() => wasmEval(moduleWithSections([v2vSigSection, declSection([0])])), CompileError, /expected code section/);
 wasmEval(moduleWithSections([v2vSigSection, declSection([0]), bodySection([v2vBody])]));
 
 assertErrorMessage(() => wasmEval(moduleWithSections([v2vSigSection, declSection([0]), bodySection([v2vBody.concat(v2vBody)])])), CompileError, /byte size mismatch in code section/);
 
 assertThrowsInstanceOf(() => wasmEval(moduleWithSections([v2vSigSection, {name: importId, body:[]}])), CompileError);
 assertErrorMessage(() => wasmEval(moduleWithSections([importSection([{sigIndex:0, module:"a", func:"b"}])])), CompileError, /signature index out of range/);
 assertErrorMessage(() => wasmEval(moduleWithSections([v2vSigSection, importSection([{sigIndex:1, module:"a", func:"b"}])])), CompileError, /signature index out of range/);
 wasmEval(moduleWithSections([v2vSigSection, importSection([])]));
--- a/js/src/jit-test/tests/wasm/streaming.js
+++ b/js/src/jit-test/tests/wasm/streaming.js
@@ -1,8 +1,15 @@
+try {
+    WebAssembly.compileStreaming();
+} catch (err) {
+    assertEq(String(err).indexOf("not supported with --no-threads") !== -1, true);
+    quit();
+}
+
 function testInstantiate(source, importObj, exportName, expectedValue) {
     var result;
     WebAssembly.instantiateStreaming(code, importObj).then(r => { result = r });
     drainJobQueue();
     assertEq(result !== undefined, true);
     assertEq(result.module instanceof WebAssembly.Module, true);
     assertEq(result.instance instanceof WebAssembly.Instance, true);
     assertEq(result.instance.exports[exportName](), expectedValue);
@@ -75,8 +82,15 @@ var arr = [];
 for (var i = 0; i < 10; i++)
     arr.push(WebAssembly.instantiateStreaming(code));
 var results;
 Promise.all(arr).then(r => results = r);
 drainJobQueue();
 assertEq(results.length === 10, true);
 for (var i = 0; i < 10; i++)
     assertEq(results[i].instance.exports.run(), 5050);
+
+// No code section, but data section:
+var code = wasmTextToBinary('(module (memory (import "js" "mem") 1) (data (i32.const 0) "a"))');
+var mem = new WebAssembly.Memory({initial:1});
+WebAssembly.instantiateStreaming(code, {js:{mem}});
+drainJobQueue();
+assertEq(new Uint8Array(mem.buffer)[0], 97);
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -2809,18 +2809,16 @@ SetPropIRGenerator::tryAttachStub()
     bool nameOrSymbol;
     if (!ValueToNameOrSymbolId(cx_, idVal_, &id, &nameOrSymbol)) {
         cx_->clearPendingException();
         return false;
     }
 
     if (lhsVal_.isObject()) {
         RootedObject obj(cx_, &lhsVal_.toObject());
-        if (obj->watched())
-            return false;
 
         ObjOperandId objId = writer.guardIsObject(objValId);
         if (IsPropertySetOp(JSOp(*pc_))) {
             if (tryAttachMegamorphicSetElement(obj, objId, rhsValId))
                 return true;
         }
         if (nameOrSymbol) {
             if (tryAttachNativeSetSlot(obj, objId, id, rhsValId))
@@ -3766,18 +3764,16 @@ SetPropIRGenerator::tryAttachAddSlotStub
         cx_->clearPendingException();
         return false;
     }
 
     if (!lhsVal_.isObject() || !nameOrSymbol)
         return false;
 
     RootedObject obj(cx_, &lhsVal_.toObject());
-    if (obj->watched())
-        return false;
 
     PropertyResult prop;
     JSObject* holder;
     if (!LookupPropertyPure(cx_, obj, id, &holder, &prop))
         return false;
     if (obj != holder)
         return false;
 
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -1704,18 +1704,17 @@ SetNativeDataProperty(JSContext* cx, JSO
 
     if (MOZ_UNLIKELY(!obj->isNative()))
         return false;
 
     NativeObject* nobj = &obj->as<NativeObject>();
     Shape* shape = nobj->lastProperty()->search(cx, NameToId(name));
     if (!shape ||
         !shape->isDataProperty() ||
-        !shape->writable() ||
-        nobj->watched())
+        !shape->writable())
     {
         return false;
     }
 
     if (NeedsTypeBarrier && !HasTypePropertyId(nobj, NameToId(name), *val))
         return false;
 
     nobj->setSlot(shape->slot(), *val);
--- a/js/src/jit/none/Trampoline-none.cpp
+++ b/js/src/jit/none/Trampoline-none.cpp
@@ -11,17 +11,17 @@
 
 using namespace js;
 using namespace js::jit;
 
 // This file includes stubs for generating the JIT trampolines when there is no
 // JIT backend, and also includes implementations for assorted random things
 // which can't be implemented in headers.
 
-JitCode* JitRuntime::generateEnterJIT(JSContext*, EnterJitType) { MOZ_CRASH(); }
+JitCode* JitRuntime::generateEnterJIT(JSContext*) { MOZ_CRASH(); }
 JitCode* JitRuntime::generateInvalidator(JSContext*) { MOZ_CRASH(); }
 JitCode* JitRuntime::generateArgumentsRectifier(JSContext*, void**) { MOZ_CRASH(); }
 JitCode* JitRuntime::generateBailoutTable(JSContext*, uint32_t) { MOZ_CRASH(); }
 JitCode* JitRuntime::generateBailoutHandler(JSContext*) { MOZ_CRASH(); }
 JitCode* JitRuntime::generateVMWrapper(JSContext*, const VMFunction&) { MOZ_CRASH(); }
 JitCode* JitRuntime::generatePreBarrier(JSContext*, MIRType) { MOZ_CRASH(); }
 JitCode* JitRuntime::generateDebugTrapHandler(JSContext*) { MOZ_CRASH(); }
 JitCode* JitRuntime::generateExceptionTailStub(JSContext*, void*) { MOZ_CRASH(); }
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -40,17 +40,16 @@
  */
 
 MSG_DEF(JSMSG_NOT_AN_ERROR,            0, JSEXN_ERR, "<Error #0 is reserved>")
 MSG_DEF(JSMSG_NOT_DEFINED,             1, JSEXN_REFERENCEERR, "{0} is not defined")
 MSG_DEF(JSMSG_MORE_ARGS_NEEDED,        3, JSEXN_TYPEERR, "{0} requires more than {1} argument{2}")
 MSG_DEF(JSMSG_INCOMPATIBLE_PROTO,      3, JSEXN_TYPEERR, "{0}.prototype.{1} called on incompatible {2}")
 MSG_DEF(JSMSG_NO_CONSTRUCTOR,          1, JSEXN_TYPEERR, "{0} has no constructor")
 MSG_DEF(JSMSG_BAD_SORT_ARG,            0, JSEXN_TYPEERR, "invalid Array.prototype.sort argument")
-MSG_DEF(JSMSG_CANT_WATCH,              1, JSEXN_TYPEERR, "can't watch non-native objects of class {0}")
 MSG_DEF(JSMSG_READ_ONLY,               1, JSEXN_TYPEERR, "{0} is read-only")
 MSG_DEF(JSMSG_CANT_DELETE,             1, JSEXN_TYPEERR, "property {0} is non-configurable and can't be deleted")
 MSG_DEF(JSMSG_CANT_TRUNCATE_ARRAY,     0, JSEXN_TYPEERR, "can't delete non-configurable array element")
 MSG_DEF(JSMSG_NOT_FUNCTION,            1, JSEXN_TYPEERR, "{0} is not a function")
 MSG_DEF(JSMSG_NOT_CONSTRUCTOR,         1, JSEXN_TYPEERR, "{0} is not a constructor")
 MSG_DEF(JSMSG_CANT_CONVERT_TO,         2, JSEXN_TYPEERR, "can't convert {0} to {1}")
 MSG_DEF(JSMSG_TOPRIMITIVE_NOT_CALLABLE, 2, JSEXN_TYPEERR, "can't convert {0} to {1}: its [Symbol.toPrimitive] property is not a function")
 MSG_DEF(JSMSG_TOPRIMITIVE_RETURNED_OBJECT, 2, JSEXN_TYPEERR, "can't convert {0} to {1}: its [Symbol.toPrimitive] method returned an object")
@@ -65,17 +64,16 @@ MSG_DEF(JSMSG_REDECLARED_PREV,         2
 MSG_DEF(JSMSG_REDECLARED_VAR,          2, JSEXN_SYNTAXERR, "redeclaration of {0} {1}")
 MSG_DEF(JSMSG_UNDECLARED_VAR,          1, JSEXN_REFERENCEERR, "assignment to undeclared variable {0}")
 MSG_DEF(JSMSG_GETTER_ONLY,             1, JSEXN_TYPEERR, "setting getter-only property {0}")
 MSG_DEF(JSMSG_OVERWRITING_ACCESSOR,    1, JSEXN_TYPEERR, "can't overwrite accessor property {0}")
 MSG_DEF(JSMSG_UNDEFINED_PROP,          1, JSEXN_REFERENCEERR, "reference to undefined property {0}")
 MSG_DEF(JSMSG_INVALID_MAP_ITERABLE,    1, JSEXN_TYPEERR, "iterable for {0} should have array-like objects")
 MSG_DEF(JSMSG_NESTING_GENERATOR,       0, JSEXN_TYPEERR, "already executing generator")
 MSG_DEF(JSMSG_INCOMPATIBLE_METHOD,     3, JSEXN_TYPEERR, "{0} {1} called on incompatible {2}")
-MSG_DEF(JSMSG_OBJECT_WATCH_DEPRECATED, 0, JSEXN_WARN, "Object.prototype.watch and unwatch are very slow, non-standard, and deprecated; use a getter/setter instead")
 MSG_DEF(JSMSG_BAD_SURROGATE_CHAR,      1, JSEXN_TYPEERR, "bad surrogate character {0}")
 MSG_DEF(JSMSG_UTF8_CHAR_TOO_LARGE,     1, JSEXN_TYPEERR, "UTF-8 character {0} too large")
 MSG_DEF(JSMSG_MALFORMED_UTF8_CHAR,     1, JSEXN_TYPEERR, "malformed UTF-8 character sequence at offset {0}")
 MSG_DEF(JSMSG_BUILTIN_CTOR_NO_NEW,     1, JSEXN_TYPEERR, "calling a builtin {0} constructor without new is forbidden")
 MSG_DEF(JSMSG_BAD_GENERATOR_YIELD,     1, JSEXN_TYPEERR, "yield from closing generator {0}")
 MSG_DEF(JSMSG_EMPTY_ARRAY_REDUCE,      0, JSEXN_TYPEERR, "reduce of empty array with no initial value")
 MSG_DEF(JSMSG_UNEXPECTED_TYPE,         2, JSEXN_TYPEERR, "{0} is {1}")
 MSG_DEF(JSMSG_MISSING_FUN_ARG,         2, JSEXN_TYPEERR, "missing argument {0} when calling function {1}")
--- a/js/src/jsapi-tests/testGCGrayMarking.cpp
+++ b/js/src/jsapi-tests/testGCGrayMarking.cpp
@@ -50,17 +50,16 @@ BEGIN_TEST(testGCGrayMarking)
     JSAutoCompartment ac(cx, global1);
 
     InitGrayRootTracer();
 
     bool ok =
         TestMarking() &&
         TestWeakMaps() &&
         TestUnassociatedWeakMaps() &&
-        TestWatchpoints() &&
         TestCCWs() &&
         TestGrayUnmarking();
 
     global1 = nullptr;
     global2 = nullptr;
     RemoveGrayRootTracer();
 
     return ok;
@@ -427,73 +426,16 @@ TestUnassociatedWeakMaps()
     blackRoot = nullptr;
     grayRoots.grayRoot1 = nullptr;
     grayRoots.grayRoot2 = nullptr;
 
     return true;
 }
 
 bool
-TestWatchpoints()
-{
-    JSObject* watched = AllocPlainObject();
-    CHECK(watched);
-
-    JSObject* closure = AllocPlainObject();
-    CHECK(closure);
-
-    {
-        RootedObject obj(cx, watched);
-        RootedObject callable(cx, closure);
-        RootedId id(cx, INT_TO_JSID(0));
-        CHECK(JS_DefinePropertyById(cx, obj, id, JS::TrueHandleValue, 0));
-        CHECK(js::WatchGuts(cx, obj, id, callable));
-    }
-
-    // Test that a watchpoint marks the callable black if the watched object is
-    // black.
-
-    RootedObject blackRoot(cx, watched);
-    grayRoots.grayRoot1 = nullptr;
-    JS_GC(cx);
-    CHECK(IsMarkedBlack(watched));
-    CHECK(IsMarkedBlack(closure));
-
-    // Test that a watchpoint marks the callable gray if the watched object is
-    // gray.
-
-    blackRoot = nullptr;
-    grayRoots.grayRoot1 = watched;
-    JS_GC(cx);
-    CHECK(IsMarkedGray(watched));
-    CHECK(IsMarkedGray(closure));
-
-    // Test that ExposeToActiveJS *doesn't* unmark through watchpoints.  We
-    // could make this work, but it's currently handled by the CC fixup.
-
-    CHECK(IsMarkedGray(watched));
-    CHECK(IsMarkedGray(closure));
-    JS::ExposeObjectToActiveJS(watched);
-    CHECK(IsMarkedBlack(watched));
-    CHECK(IsMarkedGray(closure));
-
-    {
-        RootedObject obj(cx, watched);
-        RootedId id(cx, INT_TO_JSID(0));
-        CHECK(js::UnwatchGuts(cx, obj, id));
-    }
-
-    blackRoot = nullptr;
-    grayRoots.grayRoot1 = nullptr;
-    grayRoots.grayRoot2 = nullptr;
-
-    return true;
-}
-
-bool
 TestCCWs()
 {
     JSObject* target = AllocPlainObject();
     CHECK(target);
 
     // Test getting a new wrapper doesn't return a gray wrapper.
 
     RootedObject blackRoot(cx, target);
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -34,17 +34,16 @@
 #include "jsnum.h"
 #include "jsobj.h"
 #include "json.h"
 #include "jsprf.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jstypes.h"
 #include "jsutil.h"
-#include "jswatchpoint.h"
 #include "jsweakmap.h"
 #include "jswrapper.h"
 
 #include "builtin/AtomicsObject.h"
 #include "builtin/Eval.h"
 #include "builtin/Intl.h"
 #include "builtin/MapObject.h"
 #include "builtin/Promise.h"
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -38,17 +38,16 @@
 #include "jsnativestack.h"
 #include "jsobj.h"
 #include "jsopcode.h"
 #include "jsprf.h"
 #include "jspubtd.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jstypes.h"
-#include "jswatchpoint.h"
 #include "jswin.h"
 
 #include "gc/Marking.h"
 #include "jit/Ion.h"
 #include "jit/PcScriptCache.h"
 #include "js/CharacterEncoding.h"
 #include "vm/ErrorReporting.h"
 #include "vm/HelperThreads.h"
--- a/js/src/jscompartment.cpp
+++ b/js/src/jscompartment.cpp
@@ -10,17 +10,16 @@
 #include "mozilla/MemoryReporting.h"
 
 #include <stddef.h>
 
 #include "jscntxt.h"
 #include "jsfriendapi.h"
 #include "jsgc.h"
 #include "jsiter.h"
-#include "jswatchpoint.h"
 #include "jswrapper.h"
 
 #include "gc/Marking.h"
 #include "gc/Policy.h"
 #include "jit/JitCompartment.h"
 #include "jit/JitOptions.h"
 #include "js/Date.h"
 #include "js/Proxy.h"
@@ -55,17 +54,16 @@ JSCompartment::JSCompartment(Zone* zone,
     isSystem_(false),
     isAtomsCompartment_(false),
     isSelfHosting(false),
     marked(true),
     warnedAboutDateToLocaleFormat(false),
     warnedAboutExprClosure(false),
     warnedAboutForEach(false),
     warnedAboutLegacyGenerator(false),
-    warnedAboutObjectWatch(false),
     warnedAboutStringGenericsMethods(0),
 #ifdef DEBUG
     firedOnNewGlobalObject(false),
 #endif
     global_(nullptr),
     enterCompartmentDepth(0),
     globalHolds(0),
     performanceMonitoring(runtime_),
@@ -82,17 +80,16 @@ JSCompartment::JSCompartment(Zone* zone,
     innerViews(zone),
     lazyArrayBuffers(nullptr),
     wasm(zone),
     nonSyntacticLexicalEnvironments_(nullptr),
     gcIncomingGrayPointers(nullptr),
     debugModeBits(0),
     validAccessPtr(nullptr),
     randomKeyGenerator_(runtime_->forkRandomKeyGenerator()),
-    watchpointMap(nullptr),
     scriptCountsMap(nullptr),
     scriptNameMap(nullptr),
     debugScriptMap(nullptr),
     debugEnvs(nullptr),
     enumerators(nullptr),
     compartmentStats_(nullptr),
     scheduledForDestruction(false),
     maybeAlive(true),
@@ -113,17 +110,16 @@ JSCompartment::~JSCompartment()
     reportTelemetry();
 
     // Write the code coverage information in a file.
     JSRuntime* rt = runtimeFromActiveCooperatingThread();
     if (rt->lcovOutput().isEnabled())
         rt->lcovOutput().writeLCovResult(lcovOutput);
 
     js_delete(jitCompartment_);
-    js_delete(watchpointMap);
     js_delete(scriptCountsMap);
     js_delete(scriptNameMap);
     js_delete(debugScriptMap);
     js_delete(debugEnvs);
     js_delete(objectMetadataTable);
     js_delete(lazyArrayBuffers);
     js_delete(nonSyntacticLexicalEnvironments_);
     js_free(enumerators);
@@ -772,22 +768,16 @@ JSCompartment::traceRoots(JSTracer* trc,
             TraceRoot(trc, global_.unsafeUnbarrieredForTracing(), "on-stack compartment global");
     }
 
     // Nothing below here needs to be treated as a root if we aren't marking
     // this zone for a collection.
     if (traceOrMark == js::gc::GCRuntime::MarkRuntime && !zone()->isCollectingFromAnyThread())
         return;
 
-    // During a GC, these are treated as weak pointers.
-    if (traceOrMark == js::gc::GCRuntime::TraceRuntime) {
-        if (watchpointMap)
-            watchpointMap->trace(trc);
-    }
-
     /* Mark debug scopes, if present */
     if (debugEnvs)
         debugEnvs->trace(trc);
 
     if (lazyArrayBuffers)
         lazyArrayBuffers->trace(trc);
 
     if (objectMetadataTable)
@@ -820,19 +810,16 @@ JSCompartment::traceRoots(JSTracer* trc,
 
     if (nonSyntacticLexicalEnvironments_)
         nonSyntacticLexicalEnvironments_->trace(trc);
 }
 
 void
 JSCompartment::finishRoots()
 {
-    if (watchpointMap)
-        watchpointMap->clear();
-
     if (debugEnvs)
         debugEnvs->finish();
 
     if (lazyArrayBuffers)
         lazyArrayBuffers->clear();
 
     if (objectMetadataTable)
         objectMetadataTable->clear();
@@ -940,23 +927,16 @@ JSCompartment::sweepCrossCompartmentWrap
 
 void
 JSCompartment::sweepVarNames()
 {
     varNames_.sweep();
 }
 
 void
-JSCompartment::sweepWatchpoints()
-{
-    if (watchpointMap)
-        watchpointMap->sweep();
-}
-
-void
 JSCompartment::sweepMapAndSetObjectsAfterMinorGC()
 {
     auto fop = runtime_->defaultFreeOp();
 
     for (auto mapobj : mapsWithNurseryMemory)
         MapObject::sweepAfterMinorGC(fop, mapobj);
     mapsWithNurseryMemory.clearAndFree();
 
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -541,17 +541,16 @@ struct IteratorHashPolicy
     static bool match(PropertyIteratorObject* obj, const Lookup& lookup);
 };
 
 } /* namespace js */
 
 namespace js {
 class DebugEnvironments;
 class ObjectWeakMap;
-class WatchpointMap;
 class WeakMapBase;
 } // namespace js
 
 struct JSCompartment
 {
     const JS::CompartmentCreationOptions creationOptions_;
     JS::CompartmentBehaviors behaviors_;
 
@@ -622,17 +621,16 @@ struct JSCompartment
 
   public:
     bool                         isSelfHosting;
     bool                         marked;
     bool                         warnedAboutDateToLocaleFormat : 1;
     bool                         warnedAboutExprClosure : 1;
     bool                         warnedAboutForEach : 1;
     bool                         warnedAboutLegacyGenerator : 1;
-    bool                         warnedAboutObjectWatch : 1;
     uint32_t                     warnedAboutStringGenericsMethods;
 
 #ifdef DEBUG
     bool                         firedOnNewGlobalObject;
 #endif
 
     void mark() { marked = true; }
 
@@ -963,17 +961,16 @@ struct JSCompartment
     void sweepGlobalObject();
     void sweepSelfHostingScriptSource();
     void sweepJitCompartment(js::FreeOp* fop);
     void sweepRegExps();
     void sweepDebugEnvironments();
     void sweepNativeIterators();
     void sweepTemplateObjects();
     void sweepVarNames();
-    void sweepWatchpoints();
 
     void purge();
     void clearTables();
 
     static void fixupCrossCompartmentWrappersAfterMovingGC(JSTracer* trc);
     void fixupAfterMovingGC();
     void fixupGlobal();
     void fixupScriptMapsAfterMovingGC();
@@ -1152,18 +1149,16 @@ struct JSCompartment
     bool ensureDelazifyScriptsForDebugger(JSContext* cx);
 
     void clearBreakpointsIn(js::FreeOp* fop, js::Debugger* dbg, JS::HandleObject handler);
 
   private:
     void sweepBreakpoints(js::FreeOp* fop);
 
   public:
-    js::WatchpointMap* watchpointMap;
-
     js::ScriptCountsMap* scriptCountsMap;
     js::ScriptNameMap* scriptNameMap;
 
     js::DebugScriptMap* debugScriptMap;
 
     /* Bookkeeping information for debug scope objects. */
     js::DebugEnvironments* debugEnvs;
 
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -10,17 +10,16 @@
 
 #include <stdint.h>
 
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsgc.h"
 #include "jsobj.h"
 #include "jsprf.h"
-#include "jswatchpoint.h"
 #include "jsweakmap.h"
 #include "jswrapper.h"
 
 #include "builtin/Promise.h"
 #include "builtin/TestingFunctions.h"
 #include "gc/GCInternals.h"
 #include "js/Proxy.h"
 #include "proxy/DeadObjectProxy.h"
@@ -569,17 +568,16 @@ JS_IsScriptSourceObject(JSObject* obj)
 {
     return obj->is<ScriptSourceObject>();
 }
 
 void
 js::TraceWeakMaps(WeakMapTracer* trc)
 {
     WeakMapBase::traceAllMappings(trc);
-    WatchpointMap::traceAll(trc);
 }
 
 extern JS_FRIEND_API(bool)
 js::AreGCGrayBitsValid(JSRuntime* rt)
 {
     return rt->gc.areGrayBitsValid();
 }
 
--- a/js/src/jsfriendapi.h
+++ b/js/src/jsfriendapi.h
@@ -2257,46 +2257,21 @@ JS_GetDataViewByteLength(JSObject* obj);
  *
  * |*isSharedMemory| will be set to true if the DataView maps a SharedArrayBuffer,
  * otherwise to false.
  */
 JS_FRIEND_API(void*)
 JS_GetDataViewData(JSObject* obj, bool* isSharedMemory, const JS::AutoRequireNoGC&);
 
 namespace js {
-
-/**
- * Add a watchpoint -- in the Object.prototype.watch sense -- to |obj| for the
- * property |id|, using the callable object |callable| as the function to be
- * called for notifications.
- *
- * This is an internal function exposed -- temporarily -- only so that DOM
- * proxies can be watchable.  Don't use it!  We'll soon kill off the
- * Object.prototype.{,un}watch functions, at which point this will go too.
- */
-extern JS_FRIEND_API(bool)
-WatchGuts(JSContext* cx, JS::HandleObject obj, JS::HandleId id, JS::HandleObject callable);
-
-/**
- * Remove a watchpoint -- in the Object.prototype.watch sense -- from |obj| for
- * the property |id|.
- *
- * This is an internal function exposed -- temporarily -- only so that DOM
- * proxies can be watchable.  Don't use it!  We'll soon kill off the
- * Object.prototype.{,un}watch functions, at which point this will go too.
- */
-extern JS_FRIEND_API(bool)
-UnwatchGuts(JSContext* cx, JS::HandleObject obj, JS::HandleId id);
-
 namespace jit {
 
 enum class InlinableNative : uint16_t;
 
 } // namespace jit
-
 } // namespace js
 
 /**
  * A class, expected to be passed by value, which represents the CallArgs for a
  * JSJitGetterOp.
  */
 class JSJitGetterCallArgs : protected JS::MutableHandleValue
 {
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -210,17 +210,16 @@
 #include "jscntxt.h"
 #include "jscompartment.h"
 #include "jsfriendapi.h"
 #include "jsobj.h"
 #include "jsprf.h"
 #include "jsscript.h"
 #include "jstypes.h"
 #include "jsutil.h"
-#include "jswatchpoint.h"
 #include "jsweakmap.h"
 #ifdef XP_WIN
 # include "jswin.h"
 #endif
 
 #include "gc/FindSCCs.h"
 #include "gc/GCInternals.h"
 #include "gc/GCTrace.h"
@@ -2728,20 +2727,16 @@ GCRuntime::updateZonePointersToRelocated
     // as much as possible.
     updateAllCellPointers(&trc, zone);
 
     // Mark roots to update them.
     {
         gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::MARK_ROOTS);
 
         WeakMapBase::traceZone(zone, &trc);
-        for (CompartmentsInZoneIter c(zone); !c.done(); c.next()) {
-            if (c->watchpointMap)
-                c->watchpointMap->trace(&trc);
-        }
     }
 
     // Sweep everything to fix up weak pointers.
     rt->gc.sweepZoneAfterCompacting(zone);
 
     // Call callbacks to get the rest of the system to fixup other untraced pointers.
     for (CompartmentsInZoneIter comp(zone); !comp.done(); comp.next())
         callWeakPointerCompartmentCallbacks(comp);
@@ -2772,17 +2767,16 @@ GCRuntime::updateRuntimePointersToReloca
 
         // Mark all gray roots, making sure we call the trace callback to get the
         // current set.
         if (JSTraceDataOp op = grayRootTracer.op)
             (*op)(&trc, grayRootTracer.data);
     }
 
     // Sweep everything to fix up weak pointers.
-    WatchpointMap::sweepAll(rt);
     Debugger::sweepAll(rt->defaultFreeOp());
     jit::JitRuntime::SweepJitcodeGlobalTable(rt);
     for (JS::detail::WeakCacheBase* cache : rt->weakCaches())
         cache->sweep();
 
     // Type inference may put more blocks here to free.
     blocksToFreeAfterSweeping.ref().freeAll();
 
@@ -4340,17 +4334,17 @@ GCRuntime::markCompartments()
 void
 GCRuntime::updateMallocCountersOnGC()
 {
     AutoLockGC lock(rt);
 
     // Update the malloc counters for any zones we are collecting.
     for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
         if (zone->isCollecting())
-            zone->updateGCMallocBytesOnGC(lock);
+            zone->updateAllMallocBytesOnGC(lock);
     }
 
     // Update the runtime malloc counter only if we are doing a full GC.
     if (isFull)
         mallocCounter.updateOnGC(lock);
 }
 
 template <class ZoneIterT>
@@ -4368,20 +4362,16 @@ GCRuntime::markWeakReferences(gcstats::P
     MOZ_RELEASE_ASSERT(marker.drainMarkStack(unlimited));
 
     for (;;) {
         bool markedAny = false;
         if (!marker.isWeakMarkingTracer()) {
             for (ZoneIterT zone(rt); !zone.done(); zone.next())
                 markedAny |= WeakMapBase::markZoneIteratively(zone, &marker);
         }
-        for (CompartmentsIterT<ZoneIterT> c(rt); !c.done(); c.next()) {
-            if (c->watchpointMap)
-                markedAny |= c->watchpointMap->markIteratively(&marker);
-        }
         markedAny |= Debugger::markIteratively(&marker);
         markedAny |= jit::JitRuntime::MarkJitcodeGlobalTableIteratively(&marker);
 
         if (!markedAny)
             break;
 
         auto unlimited = SliceBudget::unlimited();
         MOZ_RELEASE_ASSERT(marker.drainMarkStack(unlimited));
@@ -5278,17 +5268,16 @@ SweepMisc(JSRuntime* runtime)
 {
     for (SweepGroupCompartmentsIter c(runtime); !c.done(); c.next()) {
         c->sweepGlobalObject();
         c->sweepTemplateObjects();
         c->sweepSavedStacks();
         c->sweepTemplateLiteralMap();
         c->sweepSelfHostingScriptSource();
         c->sweepNativeIterators();
-        c->sweepWatchpoints();
     }
 }
 
 static void
 SweepCompressionTasks(JSRuntime* runtime)
 {
     AutoLockHelperThreadState lock;
 
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -28,17 +28,16 @@
 #include "jsiter.h"
 #include "jsnum.h"
 #include "jsopcode.h"
 #include "jsprf.h"
 #include "jsscript.h"
 #include "jsstr.h"
 #include "jstypes.h"
 #include "jsutil.h"
-#include "jswatchpoint.h"
 #include "jswin.h"
 #include "jswrapper.h"
 
 #include "builtin/Eval.h"
 #include "builtin/Object.h"
 #include "builtin/SymbolObject.h"
 #include "frontend/BytecodeCompiler.h"
 #include "gc/Marking.h"
@@ -1078,23 +1077,17 @@ js::CreateThisForFunction(JSContext* cx,
 
     return obj;
 }
 
 /* static */ bool
 JSObject::nonNativeSetProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
                                HandleValue receiver, ObjectOpResult& result)
 {
-    RootedValue value(cx, v);
-    if (MOZ_UNLIKELY(obj->watched())) {
-        WatchpointMap* wpmap = cx->compartment()->watchpointMap;
-        if (wpmap && !wpmap->triggerWatchpoint(cx, obj, id, &value))
-            return false;
-    }
-    return obj->getOpsSetProperty()(cx, obj, id, value, receiver, result);
+    return obj->getOpsSetProperty()(cx, obj, id, v, receiver, result);
 }
 
 /* static */ bool
 JSObject::nonNativeSetElement(JSContext* cx, HandleObject obj, uint32_t index, HandleValue v,
                               HandleValue receiver, ObjectOpResult& result)
 {
     RootedId id(cx);
     if (!IndexToId(cx, index, &id))
@@ -2991,78 +2984,16 @@ js::GetPropertyDescriptor(JSContext* cx,
         if (!GetPrototype(cx, pobj, &pobj))
             return false;
     }
 
     MOZ_ASSERT(!desc.object());
     return true;
 }
 
-bool
-js::WatchGuts(JSContext* cx, JS::HandleObject origObj, JS::HandleId id, JS::HandleObject callable)
-{
-    RootedObject obj(cx, ToWindowIfWindowProxy(origObj));
-    if (obj->isNative()) {
-        // Use sparse indexes for watched objects, as dense elements can be
-        // written to without checking the watchpoint map.
-        if (!NativeObject::sparsifyDenseElements(cx, obj.as<NativeObject>()))
-            return false;
-
-        MarkTypePropertyNonData(cx, obj, id);
-    }
-
-    WatchpointMap* wpmap = cx->compartment()->watchpointMap;
-    if (!wpmap) {
-        wpmap = cx->zone()->new_<WatchpointMap>();
-        if (!wpmap || !wpmap->init()) {
-            ReportOutOfMemory(cx);
-            js_delete(wpmap);
-            return false;
-        }
-        cx->compartment()->watchpointMap = wpmap;
-    }
-
-    return wpmap->watch(cx, obj, id, js::WatchHandler, callable);
-}
-
-bool
-js::UnwatchGuts(JSContext* cx, JS::HandleObject origObj, JS::HandleId id)
-{
-    // Looking in the map for an unsupported object will never hit, so we don't
-    // need to check for nativeness or watchable-ness here.
-    RootedObject obj(cx, ToWindowIfWindowProxy(origObj));
-    if (WatchpointMap* wpmap = cx->compartment()->watchpointMap)
-        wpmap->unwatch(obj, id);
-    return true;
-}
-
-bool
-js::WatchProperty(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable)
-{
-    if (WatchOp op = obj->getOpsWatch())
-        return op(cx, obj, id, callable);
-
-    if (!obj->isNative() || obj->is<TypedArrayObject>()) {
-        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_WATCH,
-                                  obj->getClass()->name);
-        return false;
-    }
-
-    return WatchGuts(cx, obj, id, callable);
-}
-
-bool
-js::UnwatchProperty(JSContext* cx, HandleObject obj, HandleId id)
-{
-    if (UnwatchOp op = obj->getOpsUnwatch())
-        return op(cx, obj, id);
-
-    return UnwatchGuts(cx, obj, id);
-}
-
 /* * */
 
 extern bool
 PropertySpecNameToId(JSContext* cx, const char* name, MutableHandleId id,
                      js::PinningBehavior pin = js::DoNotPinAtom);
 
 static bool
 DefineFunctionFromSpec(JSContext* cx, HandleObject obj, const JSFunctionSpec* fs, unsigned flags,
@@ -3623,17 +3554,16 @@ JSObject::dump(js::GenericPrinter& out) 
 
     out.put("flags:");
     if (obj->isDelegate()) out.put(" delegate");
     if (!obj->is<ProxyObject>() && !obj->nonProxyIsExtensible()) out.put(" not_extensible");
     if (obj->maybeHasInterestingSymbolProperty()) out.put(" maybe_has_interesting_symbol");
     if (obj->isBoundFunction()) out.put(" bound_function");
     if (obj->isQualifiedVarObj()) out.put(" varobj");
     if (obj->isUnqualifiedVarObj()) out.put(" unqualified_varobj");
-    if (obj->watched()) out.put(" watched");
     if (obj->isIteratedSingleton()) out.put(" iterated_singleton");
     if (obj->isNewGroupUnknown()) out.put(" new_type_unknown");
     if (obj->hasUncacheableProto()) out.put(" has_uncacheable_proto");
     if (obj->hasStaticPrototype() && obj->staticPrototypeIsImmutable())
         out.put(" immutable_prototype");
 
     if (obj->isNative()) {
         const NativeObject* nobj = &obj->as<NativeObject>();
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -113,18 +113,16 @@ class JSObject : public js::gc::Cell
     js::LookupPropertyOp getOpsLookupProperty() const { return getClass()->getOpsLookupProperty(); }
     js::DefinePropertyOp getOpsDefineProperty() const { return getClass()->getOpsDefineProperty(); }
     js::HasPropertyOp    getOpsHasProperty()    const { return getClass()->getOpsHasProperty(); }
     js::GetPropertyOp    getOpsGetProperty()    const { return getClass()->getOpsGetProperty(); }
     js::SetPropertyOp    getOpsSetProperty()    const { return getClass()->getOpsSetProperty(); }
     js::GetOwnPropertyOp getOpsGetOwnPropertyDescriptor()
                                                 const { return getClass()->getOpsGetOwnPropertyDescriptor(); }
     js::DeletePropertyOp getOpsDeleteProperty() const { return getClass()->getOpsDeleteProperty(); }
-    js::WatchOp          getOpsWatch()          const { return getClass()->getOpsWatch(); }
-    js::UnwatchOp        getOpsUnwatch()        const { return getClass()->getOpsUnwatch(); }
     js::GetElementsOp    getOpsGetElements()    const { return getClass()->getOpsGetElements(); }
     JSFunToStringOp      getOpsFunToString()    const { return getClass()->getOpsFunToString(); }
 
     js::ObjectGroup* group() const {
         MOZ_ASSERT(!hasLazyGroup());
         return groupRaw();
     }
 
@@ -182,21 +180,16 @@ class JSObject : public js::gc::Cell
     inline bool isDelegate() const;
     static bool setDelegate(JSContext* cx, JS::HandleObject obj) {
         return setFlags(cx, obj, js::BaseShape::DELEGATE, GENERATE_SHAPE);
     }
 
     inline bool isBoundFunction() const;
     inline bool hasSpecialEquality() const;
 
-    inline bool watched() const;
-    static bool setWatched(JSContext* cx, JS::HandleObject obj) {
-        return setFlags(cx, obj, js::BaseShape::WATCHED, GENERATE_SHAPE);
-    }
-
     // A "qualified" varobj is the object on which "qualified" variable
     // declarations (i.e., those defined with "var") are kept.
     //
     // Conceptually, when a var binding is defined, it is defined on the
     // innermost qualified varobj on the scope chain.
     //
     // Function scopes (CallObjects) are qualified varobjs, and there can be
     // no other qualified varobj that is more inner for var bindings in that
@@ -988,31 +981,16 @@ enum DefineAsIntrinsic {
     NotIntrinsic,
     AsIntrinsic
 };
 
 extern bool
 DefineFunctions(JSContext* cx, HandleObject obj, const JSFunctionSpec* fs,
                 DefineAsIntrinsic intrinsic);
 
-/*
- * Set a watchpoint: a synchronous callback when the given property of the
- * given object is set.
- *
- * Watchpoints are nonstandard and do not fit in well with the way ES6
- * specifies [[Set]]. They are also insufficient for implementing
- * Object.observe.
- */
-extern bool
-WatchProperty(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable);
-
-/* Clear a watchpoint. */
-extern bool
-UnwatchProperty(JSContext* cx, HandleObject obj, HandleId id);
-
 /* ES6 draft rev 36 (2015 March 17) 7.1.1 ToPrimitive(vp[, preferredType]) */
 extern bool
 ToPrimitiveSlow(JSContext* cx, JSType hint, MutableHandleValue vp);
 
 inline bool
 ToPrimitive(JSContext* cx, MutableHandleValue vp)
 {
     if (vp.isPrimitive())
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -444,22 +444,16 @@ JSObject::nonProxyIsExtensible() const
 
 inline bool
 JSObject::isBoundFunction() const
 {
     return is<JSFunction>() && as<JSFunction>().isBoundFunction();
 }
 
 inline bool
-JSObject::watched() const
-{
-    return hasAllFlags(js::BaseShape::WATCHED);
-}
-
-inline bool
 JSObject::isDelegate() const
 {
     return hasAllFlags(js::BaseShape::DELEGATE);
 }
 
 inline bool
 JSObject::hasUncacheableProto() const
 {
--- a/js/src/jsversion.h
+++ b/js/src/jsversion.h
@@ -7,17 +7,16 @@
 #ifndef jsversion_h
 #define jsversion_h
 
 /*
  * JS Capability Macros.
  */
 #define JS_HAS_STR_HTML_HELPERS 1       /* (no longer used) */
 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
-#define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
 #define JS_HAS_CONST            1       /* (no longer used) */
 #define JS_HAS_FUN_EXPR_STMT    1       /* (no longer used) */
 #define JS_HAS_FOR_EACH_IN      1       /* has for each (lhs in iterable) */
 #define JS_HAS_GENERATORS       1       /* (no longer used) */
 #define JS_HAS_BLOCK_SCOPE      1       /* (no longer used) */
deleted file mode 100644
--- a/js/src/jswatchpoint.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * 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 "jswatchpoint.h"
-
-#include "jsatom.h"
-#include "jscompartment.h"
-#include "jsfriendapi.h"
-
-#include "gc/Marking.h"
-#include "vm/Shape.h"
-
-#include "jsgcinlines.h"
-
-using namespace js;
-using namespace js::gc;
-
-inline HashNumber
-WatchKeyHasher::hash(const Lookup& key)
-{
-    return MovableCellHasher<PreBarrieredObject>::hash(key.object) ^ HashId(key.id);
-}
-
-namespace {
-
-class AutoEntryHolder {
-    typedef WatchpointMap::Map Map;
-    Generation gen;
-    Map& map;
-    Map::Ptr p;
-    RootedObject obj;
-    RootedId id;
-
-  public:
-    AutoEntryHolder(JSContext* cx, Map& map, Map::Ptr p)
-      : gen(map.generation()), map(map), p(p), obj(cx, p->key().object), id(cx, p->key().id)
-    {
-        MOZ_ASSERT(!p->value().held);
-        p->value().held = true;
-    }
-
-    ~AutoEntryHolder() {
-        if (gen != map.generation())
-            p = map.lookup(WatchKey(obj, id));
-        if (p)
-            p->value().held = false;
-    }
-};
-
-} /* anonymous namespace */
-
-bool
-WatchpointMap::init()
-{
-    return map.init();
-}
-
-bool
-WatchpointMap::watch(JSContext* cx, HandleObject obj, HandleId id,
-                     JSWatchPointHandler handler, HandleObject closure)
-{
-    MOZ_ASSERT(JSID_IS_STRING(id) || JSID_IS_INT(id) || JSID_IS_SYMBOL(id));
-
-    if (!JSObject::setWatched(cx, obj))
-        return false;
-
-    Watchpoint w(handler, closure, false);
-    if (!map.put(WatchKey(obj, id), w)) {
-        ReportOutOfMemory(cx);
-        return false;
-    }
-    /*
-     * For generational GC, we don't need to post-barrier writes to the
-     * hashtable here because we mark all watchpoints as part of root marking in
-     * markAll().
-     */
-    return true;
-}
-
-void
-WatchpointMap::unwatch(JSObject* obj, jsid id)
-{
-    if (Map::Ptr p = map.lookup(WatchKey(obj, id)))
-        map.remove(p);
-}
-
-void
-WatchpointMap::unwatchObject(JSObject* obj)
-{
-    for (Map::Enum e(map); !e.empty(); e.popFront()) {
-        Map::Entry& entry = e.front();
-        if (entry.key().object == obj)
-            e.removeFront();
-    }
-}
-
-void
-WatchpointMap::clear()
-{
-    map.clear();
-}
-
-bool
-WatchpointMap::triggerWatchpoint(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp)
-{
-    Map::Ptr p = map.lookup(WatchKey(obj, id));
-    if (!p || p->value().held)
-        return true;
-
-    AutoEntryHolder holder(cx, map, p);
-
-    /* Copy the entry, since GC would invalidate p. */
-    JSWatchPointHandler handler = p->value().handler;
-    RootedObject closure(cx, p->value().closure);
-
-    /* Determine the property's old value. */
-    Value old;
-    old.setUndefined();
-    if (obj->isNative()) {
-        NativeObject* nobj = &obj->as<NativeObject>();
-        if (Shape* shape = nobj->lookup(cx, id)) {
-            if (shape->isDataProperty())
-                old = nobj->getSlot(shape->slot());
-        }
-    }
-
-    // Read barrier to prevent an incorrectly gray closure from escaping the
-    // watchpoint. See the comment before UnmarkGrayChildren in gc/Marking.cpp
-    JS::ExposeObjectToActiveJS(closure);
-
-    /* Call the handler. */
-    return handler(cx, obj, id, old, vp.address(), closure);
-}
-
-bool
-WatchpointMap::markIteratively(GCMarker* marker)
-{
-    bool marked = false;
-    for (Map::Enum e(map); !e.empty(); e.popFront()) {
-        Map::Entry& entry = e.front();
-        auto& object = entry.mutableKey().object;
-        bool objectIsLive = IsMarked(marker->runtime(), &object);
-        if (objectIsLive || entry.value().held) {
-            if (!objectIsLive) {
-                TraceEdge(marker, &object, "held Watchpoint object");
-                marked = true;
-            }
-
-            auto& id = entry.mutableKey().id;
-            MOZ_ASSERT(JSID_IS_STRING(id) || JSID_IS_INT(id) || JSID_IS_SYMBOL(id));
-            TraceEdge(marker, &id, "WatchKey::id");
-
-            auto& closure = entry.value().closure;
-            if (closure && !IsMarked(marker->runtime(), &closure)) {
-                TraceEdge(marker, &closure, "Watchpoint::closure");
-                marked = true;
-            }
-        }
-    }
-    return marked;
-}
-
-void
-WatchpointMap::trace(JSTracer* trc)
-{
-    for (Map::Enum e(map); !e.empty(); e.popFront()) {
-        Map::Entry& entry = e.front();
-        auto& id = entry.mutableKey().id;
-        MOZ_ASSERT(JSID_IS_STRING(id) || JSID_IS_INT(id) || JSID_IS_SYMBOL(id));
-        TraceEdge(trc, &entry.mutableKey().object, "held Watchpoint object");
-        TraceEdge(trc, &id, "WatchKey::id");
-        TraceEdge(trc, &entry.value().closure, "Watchpoint::closure");
-    }
-}
-
-/* static */ void
-WatchpointMap::sweepAll(JSRuntime* rt)
-{
-    // This is called during compacting GC. Watchpoint closure pointers can be
-    // cross-compartment so we have to sweep all watchpoint maps, not just those
-    // owned by compartments we are compacting.
-    for (GCCompartmentsIter c(rt); !c.done(); c.next()) {
-        if (WatchpointMap* wpmap = c->watchpointMap)
-            wpmap->sweep();
-    }
-}
-
-void
-WatchpointMap::sweep()
-{
-    for (Map::Enum e(map); !e.empty(); e.popFront()) {
-        Map::Entry& entry = e.front();
-        if (IsAboutToBeFinalized(&entry.mutableKey().object)) {
-            MOZ_ASSERT(!entry.value().held);
-            e.removeFront();
-        }
-    }
-}
-
-void
-WatchpointMap::traceAll(WeakMapTracer* trc)
-{
-    JSRuntime* rt = trc->runtime;
-    for (CompartmentsIter comp(rt, SkipAtoms); !comp.done(); comp.next()) {
-        if (WatchpointMap* wpmap = comp->watchpointMap)
-            wpmap->trace(trc);
-    }
-}
-
-void
-WatchpointMap::trace(WeakMapTracer* trc)
-{
-    for (Map::Range r = map.all(); !r.empty(); r.popFront()) {
-        Map::Entry& entry = r.front();
-        trc->trace(nullptr,
-                   JS::GCCellPtr(entry.key().object.get()),
-                   JS::GCCellPtr(entry.value().closure.get()));
-    }
-}
deleted file mode 100644
--- a/js/src/jswatchpoint.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set ts=8 sts=4 et sw=4 tw=99:
- * 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/. */
-
-#ifndef jswatchpoint_h
-#define jswatchpoint_h
-
-#include "jsalloc.h"
-
-#include "gc/Barrier.h"
-#include "js/HashTable.h"
-
-namespace js {
-
-class GCMarker;
-struct WeakMapTracer;
-
-struct WatchKey {
-    WatchKey() {}
-    WatchKey(JSObject* obj, jsid id) : object(obj), id(id) {}
-    WatchKey(const WatchKey& key) : object(key.object.get()), id(key.id.get()) {}
-
-    // These are traced unconditionally during minor GC, so do not require
-    // post-barriers.
-    PreBarrieredObject object;
-    PreBarrieredId id;
-
-    bool operator!=(const WatchKey& other) const {
-        return object != other.object || id != other.id;
-    }
-};
-
-typedef bool
-(* JSWatchPointHandler)(JSContext* cx, JSObject* obj, jsid id, const JS::Value& old,
-                        JS::Value* newp, void* closure);
-
-struct Watchpoint {
-    JSWatchPointHandler handler;
-    PreBarrieredObject closure;  /* This is always marked in minor GCs and so doesn't require a postbarrier. */
-    bool held;  /* true if currently running handler */
-    Watchpoint(JSWatchPointHandler handler, JSObject* closure, bool held)
-      : handler(handler), closure(closure), held(held) {}
-};
-
-struct WatchKeyHasher
-{
-    typedef WatchKey Lookup;
-    static inline js::HashNumber hash(const Lookup& key);
-
-    static bool match(const WatchKey& k, const Lookup& l) {
-        return MovableCellHasher<PreBarrieredObject>::match(k.object, l.object) &&
-               DefaultHasher<PreBarrieredId>::match(k.id, l.id);
-    }
-
-    static void rekey(WatchKey& k, const WatchKey& newKey) {
-        k.object.unsafeSet(newKey.object);
-        k.id.unsafeSet(newKey.id);
-    }
-};
-
-class WatchpointMap {
-  public:
-    typedef HashMap<WatchKey, Watchpoint, WatchKeyHasher, SystemAllocPolicy> Map;
-
-    bool init();
-    bool watch(JSContext* cx, HandleObject obj, HandleId id,
-               JSWatchPointHandler handler, HandleObject closure);
-    void unwatch(JSObject* obj, jsid id);
-    void unwatchObject(JSObject* obj);
-    void clear();
-
-    bool triggerWatchpoint(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp);
-
-    bool markIteratively(GCMarker* marker);
-    void trace(JSTracer* trc);
-
-    static void sweepAll(JSRuntime* rt);
-    void sweep();
-
-    static void traceAll(WeakMapTracer* trc);
-    void trace(WeakMapTracer* trc);
-
-  private:
-    Map map;
-};
-
-} // namespace js
-
-#endif /* jswatchpoint_h */
--- a/js/src/jswrapper.h
+++ b/js/src/jswrapper.h
@@ -316,20 +316,16 @@ class JS_FRIEND_API(SecurityWrapper) : p
     virtual bool getBuiltinClass(JSContext* cx, HandleObject wrapper, ESClass* cls) const override;
     virtual bool isArray(JSContext* cx, HandleObject wrapper, JS::IsArrayAnswer* answer) const override;
     virtual RegExpShared* regexp_toShared(JSContext* cx, HandleObject proxy) const override;
     virtual bool boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp) const override;
 
     // Allow isCallable and isConstructor. They used to be class-level, and so could not be guarded
     // against.
 
-    virtual bool watch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id,
-                       JS::HandleObject callable) const override;
-    virtual bool unwatch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id) const override;
-
     /*
      * Allow our subclasses to select the superclass behavior they want without
      * needing to specify an exact superclass.
      */
     typedef Base Permissive;
     typedef SecurityWrapper<Base> Restrictive;
 };
 
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -286,17 +286,16 @@ UNIFIED_SOURCES += [
     'jsnativestack.cpp',
     'jsnum.cpp',
     'jsobj.cpp',
     'json.cpp',
     'jsopcode.cpp',
     'jsprf.cpp',
     'jsscript.cpp',
     'jsstr.cpp',
-    'jswatchpoint.cpp',
     'jsweakmap.cpp',
     'perf/jsperf.cpp',
     'proxy/BaseProxyHandler.cpp',
     'proxy/CrossCompartmentWrapper.cpp',
     'proxy/DeadObjectProxy.cpp',
     'proxy/OpaqueCrossCompartmentWrapper.cpp',
     'proxy/Proxy.cpp',
     'proxy/ScriptedProxyHandler.cpp',
--- a/js/src/proxy/BaseProxyHandler.cpp
+++ b/js/src/proxy/BaseProxyHandler.cpp
@@ -404,30 +404,16 @@ BaseProxyHandler::setPrototype(JSContext
 bool
 BaseProxyHandler::setImmutablePrototype(JSContext* cx, HandleObject proxy, bool* succeeded) const
 {
     *succeeded = false;
     return true;
 }
 
 bool
-BaseProxyHandler::watch(JSContext* cx, HandleObject proxy, HandleId id, HandleObject callable) const
-{
-    JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_CANT_WATCH,
-                              proxy->getClass()->name);
-    return false;
-}
-
-bool
-BaseProxyHandler::unwatch(JSContext* cx, HandleObject proxy, HandleId id) const
-{
-    return true;
-}
-
-bool
 BaseProxyHandler::getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
                               ElementAdder* adder) const
 {
     assertEnteredPolicy(cx, proxy, JSID_VOID, GET);
 
     return js::GetElementsWithAdder(cx, proxy, proxy, begin, end, adder);
 }
 
--- a/js/src/proxy/Proxy.cpp
+++ b/js/src/proxy/Proxy.cpp
@@ -620,32 +620,16 @@ Proxy::boxedValue_unbox(JSContext* cx, H
     if (!CheckRecursionLimit(cx))
         return false;
     return proxy->as<ProxyObject>().handler()->boxedValue_unbox(cx, proxy, vp);
 }
 
 JSObject * const TaggedProto::LazyProto = reinterpret_cast<JSObject*>(0x1);
 
 /* static */ bool
-Proxy::watch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleObject callable)
-{
-    if (!CheckRecursionLimit(cx))
-        return false;
-    return proxy->as<ProxyObject>().handler()->watch(cx, proxy, id, callable);
-}
-
-/* static */ bool
-Proxy::unwatch(JSContext* cx, JS::HandleObject proxy, JS::HandleId id)
-{
-    if (!CheckRecursionLimit(cx))
-        return false;
-    return proxy->as<ProxyObject>().handler()->unwatch(cx, proxy, id);
-}
-
-/* static */ bool
 Proxy::getElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
                    ElementAdder* adder)
 {
     if (!CheckRecursionLimit(cx))
         return false;
     const BaseProxyHandler* handler = proxy->as<ProxyObject>().handler();
     AutoEnterPolicy policy(cx, handler, proxy, JSID_VOIDHANDLE, BaseProxyHandler::GET,
                            /* mayThrow = */ true);
@@ -818,17 +802,16 @@ const ClassExtension js::ProxyClassExten
 const ObjectOps js::ProxyObjectOps = {
     proxy_LookupProperty,
     Proxy::defineProperty,
     Proxy::has,
     Proxy::get,
     Proxy::set,
     Proxy::getOwnPropertyDescriptor,
     proxy_DeleteProperty,
-    Proxy::watch, Proxy::unwatch,
     Proxy::getElements,
     Proxy::fun_toString
 };
 
 const Class js::ProxyObject::proxyClass =
     PROXY_CLASS_DEF("Proxy",
                     JSCLASS_HAS_CACHED_PROTO(JSProto_Proxy) |
                     JSCLASS_HAS_RESERVED_SLOTS(2));
--- a/js/src/proxy/Proxy.h
+++ b/js/src/proxy/Proxy.h
@@ -62,19 +62,16 @@ class Proxy
     static bool hasInstance(JSContext* cx, HandleObject proxy, MutableHandleValue v, bool* bp);
     static bool getBuiltinClass(JSContext* cx, HandleObject proxy, ESClass* cls);
     static bool isArray(JSContext* cx, HandleObject proxy, JS::IsArrayAnswer* answer);
     static const char* className(JSContext* cx, HandleObject proxy);
     static JSString* fun_toString(JSContext* cx, HandleObject proxy, bool isToSource);
     static RegExpShared* regexp_toShared(JSContext* cx, HandleObject proxy);
     static bool boxedValue_unbox(JSContext* cx, HandleObject proxy, MutableHandleValue vp);
 
-    static bool watch(JSContext* cx, HandleObject proxy, HandleId id, HandleObject callable);
-    static bool unwatch(JSContext* cx, HandleObject proxy, HandleId id);
-
     static bool getElements(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end,
                             ElementAdder* adder);
 
     static void trace(JSTracer* trc, JSObject* obj);
 };
 
 bool
 proxy_Call(JSContext* cx, unsigned argc, Value* vp);
--- a/js/src/proxy/SecurityWrapper.cpp
+++ b/js/src/proxy/SecurityWrapper.cpp
@@ -119,29 +119,10 @@ SecurityWrapper<Base>::defineProperty(JS
         JS_ReportErrorNumberUC(cx, GetErrorMessage, nullptr,
                                JSMSG_ACCESSOR_DEF_DENIED, prop);
         return false;
     }
 
     return Base::defineProperty(cx, wrapper, id, desc, result);
 }
 
-template <class Base>
-bool
-SecurityWrapper<Base>::watch(JSContext* cx, HandleObject proxy,
-                             HandleId id, HandleObject callable) const
-{
-    ReportAccessDenied(cx);
-    return false;
-}
-
-template <class Base>
-bool
-SecurityWrapper<Base>::unwatch(JSContext* cx, HandleObject proxy,
-                               HandleId id) const
-{
-    ReportAccessDenied(cx);
-    return false;
-}
-
-
 template class js::SecurityWrapper<Wrapper>;
 template class js::SecurityWrapper<CrossCompartmentWrapper>;
--- a/js/src/tests/ecma_5/Array/frozen-dense-array.js
+++ b/js/src/tests/ecma_5/Array/frozen-dense-array.js
@@ -33,29 +33,10 @@ assertThrowsInstanceOf(() => a.splice(Ma
 // Shouldn't throw, since this is not strict mode, but shouldn't change the
 // value of the property.
 a.length = 5;
 a[2] = "foo";
 assertEq(delete a[0], false);
 
 assertArrayIsExpected();
 
-var watchpointCalled = false;
-// NOTE: Be careful with the position of this test, since this sparsifies the
-// elements and you might not test what you think you're testing otherwise.
-a.watch(2, function(prop, oldValue, newValue) {
-  watchpointCalled = true;
-  assertEq(prop, 2);
-  assertEq(oldValue, 1);
-  assertEq(newValue, "foo");
-});
-
-assertArrayIsExpected();
-
-a.length = 5;
-a[2] = "foo";
-assertEq(watchpointCalled, true);
-assertEq(delete a[0], false);
-
-assertArrayIsExpected();
-
 if (typeof reportCompare === "function")
   reportCompare(true, true);
deleted file mode 100644
--- a/js/src/tests/ecma_5/extensions/watch-array-length.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- */
-
-var hitCount;
-function watcher(p,o,n) { hitCount++; return n; }
-
-var a = [1];
-a.watch('length', watcher);
-hitCount = 0;
-a.length = 0;
-reportCompare(1, hitCount, "lenient; configurable: watchpoint hit");
-
-var b = Object.defineProperty([1],'0',{configurable:false});
-b.watch('length', watcher);
-hitCount = 0;
-var result;
-try {
-    b.length = 0;    
-    result = "no error";
-} catch (x) {
-    result = x.toString();
-}
-reportCompare(1, hitCount, "lenient; non-configurable: watchpoint hit");
-reportCompare(1, b.length, "lenient; non-configurable: length unchanged");
-reportCompare("no error", result, "lenient; non-configurable: no error thrown");
-
-var c = Object.defineProperty([1],'0',{configurable:false});
-c.watch('length', watcher);
-hitCount = 0;
-var threwTypeError;
-try {
-    (function(){'use strict'; c.length = 0;})();
-    threwTypeError = false;
-} catch (x) {
-    threwTypeError = x instanceof TypeError;
-}
-reportCompare(1, hitCount, "strict; non-configurable: watchpoint hit");
-reportCompare(1, c.length, "strict; non-configurable: length unchanged");
-reportCompare(true, threwTypeError, "strict; non-configurable: TypeError thrown");
deleted file mode 100644
--- a/js/src/tests/ecma_5/extensions/watch-inherited-property.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- */
-
-/* Create a prototype object with a setter property. */
-var protoSetterCount;
-var proto = ({ set x(v) { protoSetterCount++; } });
-
-/* Put a watchpoint on that setter. */
-var protoWatchCount;
-proto.watch('x', function() { protoWatchCount++; });
-
-/* Make an object with the above as its prototype. */
-function C() { }
-C.prototype = proto;
-var o = new C();
-
-/*
- * Set a watchpoint on the property in the inheriting object. We have
- * defined this to mean "duplicate the property, setter and all, in the
- * inheriting object." I don't think debugging observation mechanisms
- * should mutate the program being run, but that's what we've got.
- */
-var oWatchCount;
-o.watch('x', function() { oWatchCount++; });
-
-/*
- * Assign to the property. This should trip the watchpoint on the inheriting object and
- * the setter.
- */
-protoSetterCount = protoWatchCount = oWatchCount = 0;
-o.x = 1;
-assertEq(protoWatchCount, 0);
-assertEq(oWatchCount, 1);
-assertEq(protoSetterCount, 1);
-
-reportCompare(true, true);
deleted file mode 100644
--- a/js/src/tests/ecma_5/extensions/watch-replaced-setter.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- */
-
-/* A stock watcher function. */
-var watcherCount;
-function watcher(id, oldval, newval) { watcherCount++; return newval; }
-
-/* Create an object with a JavaScript setter. */
-var setterCount;
-var o = { w:2, set x(v) { setterCount++; } };
-
-/*
- * Put the object in dictionary mode, so that JSObject::putProperty will 
- * mutate its shapes instead of creating new ones.
- */
-delete o.w;
-
-/*
- * Place a watchpoint on the property. The watchpoint structure holds the
- * original JavaScript setter, and a pointer to the shape.
- */
-o.watch('x', watcher);
-
-/*
- * Replace the accessor property with a value property. The shape's setter
- * should become a non-JS setter, js_watch_set, and the watchpoint
- * structure's saved setter should be updated (in this case, cleared).
- */
-Object.defineProperty(o, 'x', { value:3,
-                                writable:true,
-                                enumerable:true,
-                                configurable:true });
-
-/*
- * Assign to the property. This should trigger js_watch_set, which should
- * call the handler, and then see that there is no JS-level setter to pass
- * control on to, and return.
- */
-watcherCount = setterCount = 0;
-o.x = 3;
-assertEq(watcherCount, 1);
-assertEq(setterCount, 0);
-
-reportCompare(true, true);
deleted file mode 100644
--- a/js/src/tests/ecma_5/extensions/watch-setter-become-setter.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- */
-
-/* Create an object with a JavaScript setter. */
-var firstSetterCount;
-var o = { w:2, set x(v) { firstSetterCount++; } };
-
-/*
- * Put the object in dictionary mode, so that JSObject::putProperty will 
- * mutate its shapes instead of creating new ones.
- */
-delete o.w;
-
-/* A stock watcher function. */
-var watcherCount;
-function watcher(id, oldval, newval) { watcherCount++; return newval; }
-
-/*
- * Place a watchpoint on the property. The property's shape now has the
- * watchpoint setter, with the original setter saved in the watchpoint
- * structure.
- */
-o.watch('x', watcher);
-
-/*
- * Replace the setter with a new setter. The shape should get updated to
- * refer to the new setter, and then the watchpoint setter should be
- * re-established.
- */
-var secondSetterCount;
-Object.defineProperty(o, 'x', { set: function () { secondSetterCount++ } });
-
-/*
- * Assign to the property. This should trigger the watchpoint and the new setter.
- */
-watcherCount = firstSetterCount = secondSetterCount = 0;
-o.x = 3;
-assertEq(watcherCount, 1);
-assertEq(firstSetterCount, 0);
-assertEq(secondSetterCount, 1);
-
-reportCompare(true, true);
deleted file mode 100644
--- a/js/src/tests/ecma_5/extensions/watch-value-prop-becoming-setter.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- */
-
-/* A stock watcher function. */
-var watcherCount;
-function watcher(id, old, newval) {
-    watcherCount++;
-    return newval; 
-}
-
-/* Create an object with a value property. */
-var o = { w:2, x:3 };
-
-/*
- * Place a watchpoint on the value property. The watchpoint structure holds
- * the original JavaScript setter, and a pointer to the shape.
- */
-o.watch('x', watcher);
-
-/*
- * Put the object in dictionary mode, so that JSObject::putProperty will 
- * mutate its shapes instead of creating new ones.
- */
-delete o.w;
-
-/*
- * Replace the value property with a setter.
- */
-var setterCount;
-o.__defineSetter__('x', function() { setterCount++; });
-
-/*
- * Trigger the watchpoint. The watchpoint handler should run, and then the
- * setter should run.
- */
-watcherCount = setterCount = 0;
-o.x = 4;
-assertEq(watcherCount, 1);
-assertEq(setterCount, 1);
-
-reportCompare(true, true);
deleted file mode 100644
--- a/js/src/tests/ecma_5/extensions/watchpoint-deletes-JSPropertyOp-setter.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- */
-
-function make_watcher(name) {
-    return function (id, oldv, newv) {
-        print("watched " + name + "[0]");
-    };
-}
-
-var o, p;
-function f(flag) {
-    if (flag) {
-        o = arguments;
-    } else {
-        p = arguments;
-        o.watch(0, make_watcher('o'));
-        p.watch(0, make_watcher('p'));
-
-        /*
-         * Previously, the watchpoint implementation actually substituted its magic setter
-         * functions for the setters of shared shapes, and then 1) carefully ignored calls
-         * to its magic setter from unrelated objects, and 2) avoided restoring the
-         * original setter until all watchpoints on that shape had been removed.
-         * 
-         * However, when the watchpoint code began using JSObject::changeProperty and
-         * js_ChangeNativePropertyAttrs to change shapes' setters, the shape tree code
-         * became conscious of the presence of watchpoints, and shared shapes between
-         * objects only when their watchpoint nature coincided. Clearing the magic setter
-         * from one object's shape would not affect other objects, because the
-         * watchpointed and non-watchpointed shapes were distinct if they were shared.
-         * 
-         * Thus, the first unwatch call must go ahead and fix p's shape, even though a
-         * watchpoint exists on the same shape in o. o's watchpoint's presence shouldn't
-         * cause 'unwatch' to leave p's magic setter in place.
-         */
-
-        /* DropWatchPointAndUnlock would see o's watchpoint, and not change p's property. */
-        p.unwatch(0);
-
-        /* DropWatchPointAndUnlock would fix o's property, but not p's; p's setter would be gone. */
-        o.unwatch(0);
-
-        /* This would fail to invoke the arguments object's setter. */
-        p[0] = 4;
-
-        /* And the formal parameter would not get updated. */
-        assertEq(flag, 4);
-    }
-}
-
-f(true);
-f(false);
-
-reportCompare(true, true);
deleted file mode 100644
--- a/js/src/tests/js1_2/Objects/watch-deprecated.js
+++ /dev/null
@@ -1,23 +0,0 @@
-// |reftest| skip-if(!xulRuntime.shell)
-
-enableLastWarning();
-
-var g = newGlobal();
-g.eval("({}).watch('x', function(){})");
-
-var warning = getLastWarning();
-assertEq(warning.name, "Warning");
-assertEq(warning.message.includes("watch"), true, "warning should mention watch");
-
-clearLastWarning();
-
-g = newGlobal();
-g.eval("({}).unwatch('x')");
-
-warning = getLastWarning();
-assertEq(warning.name, "Warning");
-assertEq(warning.message.includes("watch"), true, "warning should mention watch");
-
-clearLastWarning();
-
-reportCompare(0, 0);
deleted file mode 100644
--- a/js/src/tests/js1_5/Object/regress-362872-01.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 362872;
-var summary = 'script should not drop watchpoint that is in use';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  function exploit() {
-    var rooter = {}, object = {}, filler1 = "", filler2 = "\u5555";
-    for(var i = 0; i < 32/2-2; i++) { filler1 += "\u5050"; }
-    object.watch("foo", function(){
-		   object.unwatch("foo");
-		   object.unwatch("foo");
-		   for(var i = 0; i < 8 * 1024; i++) {
-		     rooter[i] = filler1 + filler2;
-		   }
-		 });
-    object.foo = "bar";
-  }
-  exploit();
-
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/Object/regress-362872-02.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- * Contributor: Blake Kaplan
- */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 362872;
-var summary = 'script should not drop watchpoint that is in use';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
- 
-this.watch('x', function f() {
-             print("before");
-             x = 3;
-             print("after");
-           });
-x = 3;
-
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-127243.js
+++ /dev/null
@@ -1,75 +0,0 @@
-// |reftest| skip-if(xulRuntime.OS=="WINNT"&&isDebugBuild) slow
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 127243;
-var summary = 'Do not crash on watch';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
-
-if (typeof window != 'undefined' && typeof document != 'undefined') 
-{
-  // delay test driver end
-  gDelayTestDriverEnd = true;
-  window.addEventListener('load', handleLoad, false);
-}
-else
-{
-  printStatus('This test must be run in the browser');
-  reportCompare(expect, actual, summary);
-
-}
-
-var div;
-
-function handleLoad()
-{
-  div = document.createElement('div');
-  document.body.appendChild(div);
-  div.setAttribute('id', 'id1');
-  div.style.width = '50px';
-  div.style.height = '100px';
-  div.style.overflow = 'auto';
-
-  for (var i = 0; i < 5; i++)
-  {
-    var p = document.createElement('p');
-    var t = document.createTextNode('blah');
-    p.appendChild(t);
-    div.appendChild(p);
-  }
-
-  div.watch('scrollTop', wee);
-
-  setTimeout('setScrollTop()', 1000);
-}
-
-function wee(id, oldval, newval)
-{
-  var t = document.createTextNode('setting ' + id +
-                                  ' value ' + div.scrollTop +
-                                  ' oldval ' + oldval +
-                                  ' newval ' + newval);
-  var p = document.createElement('p');
-  p.appendChild(t);
-  document.body.appendChild(p);
-
-  return newval;
-}
-
-function setScrollTop()
-{
-  div.scrollTop = 42;
-
-  reportCompare(expect, actual, summary);
-
-  gDelayTestDriverEnd = false;
-  jsTestDriverEnd();
-
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-213482.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 213482;
-var summary = 'Do not crash watching property when watcher sets property';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
- 
-var testobj = {value: 'foo'};
-
-function watched (a, b, c) {
-  testobj.value = (new Date()).getTime();
-}
-
-function setTest() {
-  testobj.value = 'b';
-}
-
-testobj.watch("value", watched);
-
-setTest();
-
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-240577.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- * Contributor: Bob Clary
- */
-
-//-----------------------------------------------------------------------------
-// originally reported by Jens Thiele <karme@unforgettable.com> in
-var BUGNUMBER = 240577;
-var summary = 'object.watch execution context';
-var actual = '';
-var expect = '';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
-
-var createWatcher = function ( watchlabel )
-{
-  var watcher = function (property, oldvalue, newvalue)
-  {
-    actual += watchlabel; return newvalue;
-  };
-  return watcher;
-};
-
-var watcher1 = createWatcher('watcher1');
-
-var object = {property: 'value'};
-
-object.watch('property', watcher1);
-
-object.property = 'newvalue';
-
-expect = 'watcher1';
-
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-355341.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 355341;
-var summary = 'Do not crash with watch and setter';
-var actual = '';
-var expect = '';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  Object.defineProperty(this, "x", { set: Function, enumerable: true, configurable: true });
-  this.watch('x', function () { }); x = 3;
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-355344.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 355344;
-var summary = 'Exceptions thrown by watch point';
-var actual = '';
-var expect = '';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
-
-  var o = {};
-
-  expect = 'setter: yikes';
-
-  o.watch('x', function(){throw 'yikes'});
-  try
-  {
-    o.x = 3;
-  }
-  catch(ex)
-  {
-    actual = "setter: " + ex;
-  }
-
-  try
-  {
-    eval("") ;
-  }
-  catch(e)
-  {
-    actual = "eval: " + e;
-  }
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-361467.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361467;
-var summary = 'Do not crash with certain watchers';
-var actual = '';
-var expect = '';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  expect = actual = 'No Crash';
-
-  var x;
-  this.watch('x', print);
-  x = 5;
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-361617.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361617;
-var summary = 'Do not crash with getter, watch and gc';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  (function() {
-    Object.defineProperty(this, "x", { get: function(){}, enumerable: true, configurable: true });
-  })();
-  this.watch('x', print);
-  Object.defineProperty(this, "x", { get: function(){}, enumerable: true, configurable: true });
-  gc();
-  this.unwatch('x');
-  x;
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-385393-06.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 385393;
-var summary = 'Regression test for bug 385393';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  reportCompare(expect, actual, summary);
-
-  true.watch("x", function(){});
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-506567.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 506567;
-var summary = 'Do not crash with watched variables';
-var actual = '';
-var expect = '';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
-
-  if (typeof clearInterval == 'undefined')
-  {
-    clearInterval = (function () {});
-  }
-
-  var obj = new Object();
-  obj.test = null;
-  obj.watch("test", (function(prop, oldval, newval)
-    {
-      if(false)
-      {
-        var test = newval % oldval;
-        var func = (function(){clearInterval(myInterval);});
-      }
-    }));
-
-  obj.test = 'null';
-  print(obj.test);
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-303277.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 303277;
-var summary = 'Do not crash with crash with a watchpoint for __proto__ property ';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
-
-var o = {};
-o.watch("__proto__", function(){return null;});
-o.__proto__ = null;
- 
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-355339.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 355339;
-var summary = 'Do not assert: sprop->setter != js_watch_set';
-var actual = '';
-var expect = '';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  expect = actual = 'No Crash';
-  o = {};
-  o.watch("j", function(a,b,c) { print("*",a,b,c) });
-  o.unwatch("j");
-  o.watch("j", function(a,b,c) { print("*",a,b,c) });
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-361346.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361346;
-var summary = 'Crash with setter, watch, GC';
-var actual = '';
-var expect = '';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
- 
-expect = actual = 'No Crash';
-
-Object.defineProperty(this, "x", { set: new Function, enumerable: true, configurable: true });
-this.watch('x', function(){});
-gc();
-x = {};
-
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-361360.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361360;
-var summary = 'Do not assert: !caller || caller->pc involving setter and watch';
-var actual = '';
-var expect = '';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  expect = actual = 'No Crash';
-
-  this.__defineSetter__('x', eval);
-  this.watch('x', function(){});
-  x = 3;
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-361552.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361552;
-var summary = 'Crash with setter, watch, Script';
-var actual = '';
-var expect = '';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
- 
-expect = actual = 'No Crash';
-
-if (typeof Script == 'undefined')
-{
-  print('Test skipped. Script not defined.');
-}
-else
-{
-  this.__defineSetter__('x', gc);
-  this.watch('x', new Script(''));
-  x = 3;
-}
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-361558.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361558;
-var summary = 'Do not assert: sprop->setter != js_watch_set';
-var actual = '';
-var expect = '';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
- 
-expect = actual = 'No Crash';
-
-({}.__proto__.watch('x', print)); ({}.watch('x', print));
-
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-361571.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361571;
-var summary = 'Do not assert: fp->scopeChain == parent';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
-
-  try
-  {
-    o = {};
-    o.__defineSetter__('y', eval);
-    o.watch('y', function () { return "";});
-    o.y = 1;
-  }
-  catch(ex)
-  {
-    printStatus('Note eval can no longer be called directly');
-    expect = 'EvalError: function eval must be called directly, and not by way of a function of another name';
-    actual = ex + '';
-  }
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-361856.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361856;
-var summary = 'Do not assert: overwriting @ js_AddScopeProperty';
-var actual = '';
-var expect = '';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
-
-  function testit() {
-    var obj = {};
-    obj.watch("foo", function(){});
-    delete obj.foo;
-    obj = null;
-    gc();
-  }
-  testit();
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-361964.js
+++ /dev/null
@@ -1,54 +0,0 @@
-// |reftest| skip -- slow, alert not dismissed, now busted by harness
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 361964;
-var summary = 'Crash [@ MarkGCThingChildren] involving watch and setter';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
-
-  var doc;
-  if (typeof document == 'undefined')
-  {
-    doc = {};
-  }
-  else
-  {
-    doc = document;
-  }
-
-  if (typeof alert == 'undefined')
-  {
-    alert = print;
-  }
-
-// Crash:
-  doc.watch("title", function(a,b,c,d) {
-		   return { toString : function() { alert(1); } };
-		 });
-  doc.title = "xxx";
-
-// No crash:
-  doc.watch("title", function() {
-		   return { toString : function() { alert(1); } };
-		 });
-  doc.title = "xxx";
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-385134.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 385134;
-var summary = 'Do not crash with setter, watch, uneval';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  if (typeof this.__defineSetter__ != 'undefined' && 
-      typeof this.watch != 'undefined' &&
-      typeof uneval != 'undefined')
-  {
-    try {
-      this.__defineSetter__(0, function(){});
-    } catch (exc) {
-      // In the browser, this fails. Ignore the error.
-    }
-    this.watch(0, function(){});
-    uneval(this);
-  }
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-385393-09.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 385393;
-var summary = 'Regression test for bug 385393';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
- 
-eval("this.__defineSetter__('x', gc); this.watch('x', [].slice); x = 1;");
-
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-390597.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 390597;
-var summary = 'watch point + eval-as-setter allows access to dead JSStackFrame';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
- 
-  function exploit() {
-    try
-    {
-    var obj = this, args = null;
-    obj.__defineSetter__("evil", eval);
-    obj.watch("evil", function() { return "args = arguments;"; });
-    obj.evil = null;
-    eval("print(args[0]);");
-    }
-    catch(ex)
-    {
-      print('Caught ' + ex);
-    }
-  }
-  exploit();
-
-  reportCompare(expect, actual, summary);
-
-  exitFunc ('test');
-}
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-420612.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 420612;
-var summary = 'Do not assert: obj == pobj';
-var actual = 'No Crash';
-var expect = 'No Crash';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
-
-var obj = Object.create([]);
-obj.unwatch("x");
-
-if (typeof reportCompare === "function")
-  reportCompare(true, true);
-
-print("Tests complete");
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-435345-01.js
+++ /dev/null
@@ -1,100 +0,0 @@
-// |reftest| fails
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 435345;
-var summary = 'Watch the length property of arrays';
-var actual = '';
-var expect = '';
-
-// see http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Object:watch
-
-//-----------------------------------------------------------------------------
-test();
-//-----------------------------------------------------------------------------
-
-function test()
-{
-  enterFunc ('test');
-  printBugNumber(BUGNUMBER);
-  printStatus (summary);
-  
-  var arr;
- 
-  try
-  {
-    expect = 'watcher: propname=length, oldval=0, newval=1; ';
-    actual = '';
-    arr = [];
-    arr.watch('length', watcher);
-    arr[0] = '0';
-  }
-  catch(ex)
-  {
-    actual = ex + '';
-  }
-  reportCompare(expect, actual, summary + ': 1');
-
-  try
-  {
-    expect = 'watcher: propname=length, oldval=1, newval=2; ' + 
-      'watcher: propname=length, oldval=2, newval=2; ';
-    actual = '';
-    arr.push(5);
-  }
-  catch(ex)
-  {
-    actual = ex + '';
-  }
-  reportCompare(expect, actual, summary + ': 2');
-
-  try
-  {
-    expect = 'watcher: propname=length, oldval=2, newval=1; ';
-    actual = '';
-    arr.pop();
-  }
-  catch(ex)
-  {
-    actual = ex + '';
-  }
-  reportCompare(expect, actual, summary + ': 3');
-
-  try
-  {
-    expect = 'watcher: propname=length, oldval=1, newval=2; ';
-    actual = '';
-    arr.length++;
-  }
-  catch(ex)
-  {
-    actual = ex + '';
-  }
-  reportCompare(expect, actual, summary + ': 4');
-
-  try
-  {
-    expect = 'watcher: propname=length, oldval=2, newval=5; ';
-    actual = '';
-    arr.length = 5;
-  }
-  catch(ex)
-  {
-    actual = ex + '';
-  }
-  reportCompare(expect, actual, summary + ': 5');
-
-  exitFunc ('test');
-}
-
-function watcher(propname, oldval, newval)
-{
-  actual += 'watcher: propname=' + propname + ', oldval=' + oldval + 
-    ', newval=' + newval + '; ';
-
-  return newval;
-}
-
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-454040.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 454040;
-var summary = 'Do not crash @ js_ComputeFilename';
-var actual = '';
-var expect = '';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
-
-try
-{ 
-  this.__defineGetter__("x", Function);
-  this.__defineSetter__("x", Function);
-  this.watch("x", x.__proto__);
-  x = 1;
-}
-catch(ex)
-{
-}
-reportCompare(expect, actual, summary);
deleted file mode 100644
--- a/js/src/tests/js1_5/extensions/regress-454142.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// |reftest| skip-if(Android)
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* 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/. */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 454142;
-var summary = 'Do not crash with gczeal, setter, watch';
-var actual = '';
-var expect = '';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
- 
-this.watch("x", function(){});
-delete x;
-if (typeof gczeal == 'function')
-{
-  gczeal(2);
-}
-
-this.__defineSetter__("x", function(){});
-
-if (typeof gczeal == 'function')
-{
-  gczeal(0);
-}
-
-reportCompare(expect, actual, summary);