Merge mozilla-central to fx-team
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 29 Jan 2016 11:49:02 +0100
changeset 320585 df5126ec78738d3f9e8a127d693724e01abe2ee0
parent 320584 0ae6c7e277af505c6b13f8ba97e5618b0e8ffdfc (current diff)
parent 320519 8a3c5c9b1486c3328bc4684d5ac5b3b849b09474 (diff)
child 320586 6a96995d887a74d4fb867d6da5cd7382679effc6
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to fx-team
--- a/accessible/ipc/PDocAccessible.ipdl
+++ b/accessible/ipc/PDocAccessible.ipdl
@@ -43,38 +43,38 @@ struct RelationTargets
   uint64_t[] Targets;
 };
 
 prio(normal upto high) sync protocol PDocAccessible
 {
   manager PBrowser;
 
 parent:
-  Shutdown();
+  async Shutdown();
 
   /*
    * Notify the parent process the document in the child process is firing an
    * event.
    */
-  Event(uint64_t aID, uint32_t type);
-  ShowEvent(ShowEventData data);
-  HideEvent(uint64_t aRootID);
-  StateChangeEvent(uint64_t aID, uint64_t aState, bool aEnabled);
-  CaretMoveEvent(uint64_t aID, int32_t aOffset);
-  TextChangeEvent(uint64_t aID, nsString aStr, int32_t aStart, uint32_t aLen,
-                  bool aIsInsert, bool aFromUser);
+  async Event(uint64_t aID, uint32_t type);
+  async ShowEvent(ShowEventData data);
+  async HideEvent(uint64_t aRootID);
+  async StateChangeEvent(uint64_t aID, uint64_t aState, bool aEnabled);
+  async CaretMoveEvent(uint64_t aID, int32_t aOffset);
+  async TextChangeEvent(uint64_t aID, nsString aStr, int32_t aStart, uint32_t aLen,
+                        bool aIsInsert, bool aFromUser);
 
   /*
    * Tell the parent document to bind the existing document as a new child
    * document.
    */
-  BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
+  async BindChildDoc(PDocAccessible aChildDoc, uint64_t aID);
 
 child:
-  __delete__();
+  async __delete__();
 
   // Accessible
   prio(high) sync State(uint64_t aID) returns(uint64_t states);
   prio(high) sync NativeState(uint64_t aID) returns(uint64_t states);
   prio(high) sync Name(uint64_t aID) returns(nsString name);
   prio(high) sync Value(uint64_t aID) returns(nsString value);
   prio(high) sync Help(uint64_t aID) returns(nsString help);
   prio(high) sync Description(uint64_t aID) returns(nsString desc);
@@ -127,23 +127,23 @@ child:
   prio(high) sync SetSelectionBoundsAt(uint64_t aID, int32_t aSelectionNum,
                                        int32_t aStartOffset, int32_t aEndOffset)
     returns(bool aSucceeded);
   prio(high) sync AddToSelection(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset)
     returns(bool aSucceeded);
   prio(high) sync RemoveFromSelection(uint64_t aID, int32_t aSelectionNum)
     returns(bool aSucceeded);
 
-  ScrollSubstringTo(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset,
-                    uint32_t aScrollType);
-  ScrollSubstringToPoint(uint64_t aID,
-                         int32_t aStartOffset,
-                         int32_t aEndOffset,
-                         uint32_t aCoordinateType,
-                         int32_t aX, int32_t aY);
+  async ScrollSubstringTo(uint64_t aID, int32_t aStartOffset, int32_t aEndOffset,
+                          uint32_t aScrollType);
+  async ScrollSubstringToPoint(uint64_t aID,
+                               int32_t aStartOffset,
+                               int32_t aEndOffset,
+                               uint32_t aCoordinateType,
+                               int32_t aX, int32_t aY);
 
   prio(high) sync Text(uint64_t aID) returns(nsString aText);
   prio(high) sync ReplaceText(uint64_t aID, nsString aText);
   prio(high) sync InsertText(uint64_t aID, nsString aText, int32_t aPosition)
     returns(bool aValid);
   prio(high) sync CopyText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
     returns(bool aValid);
   prio(high) sync CutText(uint64_t aID, int32_t aStartPos, int32_t aEndPos)
--- a/b2g/app/nsBrowserApp.cpp
+++ b/b2g/app/nsBrowserApp.cpp
@@ -276,16 +276,17 @@ int main(int argc, _CONST char* argv[])
 #else
   #error "Unknown platform"  // having this here keeps cppcheck happy
 #endif
   }
 
   int result;
   {
     ScopedLogging log;
+    mozilla::LogModule::Init();
     char **_argv;
 
     /*
      * Duplicate argument vector to conform non-const argv of
      * do_main() since XRE_main() is very stupid with non-const argv.
      */
     _argv = new char *[argc + 1];
     for (int i = 0; i < argc; i++) {
--- a/b2g/config/aries-l/sources.xml
+++ b/b2g/config/aries-l/sources.xml
@@ -16,31 +16,31 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="be4b291a90b371b41b62ade68c31ad173bb87baa">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="0f86914b89cf8a069533e66b218533a17bad6b43"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="6b1fb5b730b1299f99f9194c1fcf088579cc7977"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="755656d9a7c79c6463920ad13f95d71e45e21397"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="ad086223028d281b2ea95f0f42f23ff4435917dd"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="94d88f335cdc90bf43471bacf243006e99cff908"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="ac160a43fddd833d4a0bc430f44f8b1956bac1e9"/>
   <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="966dbeff106bf36966d4c80a4f2c58a464ae314e"/>
@@ -160,34 +160,34 @@
   <project name="platform/hardware/qcom/wlan" path="hardware/qcom/wlan" revision="82d8c482d59926ff27c53f1fcc8a0ce3554e5491"/>
   <project name="platform/hardware/ril" path="hardware/ril" revision="4782b037af55a8d61078305df6a4c31c1424623c"/>
   <project name="platform_external_libnfc-nci" path="external/libnfc-nci" remote="b2g" revision="cac2be832f7bf748d8f0de7eac93009ef7c2eea9"/>
   <project name="hardware_qcom_display" path="hardware/qcom/display" remote="b2g" revision="9312b15e14ee19686ec7eac7b4cf2035199e92a6"/>
   <project name="platform_hardware_broadcom_libbt" path="hardware/broadcom/libbt" remote="b2g" revision="c927f10590b39bfe35976e01aed0969afeed3ba8"/>
   <project name="platform_hardware_libhardware" path="hardware/libhardware" remote="b2g" revision="c4bdd7888f2ab3069f6f8853915a806ebd390320"/>
   <project name="platform_system_nfcd" path="system/nfcd" remote="b2g" revision="5f4b68c799927b6e078f987b12722c3a6ccd4a45"/>
   <!-- Sony platform specific things -->
-  <project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="f4f1a6f3260d88f11671d57b4b759c0831a5c764"/>
+  <project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="d42479bca4d8124c171ee3feb96521059a4c83b6"/>
   <project name="device-qcom-sepolicy" path="device/qcom/sepolicy" remote="b2g" revision="e0a1cce6a8559ccc88e15da148531d36e18ae5f7"/>
   <project name="android_external_busybox" path="external/busybox" remote="b2g" revision="757a15c84e7bf9897b908058f2e529fcffea73b8"/>
   <project groups="device" name="init_sh" path="hardware/sony/init_sh" remote="b2g" revision="58d94ebe3a2e9a1af4bc8c003cd6837e53cc4867"/>
   <project groups="device" name="macaddrsetup" path="hardware/sony/macaddrsetup" remote="b2g" revision="e7ee149283eaec32a525ee39b2ecdca46d502e77"/>
   <project groups="device" name="mkqcdtbootimg" path="hardware/sony/mkqcdtbootimg" remote="b2g" revision="4badb288cefe7cc708450c02fd4f6cab84c3ed98"/>
   <project groups="device" name="thermanager" path="hardware/sony/thermanager" remote="b2g" revision="ec9a2b6a7fe8254ecc3c2c4781e7304f3822e390"/>
   <project groups="device" name="timekeep" path="hardware/sony/timekeep" remote="b2g" revision="4cbb0abc00681f116f043584661307b5c4855a31"/>
   <project name="sony-camera-hal" path="hardware/qcom/camera" remote="b2g" revision="22805439075263b20b0aee1298e003187a9c180b"/>
   <!-- Shinano platform specific things -->
-  <project groups="device" name="device-sony-shinano" path="device/sony/shinano" remote="b2g" revision="b9b4ecf084414c1e6b5951a95ebcb24522fa74e3"/>
-  <project groups="device" name="device-sony-aries" path="device/sony/aries" remote="b2g" revision="56f665a19e35623d923949014bc15013d292fa37"/>
-  <project groups="device" name="device-sony-leo" path="device/sony/leo" remote="b2g" revision="3fdec3f02117be6b57d2f9c5946119f179119a51"/>
-  <project groups="device" name="device-sony-scorpion" path="device/sony/scorpion" remote="b2g" revision="b0cd32cb805637d2afda61b67d0421e2c39b2ffa"/>
-  <project groups="device" name="device-sony-sirius" path="device/sony/sirius" remote="b2g" revision="5e5c19c6cd7c042bcac41a2b30b3ad3eeb66e7ab"/>
+  <project groups="device" name="device-sony-shinano" path="device/sony/shinano" remote="b2g" revision="c373eddbddb25aa3224d8430659619576b0e54c4"/>
+  <project groups="device" name="device-sony-aries" path="device/sony/aries" remote="b2g" revision="aed7e4e66a7c9668955ace2c7fa5b85ad7c94cbb"/>
+  <project groups="device" name="device-sony-leo" path="device/sony/leo" remote="b2g" revision="05170fc3c6a21fd018e03b416f8ac6c48190b03b"/>
+  <project groups="device" name="device-sony-scorpion" path="device/sony/scorpion" remote="b2g" revision="6bbece711135d15e33fbfecf594ec278d97f7918"/>
+  <project groups="device" name="device-sony-sirius" path="device/sony/sirius" remote="b2g" revision="d6f1b8f60134152edac8a749f5c9807cc1683ac6"/>
   <!-- Rhine platform specific things -->
-  <project groups="device" name="device-sony-rhine" path="device/sony/rhine" remote="b2g" revision="4a9cd1f110d83b035cfea2e337504af9104cb67c"/>
-  <project groups="device" name="device-sony-honami" path="device/sony/honami" remote="b2g" revision="f8a9d6d3a2ce73d336453b71db591a82f72a2120"/>
-  <project groups="device" name="device-sony-amami" path="device/sony/amami" remote="b2g" revision="9f05cdc34e60df19fcd9189ff8a14f752dcf07b9"/>
+  <project groups="device" name="device-sony-rhine" path="device/sony/rhine" remote="b2g" revision="10ceff843640f883e859ff3095c8a4c399123757"/>
+  <project groups="device" name="device-sony-honami" path="device/sony/honami" remote="b2g" revision="8c5a498f5e8e999b9e40958f899f452b4757abb9"/>
+  <project groups="device" name="device-sony-amami" path="device/sony/amami" remote="b2g" revision="03541a6330a34b33b174fe473eddcfa6b100a87d"/>
   <!-- Yukon platform specific things -->
-  <project name="device-sony-yukon" path="device/sony/yukon" remote="b2g" revision="1e8e253c7e9b7b72118b4c7c15b9498014fc7c0e"/>
-  <project name="device-sony-tianchi" path="device/sony/tianchi" remote="b2g" revision="571afbafe2abf52e031c2484f38ca5f6f81a114a"/>
+  <project name="device-sony-yukon" path="device/sony/yukon" remote="b2g" revision="661f3d8416a8abb71f446ea2ff6dbe93bb9e513a"/>
+  <project name="device-sony-tianchi" path="device/sony/tianchi" remote="b2g" revision="7dfcac7b8b51652a31e152ab68755a4714430d5a"/>
   <project name="device-sony-eagle" path="device/sony/eagle" remote="b2g" revision="b253fa75f0eeea10a1fa747fd98deb80ec71a654"/>
-  <project name="device-sony-flamingo" path="device/sony/flamingo" remote="b2g" revision="44fb20f16a9b1a44af6109dbfad2a975ca29fece"/>
+  <project name="device-sony-flamingo" path="device/sony/flamingo" remote="b2g" revision="a20d9dcf15863f09626dbe294c5971fe889b48e6"/>
   <project name="device-sony-seagull" path="device/sony/seagull" remote="b2g" revision="666810a3b77df8cd7a5e68e3d041052b6dd8cd22"/>
 </manifest>
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -16,31 +16,31 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="d3c9acb642baee501cff89e4efdb16b0c7480760">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="a32003194f707f66a2d8cdb913ed1869f1926c5d"/>
   <project name="device/common" path="device/common" revision="96d4d2006c4fcb2f19a3fa47ab10cb409faa017b"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -16,31 +16,31 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="d3c9acb642baee501cff89e4efdb16b0c7480760">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="83760d213fb3bec7b4117d266fcfbf6fe2ba14ab"/>
   <project name="device/common" path="device/common" revision="6a2995683de147791e516aae2ccb31fdfbe2ad30"/>
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -16,18 +16,18 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk-specific things and forks -->
   <project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -16,27 +16,27 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -16,30 +16,30 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="d3c9acb642baee501cff89e4efdb16b0c7480760">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="1950e4760fa14688b83cdbb5acaa1af9f82ef434"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="ac6eb97a37035c09fb5ede0852f0881e9aadf9ad"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="737f591c5f95477148d26602c7be56cbea0cdeb9"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="51da9b1981be481b92a59a826d4d78dc73d0989a"/>
   <project name="device/common" path="device/common" revision="798a3664597e6041985feab9aef42e98d458bc3d"/>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -16,30 +16,30 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="be4b291a90b371b41b62ade68c31ad173bb87baa">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="8af5ff6f5dced9eb5a8127459df6c75d24342204"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="30915518fa7ea07166efedc191a4f40aef516fe7"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="96eee58e3389fb05a835310d6a06a6ba4486097a"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="7c8a46698171aa2e0be09edb43d15a6acf832770"/>
   <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="24b2038be8a636fd4a5d21f0abae1e466b07bcf7"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -16,18 +16,18 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk-specific things and forks -->
   <project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -16,31 +16,31 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="d3c9acb642baee501cff89e4efdb16b0c7480760">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="a32003194f707f66a2d8cdb913ed1869f1926c5d"/>
   <project name="device/common" path="device/common" revision="96d4d2006c4fcb2f19a3fa47ab10cb409faa017b"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "4023297b16fdc46de3ddb04be4f3c575313d1cde", 
+        "git_revision": "77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "1520b4ebcfc727b7153be5242339b8f577ab65b4", 
+    "revision": "256902cd676226f40965b353e0ec12e9b0372290", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4-kk/sources.xml
+++ b/b2g/config/nexus-4-kk/sources.xml
@@ -16,31 +16,31 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="d3c9acb642baee501cff89e4efdb16b0c7480760">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="1950e4760fa14688b83cdbb5acaa1af9f82ef434"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="ac6eb97a37035c09fb5ede0852f0881e9aadf9ad"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="737f591c5f95477148d26602c7be56cbea0cdeb9"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="51da9b1981be481b92a59a826d4d78dc73d0989a"/>
   <project name="device/common" path="device/common" revision="798a3664597e6041985feab9aef42e98d458bc3d"/>
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -16,28 +16,28 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="660169a3d7e034a892359e39135e8c2785a6ad6f">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -16,31 +16,31 @@
   <remote fetch="https://git.mozilla.org/external/linaro" name="linaro"/>
   <!--original fetch url was git://github.com/mozilla/-->
   <remote fetch="https://git.mozilla.org/b2g" name="mozilla"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!--
     B2G repositories for all targets
     -->
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="4023297b16fdc46de3ddb04be4f3c575313d1cde"/>
-  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="35dccb3127db8f39f20b985ad312d2cd44780669"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="77c0e08caa0dda8c6e50f6e7cbad9f79b320a3b0"/>
+  <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="4eb8f37d2239ea7746462aa603f585116a9eaa92"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="99c333dab00ed79baff9e1cf76b320aee8e1c123"/>
   <project name="platform_hardware_libhardware_moz" path="hardware/libhardware_moz" remote="b2g" revision="fdf3a143dc777e5f9d33a88373af7ea161d3b440"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="be4b291a90b371b41b62ade68c31ad173bb87baa">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="5f931350fbc87c3df9db8b0ceb37734b8b471593"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="48d8c7c950745f1b166b42125e6f0d3293d71636"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="bef0632ed8ae0e14aa535549ee472748320198ed"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="2d5b6b107d77a31935aa4fe53ba67a8574372672"/>
   <!-- Stock Android things -->
   <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="ffc05a232799fe8fcb3e47b7440b52b1fb4244c0"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="337e0ef5e40f02a1ae59b90db0548976c70a7226"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="8af5ff6f5dced9eb5a8127459df6c75d24342204"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="30915518fa7ea07166efedc191a4f40aef516fe7"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="96eee58e3389fb05a835310d6a06a6ba4486097a"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="7c8a46698171aa2e0be09edb43d15a6acf832770"/>
   <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="24b2038be8a636fd4a5d21f0abae1e466b07bcf7"/>
--- a/browser/base/content/sanitize.js
+++ b/browser/base/content/sanitize.js
@@ -690,17 +690,18 @@ Sanitizer.onStartup = Task.async(functio
      .jsclient;
 
   shutdownClient.addBlocker("sanitize.js: Sanitize on shutdown",
     () => Sanitizer.onShutdown());
 
     // One time migration to remove support for the clear saved passwords on exit feature.
     if (!Services.prefs.getBoolPref("privacy.sanitize.migrateClearSavedPwdsOnExit")) {
       let deprecatedPref = "privacy.clearOnShutdown.passwords";
-      let doUpdate = Services.prefs.prefHasUserValue(deprecatedPref) &&
+      let doUpdate = Services.prefs.getBoolPref("privacy.sanitize.sanitizeOnShutdown") &&
+                     Services.prefs.prefHasUserValue(deprecatedPref) &&
                      Services.prefs.getBoolPref(deprecatedPref);
       if (doUpdate) {
         Services.logins.removeAllLogins();
         Services.prefs.setBoolPref("signon.rememberSignons", false);
       }
       Services.prefs.clearUserPref(deprecatedPref);
       Services.prefs.setBoolPref("privacy.sanitize.migrateClearSavedPwdsOnExit", true);
   }
--- a/devtools/shared/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl
+++ b/devtools/shared/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl
@@ -23,13 +23,13 @@ union OpenHeapSnapshotTempFileResponse
 
 sync protocol PHeapSnapshotTempFileHelper
 {
     manager PContent;
 
 parent:
     sync OpenHeapSnapshotTempFile() returns (OpenHeapSnapshotTempFileResponse response);
 
-    __delete__();
+    async __delete__();
 };
 
 } // namespace devtools
 } // namespace mozilla
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -261,19 +261,19 @@ static uint32_t gValidateOrigin = 0xffff
 
 // Hint for native dispatch of events on how long to delay after
 // all documents have loaded in milliseconds before favoring normal
 // native event dispatch priorites over performance
 // Can be overridden with docshell.event_starvation_delay_hint pref.
 #define NS_EVENT_STARVATION_DELAY_HINT 2000
 
 #ifdef DEBUG
-static PRLogModuleInfo* gDocShellLog;
+static mozilla::LazyLogModule gDocShellLog("nsDocShell");
 #endif
-static PRLogModuleInfo* gDocShellLeakLog;
+static mozilla::LazyLogModule gDocShellLeakLog("nsDocShellLeak");;
 
 const char kBrandBundleURL[]      = "chrome://branding/locale/brand.properties";
 const char kAppstringsBundleURL[] = "chrome://global/locale/appstrings.properties";
 
 static void
 FavorPerformanceHint(bool aPerfOverStarvation)
 {
   nsCOMPtr<nsIAppShell> appShell = do_GetService(kAppShellCID);
@@ -813,27 +813,17 @@ nsDocShell::nsDocShell()
   mHistoryID = ++gDocshellIDCounter;
   if (gDocShellCount++ == 0) {
     NS_ASSERTION(sURIFixup == nullptr,
                  "Huh, sURIFixup not null in first nsDocShell ctor!");
 
     CallGetService(NS_URIFIXUP_CONTRACTID, &sURIFixup);
   }
 
-#ifdef DEBUG
-  if (!gDocShellLog) {
-    gDocShellLog = PR_NewLogModule("nsDocShell");
-  }
-#endif
-  if (!gDocShellLeakLog) {
-    gDocShellLeakLog = PR_NewLogModule("nsDocShellLeak");
-  }
-  if (gDocShellLeakLog) {
-    MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this));
-  }
+  MOZ_LOG(gDocShellLeakLog, LogLevel::Debug, ("DOCSHELL %p created\n", this));
 
 #ifdef DEBUG
   // We're counting the number of |nsDocShells| to help find leaks
   ++gNumberOfDocShells;
   if (!PR_GetEnv("MOZ_QUIET")) {
     printf_stderr("++DOCSHELL %p == %ld [pid = %d] [id = %llu]\n",
                   (void*)this,
                   gNumberOfDocShells,
--- a/docshell/shistory/nsSHistory.cpp
+++ b/docshell/shistory/nsSHistory.cpp
@@ -54,36 +54,29 @@ static PRCList gSHistoryList;
 // Max viewers allowed total, across all SHistory objects - negative default
 // means we will calculate how many viewers to cache based on total memory
 int32_t nsSHistory::sHistoryMaxTotalViewers = -1;
 
 // A counter that is used to be able to know the order in which
 // entries were touched, so that we can evict older entries first.
 static uint32_t gTouchCounter = 0;
 
-static PRLogModuleInfo*
-GetSHistoryLog()
-{
-  static PRLogModuleInfo* sLog;
-  if (!sLog) {
-    sLog = PR_NewLogModule("nsSHistory");
-  }
-  return sLog;
-}
-#define LOG(format) MOZ_LOG(GetSHistoryLog(), mozilla::LogLevel::Debug, format)
+static LazyLogModule gSHistoryLog("nsSHistory");
+
+#define LOG(format) MOZ_LOG(gSHistoryLog, mozilla::LogLevel::Debug, format)
 
 // This macro makes it easier to print a log message which includes a URI's
 // spec.  Example use:
 //
 //  nsIURI *uri = [...];
 //  LOG_SPEC(("The URI is %s.", _spec), uri);
 //
 #define LOG_SPEC(format, uri)                              \
   PR_BEGIN_MACRO                                           \
-    if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) {     \
+    if (MOZ_LOG_TEST(gSHistoryLog, LogLevel::Debug)) {     \
       nsAutoCString _specStr(NS_LITERAL_CSTRING("(null)"));\
       if (uri) {                                           \
         uri->GetSpec(_specStr);                            \
       }                                                    \
       const char* _spec = _specStr.get();                  \
       LOG(format);                                         \
     }                                                      \
   PR_END_MACRO
@@ -91,17 +84,17 @@ GetSHistoryLog()
 // This macro makes it easy to log a message including an SHEntry's URI.
 // For example:
 //
 //  nsCOMPtr<nsISHEntry> shentry = [...];
 //  LOG_SHENTRY_SPEC(("shentry %p has uri %s.", shentry.get(), _spec), shentry);
 //
 #define LOG_SHENTRY_SPEC(format, shentry)                  \
   PR_BEGIN_MACRO                                           \
-    if (MOZ_LOG_TEST(GetSHistoryLog(), LogLevel::Debug)) {     \
+    if (MOZ_LOG_TEST(gSHistoryLog, LogLevel::Debug)) {     \
       nsCOMPtr<nsIURI> uri;                                \
       shentry->GetURI(getter_AddRefs(uri));                \
       LOG_SPEC(format, uri);                               \
     }                                                      \
   PR_END_MACRO
 
 // Iterates over all registered session history listeners.
 #define ITERATE_LISTENERS(body)                            \
--- a/dom/animation/AnimationEffectTimingReadOnly.cpp
+++ b/dom/animation/AnimationEffectTimingReadOnly.cpp
@@ -1,29 +1,58 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim:set ts=2 sw=2 sts=2 et cindent: */
 /* 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 "mozilla/dom/AnimationEffectTimingReadOnly.h"
+
+#include "mozilla/dom/AnimatableBinding.h"
 #include "mozilla/dom/AnimationEffectTimingReadOnlyBinding.h"
+#include "mozilla/dom/KeyframeEffectBinding.h"
 
 namespace mozilla {
 
-TimingParams&
-TimingParams::operator=(const dom::AnimationEffectTimingProperties& aRhs)
+TimingParams::TimingParams(const dom::AnimationEffectTimingProperties& aRhs)
+  : mDuration(aRhs.mDuration)
+  , mDelay(TimeDuration::FromMilliseconds(aRhs.mDelay))
+  , mIterations(aRhs.mIterations)
+  , mDirection(aRhs.mDirection)
+  , mFill(aRhs.mFill)
+{
+}
+
+TimingParams::TimingParams(double aDuration)
+{
+  mDuration.SetAsUnrestrictedDouble() = aDuration;
+}
+
+/* static */ TimingParams
+TimingParams::FromOptionsUnion(
+  const dom::UnrestrictedDoubleOrKeyframeEffectOptions& aOptions)
 {
-  mDuration = aRhs.mDuration;
-  mDelay = TimeDuration::FromMilliseconds(aRhs.mDelay);
-  mIterations = aRhs.mIterations;
-  mDirection = aRhs.mDirection;
-  mFill = aRhs.mFill;
+  if (aOptions.IsUnrestrictedDouble()) {
+    return TimingParams(aOptions.GetAsUnrestrictedDouble());
+  } else {
+    MOZ_ASSERT(aOptions.IsKeyframeEffectOptions());
+    return TimingParams(aOptions.GetAsKeyframeEffectOptions());
+  }
+}
 
-  return *this;
+/* static */ TimingParams
+TimingParams::FromOptionsUnion(
+  const dom::UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions)
+{
+  if (aOptions.IsUnrestrictedDouble()) {
+    return TimingParams(aOptions.GetAsUnrestrictedDouble());
+  } else {
+    MOZ_ASSERT(aOptions.IsKeyframeAnimationOptions());
+    return TimingParams(aOptions.GetAsKeyframeAnimationOptions());
+  }
 }
 
 bool
 TimingParams::operator==(const TimingParams& aOther) const
 {
   bool durationEqual;
   if (mDuration.IsUnrestrictedDouble()) {
     durationEqual = aOther.mDuration.IsUnrestrictedDouble() &&
--- a/dom/animation/AnimationEffectTimingReadOnly.h
+++ b/dom/animation/AnimationEffectTimingReadOnly.h
@@ -19,28 +19,42 @@
 #ifdef None
 #undef None
 #endif
 #include "mozilla/dom/AnimationEffectReadOnlyBinding.h"  // for FillMode
                                                          // and PlaybackDirection
 
 namespace mozilla {
 
+namespace dom {
+struct AnimationEffectTimingProperties;
+class UnrestrictedDoubleOrKeyframeEffectOptions;
+class UnrestrictedDoubleOrKeyframeAnimationOptions;
+}
+
 struct TimingParams
 {
+  TimingParams() = default;
+  explicit TimingParams(
+    const dom::AnimationEffectTimingProperties& aTimingProperties);
+  explicit TimingParams(double aDuration);
+
+  static TimingParams FromOptionsUnion(
+    const dom::UnrestrictedDoubleOrKeyframeEffectOptions& aOptions);
+  static TimingParams FromOptionsUnion(
+    const dom::UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions);
+
   // The unitialized state of mDuration represents "auto".
   // Bug 1237173: We will replace this with Maybe<TimeDuration>.
   dom::OwningUnrestrictedDoubleOrString mDuration;
   TimeDuration mDelay;      // Initializes to zero
   double mIterations = 1.0; // Can be NaN, negative, +/-Infinity
   dom::PlaybackDirection mDirection = dom::PlaybackDirection::Normal;
   dom::FillMode mFill = dom::FillMode::Auto;
 
-  TimingParams& operator=(const dom::AnimationEffectTimingProperties& aRhs);
-
   bool operator==(const TimingParams& aOther) const;
   bool operator!=(const TimingParams& aOther) const
   {
     return !(*this == aOther);
   }
 };
 
 
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -645,31 +645,16 @@ DumpAnimationProperties(nsTArray<Animati
       printf("  %f..%f: %s..%s\n", s.mFromKey, s.mToKey,
              NS_ConvertUTF16toUTF8(fromValue).get(),
              NS_ConvertUTF16toUTF8(toValue).get());
     }
   }
 }
 #endif
 
-/* static */ TimingParams
-KeyframeEffectReadOnly::ConvertKeyframeEffectOptions(
-    const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions)
-{
-  TimingParams timing;
-
-  if (aOptions.IsKeyframeEffectOptions()) {
-    timing = aOptions.GetAsKeyframeEffectOptions();
-  } else {
-    timing.mDuration.SetAsUnrestrictedDouble() =
-      aOptions.GetAsUnrestrictedDouble();
-  }
-  return timing;
-}
-
 /**
  * A property and StyleAnimationValue pair.
  */
 struct KeyframeValue
 {
   nsCSSProperty mProperty;
   StyleAnimationValue mValue;
 };
@@ -1636,43 +1621,42 @@ BuildAnimationPropertyListFromPropertyIn
  *   that is the keyframe list specification.
  * @param aResult The array into which the resulting AnimationProperty
  *   objects will be appended.
  */
 /* static */ void
 KeyframeEffectReadOnly::BuildAnimationPropertyList(
     JSContext* aCx,
     Element* aTarget,
-    const Optional<JS::Handle<JSObject*>>& aFrames,
+    JS::Handle<JSObject*> aFrames,
     InfallibleTArray<AnimationProperty>& aResult,
     ErrorResult& aRv)
 {
   MOZ_ASSERT(aResult.IsEmpty());
 
   // A frame list specification in the IDL is:
   //
   // (PropertyIndexedKeyframes or sequence<Keyframe> or SharedKeyframeList)
   //
   // We don't support SharedKeyframeList yet, but we do the other two.  We
   // manually implement the parts of JS-to-IDL union conversion algorithm
   // from the Web IDL spec, since we have to represent this an object? so
   // we can look at the open-ended set of properties on a
   // PropertyIndexedKeyframes or Keyframe.
 
-  if (!aFrames.WasPassed() || !aFrames.Value().get()) {
-    // The argument was omitted, or was explicitly null.  In both cases,
-    // the default dictionary value for PropertyIndexedKeyframes would
-    // result in no keyframes.
+  if (!aFrames) {
+    // The argument was explicitly null.  In this case, the default dictionary
+    // value for PropertyIndexedKeyframes would result in no keyframes.
     return;
   }
 
   // At this point we know we have an object.  We try to convert it to a
   // sequence<Keyframe> first, and if that fails due to not being iterable,
   // we try to convert it to PropertyIndexedKeyframes.
-  JS::Rooted<JS::Value> objectValue(aCx, JS::ObjectValue(*aFrames.Value()));
+  JS::Rooted<JS::Value> objectValue(aCx, JS::ObjectValue(*aFrames));
   JS::ForOfIterator iter(aCx);
   if (!iter.init(objectValue, JS::ForOfIterator::AllowNonIterable)) {
     aRv.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   if (iter.valueIsIterable()) {
     BuildAnimationPropertyListFromKeyframeSequence(aCx, aTarget, iter,
@@ -1683,40 +1667,38 @@ KeyframeEffectReadOnly::BuildAnimationPr
                                                            aRv);
   }
 }
 
 /* static */ already_AddRefed<KeyframeEffectReadOnly>
 KeyframeEffectReadOnly::Constructor(
     const GlobalObject& aGlobal,
     Element* aTarget,
-    const Optional<JS::Handle<JSObject*>>& aFrames,
-    const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
+    JS::Handle<JSObject*> aFrames,
+    const TimingParams& aTiming,
     ErrorResult& aRv)
 {
   if (!aTarget) {
     // We don't support null targets yet.
     aRv.Throw(NS_ERROR_DOM_ANIM_NO_TARGET_ERR);
     return nullptr;
   }
 
-  TimingParams timing = ConvertKeyframeEffectOptions(aOptions);
-
   InfallibleTArray<AnimationProperty> animationProperties;
   BuildAnimationPropertyList(aGlobal.Context(), aTarget, aFrames,
                              animationProperties, aRv);
 
   if (aRv.Failed()) {
     return nullptr;
   }
 
   RefPtr<KeyframeEffectReadOnly> effect =
     new KeyframeEffectReadOnly(aTarget->OwnerDoc(), aTarget,
                                nsCSSPseudoElements::ePseudo_NotPseudoElement,
-                               timing);
+                               aTiming);
   effect->mProperties = Move(animationProperties);
   return effect.forget();
 }
 
 void
 KeyframeEffectReadOnly::GetFrames(JSContext*& aCx,
                                   nsTArray<JSObject*>& aResult,
                                   ErrorResult& aRv)
--- a/dom/animation/KeyframeEffect.h
+++ b/dom/animation/KeyframeEffect.h
@@ -184,19 +184,33 @@ public:
   {
     return nullptr;
   }
 
   // KeyframeEffectReadOnly interface
   static already_AddRefed<KeyframeEffectReadOnly>
   Constructor(const GlobalObject& aGlobal,
               Element* aTarget,
-              const Optional<JS::Handle<JSObject*>>& aFrames,
+              JS::Handle<JSObject*> aFrames,
               const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions,
+              ErrorResult& aRv)
+  {
+    return Constructor(aGlobal, aTarget, aFrames,
+                       TimingParams::FromOptionsUnion(aOptions), aRv);
+  }
+
+  // More generalized version for Animatable.animate.
+  // Not exposed to content.
+  static already_AddRefed<KeyframeEffectReadOnly>
+  Constructor(const GlobalObject& aGlobal,
+              Element* aTarget,
+              JS::Handle<JSObject*> aFrames,
+              const TimingParams& aTiming,
               ErrorResult& aRv);
+
   Element* GetTarget() const {
     // Currently we never return animations from the API whose effect
     // targets a pseudo-element so this should never be called when
     // mPseudoType is not 'none' (see bug 1174575).
     MOZ_ASSERT(mPseudoType == nsCSSPseudoElements::ePseudo_NotPseudoElement,
                "Requesting the target of a KeyframeEffect that targets a"
                " pseudo-element is not yet supported.");
     return mTarget;
@@ -328,23 +342,20 @@ protected:
   // (b) It is "relevant" (i.e. yet to finish but not idle, or finished but
   //     filling forwards)
   //
   // As a result, we need to make sure this gets called whenever anything
   // changes with regards to this effects's timing including changes to the
   // owning Animation's timing.
   void UpdateTargetRegistration();
 
-  static TimingParams ConvertKeyframeEffectOptions(
-    const UnrestrictedDoubleOrKeyframeEffectOptions& aOptions);
-
   static void BuildAnimationPropertyList(
     JSContext* aCx,
     Element* aTarget,
-    const Optional<JS::Handle<JSObject*>>& aFrames,
+    JS::Handle<JSObject*> aFrames,
     InfallibleTArray<AnimationProperty>& aResult,
     ErrorResult& aRv);
 
   nsCOMPtr<Element> mTarget;
   RefPtr<Animation> mAnimation;
 
   OwningNonNull<AnimationEffectTimingReadOnly> mTiming;
   nsCSSPseudoElements::Type mPseudoType;
--- a/dom/animation/test/chrome.ini
+++ b/dom/animation/test/chrome.ini
@@ -1,9 +1,12 @@
 [DEFAULT]
 support-files =
   testcommon.js
   ../../imptests/testharness.js
   ../../imptests/testharnessreport.js
+[chrome/test_animate_xrays.html]
+# file_animate_xrays.html needs to go in mochitest.ini since it is served
+# over HTTP
 [chrome/test_animation_observers.html]
 [chrome/test_restyles.html]
 [chrome/test_running_on_compositor.html]
 skip-if = buildapp == 'b2g'
new file mode 100644
--- /dev/null
+++ b/dom/animation/test/chrome/file_animate_xrays.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<html>
+<head>
+<meta charset=utf-8>
+<script>
+Element.prototype.animate = function() {
+  throw 'Called animate() as defined in content document';
+}
+// Bug 1211783: Use KeyframeEffect (not KeyframeEffectReadOnly) here
+for (var obj of [KeyframeEffectReadOnly, Animation]) {
+  obj = function() {
+    throw 'Called overridden ' + String(obj) + ' constructor';
+  };
+}
+</script>
+<body>
+<div id="target"></div>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/dom/animation/test/chrome/test_animate_xrays.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<head>
+<meta charset=utf-8>
+<script type="application/javascript" src="../testharness.js"></script>
+<script type="application/javascript" src="../testharnessreport.js"></script>
+<script type="application/javascript" src="../testcommon.js"></script>
+</head>
+<body>
+<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1045994"
+  target="_blank">Mozilla Bug 1045994</a>
+<div id="log"></div>
+<iframe id="iframe"
+  src="http://example.org/tests/dom/animation/test/chrome/file_animate_xrays.html"></iframe>
+<script>
+'use strict';
+
+var win = document.getElementById('iframe').contentWindow;
+
+async_test(function(t) {
+  window.addEventListener('load', t.step_func(function() {
+    var target = win.document.getElementById('target');
+    var anim = target.animate({ opacity: [ 0, 1 ] }, 2000);
+    // In the x-ray case, the frames object will be given an opaque wrapper
+    // so it won't be possible to fetch any frames from it.
+    assert_equals(anim.effect.getFrames().length, 0);
+    t.done();
+  }));
+}, 'Calling animate() across x-rays');
+
+</script>
+</body>
--- a/dom/animation/test/mochitest.ini
+++ b/dom/animation/test/mochitest.ini
@@ -1,11 +1,14 @@
 [DEFAULT]
+# Support files for chrome tests that we want to load over HTTP need
+# to go in here, not chrome.ini.
 support-files =
   testcommon.js
+  chrome/file_animate_xrays.html
 
 [css-animations/test_animations-dynamic-changes.html]
 support-files = css-animations/file_animations-dynamic-changes.html
 [css-animations/test_animation-cancel.html]
 support-files = css-animations/file_animation-cancel.html
 [css-animations/test_animation-computed-timing.html]
 support-files = css-animations/file_animation-computed-timing.html
 [css-animations/test_animation-currenttime.html]
--- a/dom/asmjscache/PAsmJSCacheEntry.ipdl
+++ b/dom/asmjscache/PAsmJSCacheEntry.ipdl
@@ -14,25 +14,25 @@ namespace asmjscache {
 protocol PAsmJSCacheEntry
 {
   manager PBackground;
 
   // When the cache is opened to read, the parent process sends over the
   // origin's Metadata so the child process can select the cache entry to open
   // (based on hash) and notify the parent (via SelectCacheFileToRead).
 child:
-  OnOpenMetadataForRead(Metadata metadata);
+  async OnOpenMetadataForRead(Metadata metadata);
 parent:
-  SelectCacheFileToRead(uint32_t moduleIndex);
-  CacheMiss();
+  async SelectCacheFileToRead(uint32_t moduleIndex);
+  async CacheMiss();
 
 child:
   // Once the cache file has been opened, the child is notified and sent an
   // open file descriptor.
-  OnOpenCacheFile(int64_t fileSize, FileDescriptor fileDesc);
+  async OnOpenCacheFile(int64_t fileSize, FileDescriptor fileDesc);
 
 both:
-  __delete__(AsmJSCacheResult result);
+  async __delete__(AsmJSCacheResult result);
 };
 
 } // namespace asmjscache
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -16,16 +16,17 @@
 #include "mozilla/DebugOnly.h"
 #include "mozilla/dom/Animation.h"
 #include "mozilla/dom/Attr.h"
 #include "nsDOMAttributeMap.h"
 #include "nsIAtom.h"
 #include "nsIContentInlines.h"
 #include "mozilla/dom/NodeInfo.h"
 #include "nsIDocumentInlines.h"
+#include "mozilla/dom/DocumentTimeline.h"
 #include "nsIDOMNodeList.h"
 #include "nsIDOMDocument.h"
 #include "nsIContentIterator.h"
 #include "nsFocusManager.h"
 #include "nsFrameManager.h"
 #include "nsILinkHandler.h"
 #include "nsIScriptGlobalObject.h"
 #include "nsIURL.h"
@@ -46,16 +47,17 @@
 #include "nsVariant.h"
 #include "nsDOMSettableTokenList.h"
 #include "nsDOMTokenList.h"
 #include "nsXBLPrototypeBinding.h"
 #include "nsError.h"
 #include "nsDOMString.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsIDOMMutationEvent.h"
+#include "mozilla/dom/AnimatableBinding.h"
 #include "mozilla/AnimationComparator.h"
 #include "mozilla/AsyncEventDispatcher.h"
 #include "mozilla/ContentEvents.h"
 #include "mozilla/EffectSet.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/EventListenerManager.h"
 #include "mozilla/EventStateManager.h"
 #include "mozilla/EventStates.h"
@@ -3304,16 +3306,68 @@ Element::MozRequestFullScreen(JSContext*
 }
 
 void
 Element::MozRequestPointerLock()
 {
   OwnerDoc()->RequestPointerLock(this);
 }
 
+already_AddRefed<Animation>
+Element::Animate(JSContext* aContext,
+                 JS::Handle<JSObject*> aFrames,
+                 const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
+                 ErrorResult& aError)
+{
+  nsCOMPtr<nsIGlobalObject> ownerGlobal = GetOwnerGlobal();
+  if (!ownerGlobal) {
+    aError.Throw(NS_ERROR_FAILURE);
+    return nullptr;
+  }
+  GlobalObject global(aContext, ownerGlobal->GetGlobalJSObject());
+  MOZ_ASSERT(!global.Failed());
+
+  // Wrap the aFrames object for the cross-compartment case.
+  JS::Rooted<JSObject*> frames(aContext);
+  frames = aFrames;
+  Maybe<JSAutoCompartment> ac;
+  if (js::GetContextCompartment(aContext) !=
+      js::GetObjectCompartment(ownerGlobal->GetGlobalJSObject())) {
+    ac.emplace(aContext, ownerGlobal->GetGlobalJSObject());
+    if (!JS_WrapObject(aContext, &frames)) {
+      return nullptr;
+    }
+  }
+
+  // Bug 1211783: Use KeyframeEffect here (instead of KeyframeEffectReadOnly)
+  RefPtr<KeyframeEffectReadOnly> effect =
+    KeyframeEffectReadOnly::Constructor(global, this, frames,
+      TimingParams::FromOptionsUnion(aOptions), aError);
+  if (aError.Failed()) {
+    return nullptr;
+  }
+
+  RefPtr<Animation> animation =
+    Animation::Constructor(global, effect, OwnerDoc()->Timeline(), aError);
+  if (aError.Failed()) {
+    return nullptr;
+  }
+
+  if (aOptions.IsKeyframeAnimationOptions()) {
+    animation->SetId(aOptions.GetAsKeyframeAnimationOptions().mId);
+  }
+
+  animation->Play(aError, Animation::LimitBehavior::AutoRewind);
+  if (aError.Failed()) {
+    return nullptr;
+  }
+
+  return animation.forget();
+}
+
 void
 Element::GetAnimations(nsTArray<RefPtr<Animation>>& aAnimations)
 {
   nsIDocument* doc = GetComposedDoc();
   if (doc) {
     doc->FlushPendingNotifications(Flush_Style);
   }
 
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -52,16 +52,17 @@ class nsGlobalWindow;
 class nsICSSDeclaration;
 class nsISMILAttr;
 class nsDocument;
 
 namespace mozilla {
 namespace dom {
   struct ScrollIntoViewOptions;
   struct ScrollToOptions;
+  class UnrestrictedDoubleOrKeyframeAnimationOptions;
 } // namespace dom
 } // namespace mozilla
 
 
 already_AddRefed<nsContentList>
 NS_GetContentList(nsINode* aRootNode,
                   int32_t  aMatchNameSpaceId,
                   const nsAString& aTagname);
@@ -820,16 +821,22 @@ public:
   {
     return false;
   }
 
   virtual void SetUndoScope(bool aUndoScope, ErrorResult& aError)
   {
   }
 
+  already_AddRefed<Animation> Animate(
+    JSContext* aContext,
+    JS::Handle<JSObject*> aFrames,
+    const UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions,
+    ErrorResult& aError);
+
   // Note: GetAnimations will flush style while GetAnimationsUnsorted won't.
   void GetAnimations(nsTArray<RefPtr<Animation>>& aAnimations);
   void GetAnimationsUnsorted(nsTArray<RefPtr<Animation>>& aAnimations);
 
   NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML);
   virtual void SetInnerHTML(const nsAString& aInnerHTML, ErrorResult& aError);
   void GetOuterHTML(nsAString& aOuterHTML);
   void SetOuterHTML(const nsAString& aOuterHTML, ErrorResult& aError);
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -101,16 +101,17 @@
 #include "nsIDOMStyleSheet.h"
 #include "nsIStyleSheetService.h"
 #include "nsContentPermissionHelper.h"
 #include "nsNetUtil.h"
 #include "nsDocument.h"
 #include "HTMLImageElement.h"
 #include "mozilla/css/ImageLoader.h"
 #include "mozilla/layers/APZCTreeManager.h" // for layers::ZoomToRectBehavior
+#include "mozilla/dom/Promise.h"
 
 #ifdef XP_WIN
 #undef GetClassName
 #endif
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::ipc;
@@ -2145,36 +2146,39 @@ nsDOMWindowUtils::GetLayerManagerRemote(
   if (!mgr)
     return NS_ERROR_FAILURE;
 
   *retval = !!mgr->AsShadowForwarder();
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsDOMWindowUtils::GetSupportsHardwareH264Decoding(nsAString& aRetval)
+nsDOMWindowUtils::GetSupportsHardwareH264Decoding(JS::MutableHandle<JS::Value> aPromise)
 {
+  nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mWindow);
+  NS_ENSURE_STATE(window);
+  nsCOMPtr<nsIGlobalObject> parentObject = do_QueryInterface(window);
+  NS_ENSURE_STATE(parentObject);
 #ifdef MOZ_FMP4
   nsCOMPtr<nsIWidget> widget = GetWidget();
-  if (!widget)
-    return NS_ERROR_FAILURE;
-
+  NS_ENSURE_STATE(widget);
   LayerManager *mgr = widget->GetLayerManager();
-  if (!mgr)
-    return NS_ERROR_FAILURE;
-
-  nsCString failureReason;
-  if (MP4Decoder::IsVideoAccelerated(mgr->GetCompositorBackendType(), failureReason)) {
-    aRetval.AssignLiteral("Yes");
-  } else {
-    aRetval.AssignLiteral("No; ");
-    AppendUTF8toUTF16(failureReason, aRetval);
+  NS_ENSURE_STATE(mgr);
+  RefPtr<Promise> promise =
+    MP4Decoder::IsVideoAccelerated(mgr->GetCompositorBackendType(), parentObject);
+  NS_ENSURE_STATE(promise);
+  aPromise.setObject(*promise->GetWrapper());
+#else
+  ErrorResult rv;
+  RefPtr<Promise> promise = Promise::Create(parentObject, rv);
+  if (rv.Failed()) {
+    return rv.StealNSResult();
   }
-#else
-  aRetval.AssignLiteral("No; Compiled without MP4 support.");
+  promise.MaybeResolve(NS_LITERAL_STRING("No; Compiled without MP4 support."));
+  aPromise.setObject(*promise->GetWrapper());
 #endif
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::StartFrameTimeRecording(uint32_t *startIndex)
 {
   NS_ENSURE_ARG_POINTER(startIndex);
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -3271,22 +3271,27 @@ nsObjectLoadingContent::ShouldPlay(Fallb
   if (!sPrefsInitialized) {
     Preferences::AddUintVarCache(&sSessionTimeoutMinutes,
                                  "plugin.sessionPermissionNow.intervalInMinutes", 60);
     Preferences::AddUintVarCache(&sPersistentTimeoutDays,
                                  "plugin.persistentPermissionAlways.intervalInDays", 90);
     sPrefsInitialized = true;
   }
 
-  if (XRE_IsParentProcess() &&
-      BrowserTabsRemoteAutostart()) {
-    // Plugins running OOP from the chrome process along with plugins running
-    // OOP from the content process will hang. Let's prevent that situation.
-    aReason = eFallbackDisabled;
-    return false;
+  if (BrowserTabsRemoteAutostart()) {
+    bool shouldLoadInParent = nsPluginHost::ShouldLoadTypeInParent(mContentType);
+    bool inParent = XRE_IsParentProcess();
+
+    if (shouldLoadInParent != inParent) {
+      // Plugins need to be locked to either the parent process or the content
+      // process. If a plugin is locked to one process type, it can't be used in
+      // the other. Otherwise we'll get hangs.
+      aReason = eFallbackDisabled;
+      return false;
+    }
   }
 
   RefPtr<nsPluginHost> pluginHost = nsPluginHost::GetInst();
 
   // at this point if it's not a plugin, we let it play/fallback
   if (!aIgnoreCurrentType && mType != eType_Plugin) {
     return true;
   }
--- a/dom/bluetooth/ipc/PBluetooth.ipdl
+++ b/dom/bluetooth/ipc/PBluetooth.ipdl
@@ -540,63 +540,63 @@ protocol PBluetooth
    *   3. NotificationsStopped  (Parent -> Child)
    *   4. __delete__()          (Child  -> Parent)
    */
 
 child:
   /**
    * Sent when a settings change has enabled or disabled the bluetooth firmware.
    */
-  Enabled(bool enabled);
+  async Enabled(bool enabled);
 
   /**
    * Sent when a bluetooth signal is broadcasted to child processes.
    */
-  Notify(BluetoothSignal signal);
+  async Notify(BluetoothSignal signal);
 
   /**
    * Sent when the parent process is about to be shut down. See shutdown note
    * above.
    */
-  BeginShutdown();
+  async BeginShutdown();
 
   /**
    * Sent to inform the child process that it will no longer receive any
    * messages from the parent. See shutdown note above.
    */
-  NotificationsStopped();
+  async NotificationsStopped();
 
 parent:
   /**
    * Sent when the child no longer needs to use bluetooth. See shutdown note
    * above.
    */
-  __delete__();
+  async __delete__();
 
   /**
    * Sent when the child needs to receive signals related to the given node.
    */
-  RegisterSignalHandler(nsString node);
+  async RegisterSignalHandler(nsString node);
 
   /**
    * Sent when the child no longer needs to receive signals related to the given
    * node.
    */
-  UnregisterSignalHandler(nsString node);
+  async UnregisterSignalHandler(nsString node);
 
   /**
    * Sent when the child no longer needs to receive any messages from the
    * parent. See shutdown note above.
    */
-  StopNotifying();
+  async StopNotifying();
 
   /**
    * Sent when the child makes an asynchronous request to the parent.
    */
-  PBluetoothRequest(Request request);
+  async PBluetoothRequest(Request request);
 
   /**
    * FIXME: Bug 547703.
    *
    * This is the state machine we want:
    *
    * start state NOTIFYING:
    *   send Enabled goto NOTIFYING;
--- a/dom/bluetooth/ipc/PBluetoothRequest.ipdl
+++ b/dom/bluetooth/ipc/PBluetoothRequest.ipdl
@@ -15,14 +15,14 @@ namespace bluetooth {
 protocol PBluetoothRequest
 {
   manager PBluetooth;
 
 child:
   /**
    * Sent when the asynchronous request has completed.
    */
-  __delete__(BluetoothReply response);
+  async __delete__(BluetoothReply response);
 };
 
 } // namespace bluetooth
 } // namespace dom
 } // namespace mozilla
--- a/dom/broadcastchannel/PBroadcastChannel.ipdl
+++ b/dom/broadcastchannel/PBroadcastChannel.ipdl
@@ -12,18 +12,18 @@ namespace mozilla {
 namespace dom {
 
 // This protocol is used for the BroadcastChannel API
 protocol PBroadcastChannel
 {
   manager PBackground;
 
 parent:
-  PostMessage(ClonedMessageData message);
-  Close();
+  async PostMessage(ClonedMessageData message);
+  async Close();
 
 child:
-  Notify(ClonedMessageData message);
-  __delete__();
+  async Notify(ClonedMessageData message);
+  async __delete__();
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/cache/CacheStorage.cpp
+++ b/dom/cache/CacheStorage.cpp
@@ -114,16 +114,17 @@ IsTrusted(const PrincipalInfo& aPrincipa
   nsresult rv = urlParser->ParseURL(url, flatURL.Length(),
                                     &schemePos, &schemeLen,
                                     &authPos, &authLen,
                                     nullptr, nullptr);      // ignore path
   if (NS_WARN_IF(NS_FAILED(rv))) { return false; }
 
   nsAutoCString scheme(Substring(flatURL, schemePos, schemeLen));
   if (scheme.LowerCaseEqualsLiteral("https") ||
+      scheme.LowerCaseEqualsLiteral("app") ||
       scheme.LowerCaseEqualsLiteral("file")) {
     return true;
   }
 
   uint32_t hostPos;
   int32_t hostLen;
 
   rv = urlParser->ParseAuthority(url + authPos, authLen,
--- a/dom/cache/PCache.ipdl
+++ b/dom/cache/PCache.ipdl
@@ -17,19 +17,19 @@ namespace cache {
 
 protocol PCache
 {
   manager PBackground;
   manages PCacheOp;
   manages PCachePushStream;
 
 parent:
-  PCacheOp(CacheOpArgs aOpArgs);
-  PCachePushStream();
-  Teardown();
+  async PCacheOp(CacheOpArgs aOpArgs);
+  async PCachePushStream();
+  async Teardown();
 
 child:
-  __delete__();
+  async __delete__();
 };
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
--- a/dom/cache/PCacheOp.ipdl
+++ b/dom/cache/PCacheOp.ipdl
@@ -16,14 +16,14 @@ namespace mozilla {
 namespace dom {
 namespace cache {
 
 protocol PCacheOp
 {
   manager PCache or PCacheStorage;
 
 child:
-  __delete__(ErrorResult aRv, CacheOpResult aResult);
+  async __delete__(ErrorResult aRv, CacheOpResult aResult);
 };
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
--- a/dom/cache/PCachePushStream.ipdl
+++ b/dom/cache/PCachePushStream.ipdl
@@ -8,21 +8,21 @@ namespace mozilla {
 namespace dom {
 namespace cache {
 
 protocol PCachePushStream
 {
   manager PCache;
 
 parent:
-  Buffer(nsCString aBuffer);
-  Close(nsresult aRv);
+  async Buffer(nsCString aBuffer);
+  async Close(nsresult aRv);
 
 child:
   // Stream is always destroyed from the parent side.  This occurs if the
   // parent encounters an error while writing to its pipe or if the child
   // signals the stream should close by SendClose().
-  __delete__();
+  async __delete__();
 };
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
--- a/dom/cache/PCacheStorage.ipdl
+++ b/dom/cache/PCacheStorage.ipdl
@@ -17,18 +17,18 @@ namespace dom {
 namespace cache {
 
 protocol PCacheStorage
 {
   manager PBackground;
   manages PCacheOp;
 
 parent:
-  PCacheOp(CacheOpArgs aOpArgs);
-  Teardown();
+  async PCacheOp(CacheOpArgs aOpArgs);
+  async Teardown();
 
 child:
-  __delete__();
+  async __delete__();
 };
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
--- a/dom/cache/PCacheStreamControl.ipdl
+++ b/dom/cache/PCacheStreamControl.ipdl
@@ -10,19 +10,19 @@ namespace mozilla {
 namespace dom {
 namespace cache {
 
 protocol PCacheStreamControl
 {
   manager PBackground;
 
 parent:
-  NoteClosed(nsID aStreamId);
+  async NoteClosed(nsID aStreamId);
 
 child:
-  Close(nsID aStreamId);
-  CloseAll();
-  __delete__();
+  async Close(nsID aStreamId);
+  async CloseAll();
+  async __delete__();
 };
 
 } // namespace cache
 } // namespace dom
 } // namespace mozilla
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -412,17 +412,18 @@ TypeUtils::ProcessURL(nsACString& aUrl, 
   aRv = urlParser->ParseURL(url, flatURL.Length(), &schemePos, &schemeLen,
                             nullptr, nullptr,       // ignore authority
                             &pathPos, &pathLen);
   if (NS_WARN_IF(aRv.Failed())) { return; }
 
   if (aSchemeValidOut) {
     nsAutoCString scheme(Substring(flatURL, schemePos, schemeLen));
     *aSchemeValidOut = scheme.LowerCaseEqualsLiteral("http") ||
-                       scheme.LowerCaseEqualsLiteral("https");
+                       scheme.LowerCaseEqualsLiteral("https") ||
+                       scheme.LowerCaseEqualsLiteral("app");
   }
 
   uint32_t queryPos;
   int32_t queryLen;
 
   aRv = urlParser->ParsePath(url + pathPos, flatURL.Length() - pathPos,
                              nullptr, nullptr,               // ignore filepath
                              &queryPos, &queryLen,
--- a/dom/canvas/WebGLTexture.cpp
+++ b/dom/canvas/WebGLTexture.cpp
@@ -737,18 +737,37 @@ WebGLTexture::GenerateMipmap(TexTarget t
     }
 
     if (format->hasDepth) {
         mContext->ErrorInvalidOperation("generateMipmap: Depth textures are not"
                                         " supported.");
         return;
     }
 
-    if (!baseImageInfo.mFormat->isRenderable || !baseImageInfo.mFormat->isFilterable) {
-        mContext->ErrorInvalidOperation("generateMipmap: Texture at base level is not"
+    // OpenGL ES 3.0.4 p160:
+    // If the level base array was not specified with an unsized internal format from
+    // table 3.3 or a sized internal format that is both color-renderable and
+    // texture-filterable according to table 3.13, an INVALID_OPERATION error
+    // is generated.
+    const auto usage = baseImageInfo.mFormat;
+    bool canGenerateMipmap = (usage->isRenderable && usage->isFilterable);
+    switch (usage->format->effectiveFormat) {
+    case webgl::EffectiveFormat::Luminance8:
+    case webgl::EffectiveFormat::Alpha8:
+    case webgl::EffectiveFormat::Luminance8Alpha8:
+        // Non-color-renderable formats from Table 3.3.
+        canGenerateMipmap = true;
+        break;
+    default:
+        break;
+    }
+
+    if (!canGenerateMipmap) {
+        mContext->ErrorInvalidOperation("generateMipmap: Texture at base level is not unsized"
+                                        " internal format or is not"
                                         " color-renderable or texture-filterable.");
         return;
     }
 
     // Done with validation. Do the operation.
 
     mContext->MakeContextCurrent();
     gl::GLContext* gl = mContext->gl;
--- a/dom/cellbroadcast/ipc/PCellBroadcast.ipdl
+++ b/dom/cellbroadcast/ipc/PCellBroadcast.ipdl
@@ -9,33 +9,33 @@ include protocol PContent;
 namespace mozilla {
 namespace dom {
 namespace cellbroadcast {
 
 sync protocol PCellBroadcast {
   manager PContent;
 
 child:
-  NotifyReceivedMessage(uint32_t aServiceId,
-                        uint32_t aGsmGeographicalScope,
-                        uint16_t aMessageCode,
-                        uint16_t aMessageId,
-                        nsString aLanguage,
-                        nsString aBody,
-                        uint32_t aMessageClass,
-                        uint64_t aTimestamp,
-                        uint32_t aCdmaServiceCategory,
-                        bool aHasEtwsInfo,
-                        uint32_t aEtwsWarningType,
-                        bool aEtwsEmergencyUserAlert,
-                        bool aEtwsPopup);
+  async NotifyReceivedMessage(uint32_t aServiceId,
+                              uint32_t aGsmGeographicalScope,
+                              uint16_t aMessageCode,
+                              uint16_t aMessageId,
+                              nsString aLanguage,
+                              nsString aBody,
+                              uint32_t aMessageClass,
+                              uint64_t aTimestamp,
+                              uint32_t aCdmaServiceCategory,
+                              bool aHasEtwsInfo,
+                              uint32_t aEtwsWarningType,
+                              bool aEtwsEmergencyUserAlert,
+                              bool aEtwsPopup);
 
 parent:
   /**
    * Sent when the child no longer needs to use cellbroadcast.
    */
-  __delete__();
+  async __delete__();
 
 };
 
 } // namespace mobilemessage
 } // namespace dom
-} // namespace cellbroadcast
\ No newline at end of file
+} // namespace cellbroadcast
--- a/dom/datastore/DataStoreService.cpp
+++ b/dom/datastore/DataStoreService.cpp
@@ -155,42 +155,36 @@ DeleteDatabase(const nsAString& aName,
                const nsAString& aManifestURL)
 {
   MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
 
   RefPtr<DataStoreDB> db = new DataStoreDB(aManifestURL, aName);
   db->Delete();
 }
 
-PLDHashOperator
-DeleteDataStoresAppEnumerator(
-                             const uint32_t& aAppId,
-                             nsAutoPtr<DataStoreInfo>& aInfo,
-                             void* aUserData)
+static void
+DeleteDataStoresHelper(nsClassHashtable<nsStringHashKey, HashApp>& aStores,
+                       uint32_t aAppId)
 {
   MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
 
-  auto* appId = static_cast<uint32_t*>(aUserData);
-  if (*appId != aAppId) {
-    return PL_DHASH_NEXT;
-  }
-
-  DeleteDatabase(aInfo->mName, aInfo->mManifestURL);
-  return PL_DHASH_REMOVE;
-}
+  for (auto iter1 = aStores.Iter(); !iter1.Done(); iter1.Next()) {
+    nsAutoPtr<HashApp>& apps = iter1.Data();
+    for (auto iter2 = apps->Iter(); !iter2.Done(); iter2.Next()) {
+      if (aAppId == iter2.Key()) {
+        nsAutoPtr<DataStoreInfo>& info = iter2.Data();
+        DeleteDatabase(info->mName, info->mManifestURL);
+        iter2.Remove();
+      }
+    }
 
-PLDHashOperator
-DeleteDataStoresEnumerator(const nsAString& aName,
-                           nsAutoPtr<HashApp>& aApps,
-                           void* aUserData)
-{
-  MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
-
-  aApps->Enumerate(DeleteDataStoresAppEnumerator, aUserData);
-  return aApps->Count() ? PL_DHASH_NEXT : PL_DHASH_REMOVE;
+    if (apps->Count() == 0) {
+      iter1.Remove();
+    }
+  }
 }
 
 void
 GeneratePermissionName(nsAString& aPermission,
                        const nsAString& aName,
                        const nsAString& aManifestURL)
 {
   aPermission.AssignLiteral("indexedDB-chrome-");
@@ -1159,18 +1153,18 @@ DataStoreService::CheckPermission(nsIPri
 }
 
 // This method is called when an app with DataStores is deleted.
 void
 DataStoreService::DeleteDataStores(uint32_t aAppId)
 {
   MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
 
-  mStores.Enumerate(DeleteDataStoresEnumerator, &aAppId);
-  mAccessStores.Enumerate(DeleteDataStoresEnumerator, &aAppId);
+  DeleteDataStoresHelper(mStores, aAppId);
+  DeleteDataStoresHelper(mAccessStores, aAppId);
 }
 
 NS_IMETHODIMP
 DataStoreService::Observe(nsISupports* aSubject,
                           const char* aTopic,
                           const char16_t* aData)
 {
   MOZ_ASSERT(XRE_IsParentProcess() && NS_IsMainThread());
--- a/dom/devicestorage/PDeviceStorageRequest.ipdl
+++ b/dom/devicestorage/PDeviceStorageRequest.ipdl
@@ -80,14 +80,14 @@ union DeviceStorageResponseValue
   FormatStorageResponse;
   MountStorageResponse;
   UnmountStorageResponse;
 };
 
 sync protocol PDeviceStorageRequest {
     manager PContent;
 child:
-    __delete__(DeviceStorageResponseValue response);
+    async __delete__(DeviceStorageResponseValue response);
 };
 
 } // namespace devicestorage
 } // namespace dom
 } // namespace mozilla
--- a/dom/filehandle/PBackgroundFileHandle.ipdl
+++ b/dom/filehandle/PBackgroundFileHandle.ipdl
@@ -69,23 +69,23 @@ union FileRequestParams
 
 protocol PBackgroundFileHandle
 {
   manager PBackgroundMutableFile;
 
   manages PBackgroundFileRequest;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
-  Finish();
-  Abort();
+  async Finish();
+  async Abort();
 
-  PBackgroundFileRequest(FileRequestParams params);
+  async PBackgroundFileRequest(FileRequestParams params);
 
 child:
-  __delete__();
+  async __delete__();
 
-  Complete(bool aborted);
+  async Complete(bool aborted);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/filehandle/PBackgroundFileRequest.ipdl
+++ b/dom/filehandle/PBackgroundFileRequest.ipdl
@@ -68,16 +68,16 @@ union FileRequestResponse
   FileRequestGetFileResponse;
 };
 
 protocol PBackgroundFileRequest
 {
   manager PBackgroundFileHandle;
 
 child:
-  __delete__(FileRequestResponse response);
+  async __delete__(FileRequestResponse response);
 
-  Progress(uint64_t progress,
-           uint64_t progressMax);
+  async Progress(uint64_t progress,
+                 uint64_t progressMax);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/filehandle/PBackgroundMutableFile.ipdl
+++ b/dom/filehandle/PBackgroundMutableFile.ipdl
@@ -15,22 +15,22 @@ namespace dom {
 
 sync protocol PBackgroundMutableFile
 {
   manager PBackgroundIDBDatabase;
 
   manages PBackgroundFileHandle;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
-  PBackgroundFileHandle(FileMode mode);
+  async PBackgroundFileHandle(FileMode mode);
 
   // Use only for testing!
   sync GetFileId()
     returns (int64_t fileId);
 
 child:
-  __delete__();
+  async __delete__();
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/filesystem/PFileSystemRequest.ipdl
+++ b/dom/filesystem/PFileSystemRequest.ipdl
@@ -44,13 +44,13 @@ union FileSystemResponseValue
   FileSystemErrorResponse;
 };
 
 sync protocol PFileSystemRequest
 {
   manager PContent;
 
 child:
-  __delete__(FileSystemResponseValue response);
+  async __delete__(FileSystemResponseValue response);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/fmradio/ipc/PFMRadio.ipdl
+++ b/dom/fmradio/ipc/PFMRadio.ipdl
@@ -66,47 +66,47 @@ sync protocol PFMRadio
 {
   manager PContent;
   manages PFMRadioRequest;
 
 child:
   /**
    * Sent when the frequency is changed.
    */
-  NotifyFrequencyChanged(double frequency);
+  async NotifyFrequencyChanged(double frequency);
   /**
    * Sent when the power state of FM radio HW is changed.
    */
-  NotifyEnabledChanged(bool enabled, double frequency);
+  async NotifyEnabledChanged(bool enabled, double frequency);
   /**
    * Sent when RDS is enabled or disabled.
    */
-  NotifyRDSEnabledChanged(bool enabled);
+  async NotifyRDSEnabledChanged(bool enabled);
   /**
    * Sent when we have a new PI code.
    */
-  NotifyPIChanged(bool valid, uint16_t code);
+  async NotifyPIChanged(bool valid, uint16_t code);
   /**
    * Sent when we have a new PTY
    */
-  NotifyPTYChanged(bool valid, uint8_t pty);
+  async NotifyPTYChanged(bool valid, uint8_t pty);
   /**
    * Sent when we have a new PS name.
    */
-  NotifyPSChanged(nsString psname);
+  async NotifyPSChanged(nsString psname);
   /**
    * Sent when we have new radiotext.
    */
-  NotifyRadiotextChanged(nsString radiotext);
+  async NotifyRadiotextChanged(nsString radiotext);
   /**
    * Sent when a full RDS group is received.
    */
-  NotifyNewRDSGroup(uint64_t data);
+  async NotifyNewRDSGroup(uint64_t data);
 
-  __delete__();
+  async __delete__();
 
 parent:
   /**
    * Get the current status infomation of FM radio HW synchronously.
    * Sent when the singleton object of FMRadioChild is initialized.
    */
   sync GetStatusInfo() returns (StatusInfo info);
 
@@ -114,24 +114,24 @@ parent:
    * Send request to parent process to operate the FM radio HW.
    *
    * We don't have separate Enable/SetFrequency/etc. methods instead here,
    * because we can leverage the IPC messaging mechanism to manage the mapping
    * of the asynchronous request and the DOMRequest we returned to the caller
    * on web content, otherwise, we have to do the mapping stuff manually which
    * is more error prone.
    */
-  PFMRadioRequest(FMRadioRequestArgs requestType);
+  async PFMRadioRequest(FMRadioRequestArgs requestType);
 
   /**
    * Enable/Disable audio
    */
-  EnableAudio(bool audioEnabled);
+  async EnableAudio(bool audioEnabled);
 
   /**
    * Set RDS group mask
    */
-  SetRDSGroupMask(uint32_t groupMask);
+  async SetRDSGroupMask(uint32_t groupMask);
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/fmradio/ipc/PFMRadioRequest.ipdl
+++ b/dom/fmradio/ipc/PFMRadioRequest.ipdl
@@ -30,14 +30,14 @@ union FMRadioResponseType
  * When the request completed, the result, i.e. FMRadioResponseType, will be
  * sent back to child from parent in the `__delete__` message.
  */
 async protocol PFMRadioRequest
 {
   manager PFMRadio;
 
 child:
-  __delete__(FMRadioResponseType response);
+  async __delete__(FMRadioResponseType response);
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/html/HTMLFormElement.cpp
+++ b/dom/html/HTMLFormElement.cpp
@@ -1485,34 +1485,30 @@ HTMLFormElement::RemoveElementFromTableI
     if (node) {
       aTable.Put(aName, node);
     }
   }
 
   return NS_OK;
 }
 
-static PLDHashOperator
-RemovePastNames(const nsAString& aName,
-                nsCOMPtr<nsISupports>& aData,
-                void* aClosure)
-{
-  return aClosure == aData ? PL_DHASH_REMOVE : PL_DHASH_NEXT;
-}
-
 nsresult
 HTMLFormElement::RemoveElementFromTable(nsGenericHTMLFormElement* aElement,
                                         const nsAString& aName,
                                         RemoveElementReason aRemoveReason)
 {
   // If the element is being removed from the form, we have to remove it from
   // the past names map.
   if (aRemoveReason == ElementRemoved) {
     uint32_t oldCount = mPastNameLookupTable.Count();
-    mPastNameLookupTable.Enumerate(RemovePastNames, aElement);
+    for (auto iter = mPastNameLookupTable.Iter(); !iter.Done(); iter.Next()) {
+      if (static_cast<void*>(aElement) == iter.Data()) {
+        iter.Remove();
+      }
+    }
     if (oldCount != mPastNameLookupTable.Count()) {
       ++mExpandoAndGeneration.generation;
     }
   }
 
   return mControls->RemoveElementFromTable(aElement, aName);
 }
 
@@ -2524,17 +2520,21 @@ HTMLFormElement::RemoveImageElement(HTML
 nsresult
 HTMLFormElement::RemoveImageElementFromTable(HTMLImageElement* aElement,
                                              const nsAString& aName,
                                              RemoveElementReason aRemoveReason)
 {
   // If the element is being removed from the form, we have to remove it from
   // the past names map.
   if (aRemoveReason == ElementRemoved) {
-    mPastNameLookupTable.Enumerate(RemovePastNames, aElement);
+    for (auto iter = mPastNameLookupTable.Iter(); !iter.Done(); iter.Next()) {
+      if (static_cast<void*>(aElement) == iter.Data()) {
+        iter.Remove();
+      }
+    }
   }
 
   return RemoveElementFromTableInternal(mImageNameLookupTable, aElement, aName);
 }
 
 void
 HTMLFormElement::AddToPastNamesMap(const nsAString& aName,
                                    nsISupports* aChild)
--- a/dom/icc/ipc/PIcc.ipdl
+++ b/dom/icc/ipc/PIcc.ipdl
@@ -89,74 +89,74 @@ sync protocol PIcc
 {
   manager PContent;
   manages PIccRequest;
 
 child:
   /**
    * Notify CardStateChanged with updated CardState.
    */
-  NotifyCardStateChanged(uint32_t aCardState);
+  async NotifyCardStateChanged(uint32_t aCardState);
 
   /**
    * Notify IccInfoChanged with updated IccInfo.
    */
-  NotifyIccInfoChanged(OptionalIccInfoData aInfoData);
+  async NotifyIccInfoChanged(OptionalIccInfoData aInfoData);
 
   /**
    * Notify STK proactive command issue by selected UICC.
    *
    * @param aStkProactiveCmd
    *        a MozStkCommand instance serialized in JSON.
    */
-  NotifyStkCommand(nsString aStkProactiveCmd);
+  async NotifyStkCommand(nsString aStkProactiveCmd);
 
   /**
    * Notify that STK session is ended by selected UICC.
    */
-  NotifyStkSessionEnd();
+  async NotifyStkSessionEnd();
 
 parent:
   /**
    * Sent when the child no longer needs to use PIcc.
    */
-  __delete__();
+  async __delete__();
 
   /**
    * Sent when the child makes an asynchronous request to the parent.
    */
-  PIccRequest(IccRequest aRequest);
+  async PIccRequest(IccRequest aRequest);
 
   /**
    * Send STK response to the selected UICC.
    *
    * @param aCommand
    *        a MozStkCommand instance serialized in JSON.
    * @param aResponse
    *        a MozStkResponse instance serialized in JSON.
    */
-  StkResponse(nsString aCommand, nsString aResponse);
+  async StkResponse(nsString aCommand, nsString aResponse);
 
   /**
    * Send STK Menu Selection to the selected UICC.
    */
-  StkMenuSelection(uint16_t aItemIdentifier, bool aHelpRequested);
+  async StkMenuSelection(uint16_t aItemIdentifier, bool aHelpRequested);
 
   /**
    * Send STK Timer Expiration to the selected UICC.
    */
-  StkTimerExpiration(uint16_t aTimerId, uint32_t aTimerValue);
+  async StkTimerExpiration(uint16_t aTimerId, uint32_t aTimerValue);
 
   /**
    * Send STK Event Download to the selected UICC.
    *
    * @param aEvent
    *        a MozStkXxxEvent instance serialized in JSON.
    */
-  StkEventDownload(nsString aEvent);
+  async StkEventDownload(nsString aEvent);
 
   /**
    * Sync call to initialize the updated IccInfo/CardState.
    */
   sync Init()
      returns (OptionalIccInfoData aInfoData, uint32_t aCardState);
 
 };
--- a/dom/icc/ipc/PIccRequest.ipdl
+++ b/dom/icc/ipc/PIccRequest.ipdl
@@ -60,14 +60,14 @@ union IccReply
 protocol PIccRequest
 {
   manager PIcc;
 
 child:
   /**
    * Sent when the asynchronous request has completed.
    */
-  __delete__(IccReply response);
+  async __delete__(IccReply response);
 };
 
 } // namespace icc
 } // namespace dom
 } // namespace mozilla
\ No newline at end of file
--- a/dom/indexedDB/PBackgroundIDBCursor.ipdl
+++ b/dom/indexedDB/PBackgroundIDBCursor.ipdl
@@ -73,21 +73,21 @@ union CursorResponse
   IndexKeyCursorResponse;
 };
 
 protocol PBackgroundIDBCursor
 {
   manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
-  Continue(CursorRequestParams params, Key key);
+  async Continue(CursorRequestParams params, Key key);
 
 child:
-  __delete__();
+  async __delete__();
 
-  Response(CursorResponse response);
+  async Response(CursorResponse response);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBDatabase.ipdl
+++ b/dom/indexedDB/PBackgroundIDBDatabase.ipdl
@@ -48,38 +48,38 @@ sync protocol PBackgroundIDBDatabase
 
   manages PBackgroundIDBDatabaseFile;
   manages PBackgroundIDBDatabaseRequest;
   manages PBackgroundIDBTransaction;
   manages PBackgroundIDBVersionChangeTransaction;
   manages PBackgroundMutableFile;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
-  Blocked();
+  async Blocked();
 
-  Close();
+  async Close();
 
-  PBackgroundIDBDatabaseFile(PBlob blob);
+  async PBackgroundIDBDatabaseFile(PBlob blob);
 
-  PBackgroundIDBDatabaseRequest(DatabaseRequestParams params);
+  async PBackgroundIDBDatabaseRequest(DatabaseRequestParams params);
 
-  PBackgroundIDBTransaction(nsString[] objectStoreNames, Mode mode);
+  async PBackgroundIDBTransaction(nsString[] objectStoreNames, Mode mode);
 
 child:
-  __delete__();
+  async __delete__();
 
-  VersionChange(uint64_t oldVersion, NullableVersion newVersion);
+  async VersionChange(uint64_t oldVersion, NullableVersion newVersion);
 
-  Invalidate();
+  async Invalidate();
 
-  PBackgroundIDBVersionChangeTransaction(uint64_t currentVersion,
-                                         uint64_t requestedVersion,
-                                         int64_t nextObjectStoreId,
-                                         int64_t nextIndexId);
+  async PBackgroundIDBVersionChangeTransaction(uint64_t currentVersion,
+                                               uint64_t requestedVersion,
+                                               int64_t nextObjectStoreId,
+                                               int64_t nextIndexId);
 
-  PBackgroundMutableFile(nsString name, nsString type);
+  async PBackgroundMutableFile(nsString name, nsString type);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBDatabaseFile.ipdl
+++ b/dom/indexedDB/PBackgroundIDBDatabaseFile.ipdl
@@ -8,14 +8,14 @@ namespace mozilla {
 namespace dom {
 namespace indexedDB {
 
 protocol PBackgroundIDBDatabaseFile
 {
   manager PBackgroundIDBDatabase;
 
 parent:
-  __delete__();
+  async __delete__();
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBDatabaseRequest.ipdl
+++ b/dom/indexedDB/PBackgroundIDBDatabaseRequest.ipdl
@@ -20,14 +20,14 @@ union DatabaseRequestResponse
   CreateFileRequestResponse;
 };
 
 protocol PBackgroundIDBDatabaseRequest
 {
   manager PBackgroundIDBDatabase;
 
 child:
-  __delete__(DatabaseRequestResponse response);
+  async __delete__(DatabaseRequestResponse response);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBFactory.ipdl
+++ b/dom/indexedDB/PBackgroundIDBFactory.ipdl
@@ -44,24 +44,24 @@ union FactoryRequestParams
 sync protocol PBackgroundIDBFactory
 {
   manager PBackground;
 
   manages PBackgroundIDBDatabase;
   manages PBackgroundIDBFactoryRequest;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
-  PBackgroundIDBFactoryRequest(FactoryRequestParams params);
+  async PBackgroundIDBFactoryRequest(FactoryRequestParams params);
 
-  IncrementLoggingRequestSerialNumber();
+  async IncrementLoggingRequestSerialNumber();
 
 child:
-  __delete__();
+  async __delete__();
 
-  PBackgroundIDBDatabase(DatabaseSpec spec,
-                         PBackgroundIDBFactoryRequest request);
+  async PBackgroundIDBDatabase(DatabaseSpec spec,
+                               PBackgroundIDBFactoryRequest request);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBFactoryRequest.ipdl
+++ b/dom/indexedDB/PBackgroundIDBFactoryRequest.ipdl
@@ -28,21 +28,21 @@ union FactoryRequestResponse
   DeleteDatabaseRequestResponse;
 };
 
 protocol PBackgroundIDBFactoryRequest
 {
   manager PBackgroundIDBFactory;
 
 child:
-  __delete__(FactoryRequestResponse response);
+  async __delete__(FactoryRequestResponse response);
 
-  PermissionChallenge(PrincipalInfo principalInfo);
+  async PermissionChallenge(PrincipalInfo principalInfo);
 
-  Blocked(uint64_t currentVersion);
+  async Blocked(uint64_t currentVersion);
 
 parent:
-  PermissionRetry();
+  async PermissionRetry();
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBRequest.ipdl
+++ b/dom/indexedDB/PBackgroundIDBRequest.ipdl
@@ -100,14 +100,14 @@ union RequestResponse
   IndexCountResponse;
 };
 
 protocol PBackgroundIDBRequest
 {
   manager PBackgroundIDBTransaction or PBackgroundIDBVersionChangeTransaction;
 
 child:
-  __delete__(RequestResponse response);
+  async __delete__(RequestResponse response);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBTransaction.ipdl
+++ b/dom/indexedDB/PBackgroundIDBTransaction.ipdl
@@ -17,26 +17,26 @@ namespace indexedDB {
 protocol PBackgroundIDBTransaction
 {
   manager PBackgroundIDBDatabase;
 
   manages PBackgroundIDBCursor;
   manages PBackgroundIDBRequest;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
-  Commit();
-  Abort(nsresult resultCode);
+  async Commit();
+  async Abort(nsresult resultCode);
 
-  PBackgroundIDBCursor(OpenCursorParams params);
+  async PBackgroundIDBCursor(OpenCursorParams params);
 
-  PBackgroundIDBRequest(RequestParams params);
+  async PBackgroundIDBRequest(RequestParams params);
 
 child:
-  __delete__();
+  async __delete__();
 
-  Complete(nsresult result);
+  async Complete(nsresult result);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl
+++ b/dom/indexedDB/PBackgroundIDBVersionChangeTransaction.ipdl
@@ -18,34 +18,34 @@ namespace indexedDB {
 protocol PBackgroundIDBVersionChangeTransaction
 {
   manager PBackgroundIDBDatabase;
 
   manages PBackgroundIDBCursor;
   manages PBackgroundIDBRequest;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
-  Commit();
-  Abort(nsresult resultCode);
+  async Commit();
+  async Abort(nsresult resultCode);
 
-  CreateObjectStore(ObjectStoreMetadata metadata);
-  DeleteObjectStore(int64_t objectStoreId);
+  async CreateObjectStore(ObjectStoreMetadata metadata);
+  async DeleteObjectStore(int64_t objectStoreId);
 
-  CreateIndex(int64_t objectStoreId,
-              IndexMetadata metadata);
-  DeleteIndex(int64_t objectStoreId,
-              int64_t indexId);
+  async CreateIndex(int64_t objectStoreId,
+                    IndexMetadata metadata);
+  async DeleteIndex(int64_t objectStoreId,
+                    int64_t indexId);
 
-  PBackgroundIDBCursor(OpenCursorParams params);
+  async PBackgroundIDBCursor(OpenCursorParams params);
 
-  PBackgroundIDBRequest(RequestParams params);
+  async PBackgroundIDBRequest(RequestParams params);
 
 child:
-  __delete__();
+  async __delete__();
 
-  Complete(nsresult result);
+  async Complete(nsresult result);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PBackgroundIndexedDBUtils.ipdl
+++ b/dom/indexedDB/PBackgroundIndexedDBUtils.ipdl
@@ -13,25 +13,25 @@ namespace mozilla {
 namespace dom {
 namespace indexedDB {
 
 sync protocol PBackgroundIndexedDBUtils
 {
   manager PBackground;
 
 parent:
-  DeleteMe();
+  async DeleteMe();
 
   // Use only for testing!
   sync GetFileReferences(PersistenceType persistenceType,
                          nsCString origin,
                          nsString databaseName,
                          int64_t fileId)
     returns (int32_t refCnt, int32_t dBRefCnt, int32_t sliceRefCnt,
              bool result);
 
 child:
-  __delete__();
+  async __delete__();
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/PIndexedDBPermissionRequest.ipdl
+++ b/dom/indexedDB/PIndexedDBPermissionRequest.ipdl
@@ -14,14 +14,14 @@ protocol PIndexedDBPermissionRequest
 
 child:
   /**
    * Called when the user makes a choice or the permission request times out.
    *
    * @param permission
    *   The permission result (see nsIPermissionManager.idl for valid values).
    */
-  __delete__(uint32_t permission);
+  async __delete__(uint32_t permission);
 };
 
 } // namespace indexedDB
 } // namespace dom
 } // namespace mozilla
--- a/dom/indexedDB/test/mochitest.ini
+++ b/dom/indexedDB/test/mochitest.ini
@@ -129,23 +129,23 @@ skip-if = (buildapp == 'b2g' && toolkit 
 [test_blob_file_backed.html]
 # This test can only run in the main process.
 skip-if = buildapp == 'b2g' || e10s
 [test_blob_simple.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_blob_worker_crash.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_blob_worker_xhr_post.html]
-skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_blob_worker_xhr_post_multifile.html]
-skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_blob_worker_xhr_read.html]
-skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_blob_worker_xhr_read_slice.html]
-skip-if = ((buildapp == 'b2g' && toolkit != 'gonk') || (e10s && toolkit == 'windows')) # Bug 931116
+skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_blocked_order.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_bug937006.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_clear.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
 [test_complex_keyPaths.html]
 skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Bug 931116
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -44,17 +44,17 @@ interface nsIDOMClientRect;
 interface nsIURI;
 interface nsIDOMEventTarget;
 interface nsIRunnable;
 interface nsITranslationNodeList;
 interface nsIJSRAIIHelper;
 interface nsIContentPermissionRequest;
 interface nsIObserver;
 
-[scriptable, uuid(ca6a458c-82e7-4979-886e-6d214eac6f0b)]
+[scriptable, uuid(46b44e33-13c2-4eb3-bf80-76a4e0857ccc)]
 interface nsIDOMWindowUtils : nsISupports {
 
   /**
    * Image animation mode of the window. When this attribute's value
    * is changed, the implementation should set all images in the window
    * to the given value. That is, when set to kDontAnimMode, all images
    * will stop animating. The attribute's value must be one of the
    * animationMode values from imgIContainer.
@@ -1329,21 +1329,22 @@ interface nsIDOMWindowUtils : nsISupport
   /**
    * True if the layer manager for the widget associated with this window is
    * forwarding layers to a remote compositor, false otherwise. Throws an
    * error if there is no widget associated with this window.
    */
   readonly attribute boolean layerManagerRemote;
 
   /**
-   * True if we can initialize a hardware-backed h264 decoder for a simple
-   * test video, does not mean that all h264 video decoding will be done
+   * Returns a Promise that will be resolved with a string once the capabilities
+   * of the h264 decoder have been determined.
+   * Success does not mean that all h264 video decoding will be done
    * in hardware.
    */
-  readonly attribute AString supportsHardwareH264Decoding;
+  readonly attribute jsval supportsHardwareH264Decoding;
 
   /**
    * Record (and return) frame-intervals for frames which were presented
    *   between calling StartFrameTimeRecording and StopFrameTimeRecording.
    *
    * - Uses a cyclic buffer and serves concurrent consumers, so if Stop is called too late
    *     (elements were overwritten since Start), result is considered invalid and hence empty.
    * - Buffer is capable of holding 10 seconds @ 60fps (or more if frames were less frequent).
--- a/dom/ipc/PBlob.ipdl
+++ b/dom/ipc/PBlob.ipdl
@@ -21,22 +21,22 @@ union ResolveMysteryParams
 };
 
 sync protocol PBlob
 {
   manager PBackground or PContent or PContentBridge;
   manages PBlobStream;
 
 both:
-  __delete__();
+  async __delete__();
 
 parent:
-  PBlobStream(uint64_t begin, uint64_t length);
+  async PBlobStream(uint64_t begin, uint64_t length);
 
-  ResolveMystery(ResolveMysteryParams params);
+  async ResolveMystery(ResolveMysteryParams params);
 
   sync BlobStreamSync(uint64_t begin, uint64_t length)
     returns (InputStreamParams params, OptionalFileDescriptorSet fds);
 
   sync WaitForSliceCreation();
 
   // Use only for testing!
   sync GetFileId()
@@ -44,13 +44,13 @@ parent:
 
   // Use only for testing!
   sync GetFilePath()
     returns (nsString filePath);
 
 child:
   // This method must be called by the parent when the PBlobParent is fully
   // created in order to release the known blob.
-  CreatedFromKnownBlob();
+  async CreatedFromKnownBlob();
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/PBlobStream.ipdl
+++ b/dom/ipc/PBlobStream.ipdl
@@ -9,13 +9,13 @@ include InputStreamParams;
 namespace mozilla {
 namespace dom {
 
 protocol PBlobStream
 {
   manager PBlob;
 
 child:
-  __delete__(InputStreamParams params, OptionalFileDescriptorSet fds);
+  async __delete__(InputStreamParams params, OptionalFileDescriptorSet fds);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/PBrowser.ipdl
+++ b/dom/ipc/PBrowser.ipdl
@@ -105,33 +105,33 @@ prio(normal upto urgent) sync protocol P
     manages PDocAccessible;
     manages PDocumentRenderer;
     manages PFilePicker;
     manages PIndexedDBPermissionRequest;
     manages PRenderFrame;
     manages PPluginWidget;
 
 both:
-    AsyncMessage(nsString aMessage, ClonedMessageData aData, CpowEntry[] aCpows,
-                 Principal aPrincipal);
+    async AsyncMessage(nsString aMessage, ClonedMessageData aData, CpowEntry[] aCpows,
+                       Principal aPrincipal);
 
     /**
      * Create a layout frame (encapsulating a remote layer tree) for
      * the page that is currently loaded in the <browser>.
      */
-    PRenderFrame();
+    async PRenderFrame();
 
 parent:
     /**
      * Tell the parent process a new accessible document has been created.
      * aParentDoc is the accessible document it was created in if any, and
      * aParentAcc is the id of the accessible in that document the new document
      * is a child of.
      */
-    PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc);
+    async PDocAccessible(nullable PDocAccessible aParentDoc, uint64_t aParentAcc);
 
     /*
      * Creates a new remoted nsIWidget connection for windowed plugins
      * in e10s mode. This is always initiated from the child in response
      * to windowed plugin creation.
      */
     sync PPluginWidget();
 
@@ -153,19 +153,19 @@ parent:
      */
     sync DispatchFocusToTopLevelWindow();
 
 parent:
     /**
      * When child sends this message, parent should move focus to
      * the next or previous focusable element or document.
      */
-    MoveFocus(bool forward, bool forDocumentNavigation);
+    async MoveFocus(bool forward, bool forDocumentNavigation);
 
-    Event(RemoteDOMEvent aEvent);
+    async Event(RemoteDOMEvent aEvent);
 
     sync SyncMessage(nsString aMessage, ClonedMessageData aData,
                      CpowEntry[] aCpows, Principal aPrincipal)
       returns (StructuredCloneData[] retval);
 
     prio(high) sync RpcMessage(nsString aMessage, ClonedMessageData aData,
                                CpowEntry[] aCpows, Principal aPrincipal)
       returns (StructuredCloneData[] retval);
@@ -290,25 +290,25 @@ parent:
      *  When plugin event isn't consumed, call this
      */
     async DefaultProcOfPluginEvent(WidgetPluginEvent aEvent);
 
     /**
      * Request that the parent process move focus to the browser's frame. If
      * canRaise is true, the window can be raised if it is inactive.
      */
-    RequestFocus(bool canRaise);
+    async RequestFocus(bool canRaise);
 
     /**
      * Indicate, based on the current state, that some commands are enabled and
      * some are disabled.
      */
-    EnableDisableCommands(nsString action,
-                          nsCString[] enabledCommands,
-                          nsCString[] disabledCommands);
+    async EnableDisableCommands(nsString action,
+                                nsCString[] enabledCommands,
+                                nsCString[] disabledCommands);
 
     prio(urgent) sync GetInputContext() returns (int32_t IMEEnabled,
                                                  int32_t IMEOpen);
 
     prio(urgent) async SetInputContext(int32_t IMEEnabled,
                                        int32_t IMEOpen,
                                        nsString type,
                                        nsString inputmode,
@@ -336,17 +336,17 @@ parent:
     /**
      * Set the native cursor.
      * @param value
      *   The widget cursor to set.
      * @param force
      *   Invalidate any locally cached cursor settings and force an
      *   update.
      */
-    SetCursor(uint32_t value, bool force);
+    async SetCursor(uint32_t value, bool force);
 
     /**
      * Set the native cursor using a custom image.
      * @param cursorData
      *   Serialized image data.
      * @param width
      *   Width of the image.
      * @param height
@@ -358,53 +358,53 @@ parent:
      * @param hotspotX
      *   Horizontal hotspot of the image, as specified by the css cursor property.
      * @param hotspotY
      *   Vertical hotspot of the image, as specified by the css cursor property.
      * @param force
      *   Invalidate any locally cached cursor settings and force an
      *   update.
      */
-    SetCustomCursor(nsCString cursorData, uint32_t width, uint32_t height,
-                    uint32_t stride, uint8_t format,
-                    uint32_t hotspotX, uint32_t hotspotY, bool force);
+    async SetCustomCursor(nsCString cursorData, uint32_t width, uint32_t height,
+                          uint32_t stride, uint8_t format,
+                          uint32_t hotspotX, uint32_t hotspotY, bool force);
 
     /**
      * Used to set the current text of the status tooltip.
      * Nowadays this is mainly used for link locations on hover.
      */
-    SetStatus(uint32_t type, nsString status);
+    async SetStatus(uint32_t type, nsString status);
 
     /**
      * Show/hide a tooltip when the mouse hovers over an element in the content
      * document.
      */
-    ShowTooltip(uint32_t x, uint32_t y, nsString tooltip);
-    HideTooltip();
+    async ShowTooltip(uint32_t x, uint32_t y, nsString tooltip);
+    async HideTooltip();
 
     /**
      * Create an asynchronous color picker on the parent side,
      * but don't open it yet.
      */
-    PColorPicker(nsString title, nsString initialColor);
+    async PColorPicker(nsString title, nsString initialColor);
 
-    PFilePicker(nsString aTitle, int16_t aMode);
+    async PFilePicker(nsString aTitle, int16_t aMode);
 
     /**
      * Initiates an asynchronous request for one of the special indexedDB
      * permissions for the provided principal.
      *
      * @param principal
      *   The principal of the request.
      *
      * NOTE: The principal is untrusted in the parent process. Only
      *       principals that can live in the content process should
      *       provided.
      */
-    PIndexedDBPermissionRequest(Principal principal);
+    async PIndexedDBPermissionRequest(Principal principal);
 
     /**
      * window.open from inside <iframe mozbrowser> is special.  When the child
      * process calls window.open, it creates a new PBrowser (in its own
      * process), then calls BrowserFrameOpenWindow on it.
      *
      * The parent process gets a chance to accept or reject the window.open
      * call, and windowOpened is set to true if we ended up going through with
@@ -415,106 +415,106 @@ parent:
     sync BrowserFrameOpenWindow(PBrowser opener, nsString aURL,
                                 nsString aName, nsString aFeatures)
       returns (bool windowOpened);
 
     /**
      * Instructs the TabParent to forward a request to zoom to a rect given in
      * CSS pixels. This rect is relative to the document.
      */
-    ZoomToRect(uint32_t aPresShellId, ViewID aViewId, CSSRect aRect, uint32_t aFlags);
+    async ZoomToRect(uint32_t aPresShellId, ViewID aViewId, CSSRect aRect, uint32_t aFlags);
 
     /**
      * We know for sure that content has either preventDefaulted or not
      * preventDefaulted. This applies to an entire batch of touch events. It is
      * expected that, if there are any DOM touch listeners, touch events will be
      * batched and only processed for panning and zooming if content does not
      * preventDefault.
      */
-    ContentReceivedInputBlock(ScrollableLayerGuid aGuid, uint64_t aInputBlockId, bool aPreventDefault);
+    async ContentReceivedInputBlock(ScrollableLayerGuid aGuid, uint64_t aInputBlockId, bool aPreventDefault);
 
     /**
      * Notifies the APZ code of the results of the gecko hit-test for a
      * particular input block. Each target corresponds to one touch point in the
      * touch event.
      */
-    SetTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
+    async SetTargetAPZC(uint64_t aInputBlockId, ScrollableLayerGuid[] aTargets);
 
     /**
      * Notifies the APZ code of the allowed touch-behaviours for a particular
      * input block. Each item in the aFlags array corresponds to one touch point
      * in the touch event.
      */
-    SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aFlags);
+    async SetAllowedTouchBehavior(uint64_t aInputBlockId, TouchBehaviorFlags[] aFlags);
 
     /**
      * Updates the zoom constraints for a scrollable frame in this tab.
      * The zoom controller code lives on the parent side and so this allows it to
      * have up-to-date zoom constraints.
      */
-    UpdateZoomConstraints(uint32_t aPresShellId, ViewID aViewId,
-                          MaybeZoomConstraints aConstraints);
+    async UpdateZoomConstraints(uint32_t aPresShellId, ViewID aViewId,
+                                MaybeZoomConstraints aConstraints);
 
     /**
      * Tells the containing widget whether the given input block results in a
      * swipe. Should be called in response to a WidgetWheelEvent that has
      * mFlags.mCanTriggerSwipe set on it.
      */
-    RespondStartSwipeEvent(uint64_t aInputBlockId, bool aStartSwipe);
+    async RespondStartSwipeEvent(uint64_t aInputBlockId, bool aStartSwipe);
 
     /**
      * Brings up the auth prompt dialog.
      * Called when this is the PBrowserParent for a nested remote iframe.
      * aCallbackId corresponds to an nsIAuthPromptCallback that lives in the
      * root process.  It will be passed back to the root process with either the
      * OnAuthAvailable or OnAuthCancelled message.
      */
-    AsyncAuthPrompt(nsCString uri, nsString realm, uint64_t aCallbackId);
+    async AsyncAuthPrompt(nsCString uri, nsString realm, uint64_t aCallbackId);
 
-    __delete__();
+    async __delete__();
 
-    ReplyKeyEvent(WidgetKeyboardEvent event);
+    async ReplyKeyEvent(WidgetKeyboardEvent event);
 
-    DispatchAfterKeyboardEvent(WidgetKeyboardEvent event);
+    async DispatchAfterKeyboardEvent(WidgetKeyboardEvent event);
 
     sync RequestNativeKeyBindings(WidgetKeyboardEvent event)
         returns (MaybeNativeKeyBinding bindings);
 
-    SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout,
-                             int32_t aNativeKeyCode,
-                             uint32_t aModifierFlags,
-                             nsString aCharacters,
-                             nsString aUnmodifiedCharacters,
-                             uint64_t aObserverId);
-    SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
-                               uint32_t aNativeMessage,
-                               uint32_t aModifierFlags,
-                               uint64_t aObserverId);
-    SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
-                              uint64_t aObserverId);
-    SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint,
+    async SynthesizeNativeKeyEvent(int32_t aNativeKeyboardLayout,
+                                   int32_t aNativeKeyCode,
+                                   uint32_t aModifierFlags,
+                                   nsString aCharacters,
+                                   nsString aUnmodifiedCharacters,
+                                   uint64_t aObserverId);
+    async SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
                                      uint32_t aNativeMessage,
-                                     double aDeltaX,
-                                     double aDeltaY,
-                                     double aDeltaZ,
                                      uint32_t aModifierFlags,
-                                     uint32_t aAdditionalFlags,
                                      uint64_t aObserverId);
-    SynthesizeNativeTouchPoint(uint32_t aPointerId,
-                               TouchPointerState aPointerState,
-                               ScreenIntPoint aPointerScreenPoint,
-                               double aPointerPressure,
-                               uint32_t aPointerOrientation,
-                               uint64_t aObserverId);
-    SynthesizeNativeTouchTap(ScreenIntPoint aPointerScreenPoint,
-                             bool aLongTap,
-                             uint64_t aObserverId);
-    ClearNativeTouchSequence(uint64_t aObserverId);
+    async SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
+                                    uint64_t aObserverId);
+    async SynthesizeNativeMouseScrollEvent(LayoutDeviceIntPoint aPoint,
+                                           uint32_t aNativeMessage,
+                                           double aDeltaX,
+                                           double aDeltaY,
+                                           double aDeltaZ,
+                                           uint32_t aModifierFlags,
+                                           uint32_t aAdditionalFlags,
+                                           uint64_t aObserverId);
+    async SynthesizeNativeTouchPoint(uint32_t aPointerId,
+                                     TouchPointerState aPointerState,
+                                     ScreenIntPoint aPointerScreenPoint,
+                                     double aPointerPressure,
+                                     uint32_t aPointerOrientation,
+                                     uint64_t aObserverId);
+    async SynthesizeNativeTouchTap(ScreenIntPoint aPointerScreenPoint,
+                                   bool aLongTap,
+                                   uint64_t aObserverId);
+    async ClearNativeTouchSequence(uint64_t aObserverId);
 child:
-    NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse);
+    async NativeSynthesisResponse(uint64_t aObserverId, nsCString aResponse);
 
 
 parent:
 
     /**
      * Child informs the parent that the graphics objects are ready for
      * compositing.  This is sent when all pending changes have been
      * sent to the compositor and are ready to be shown on the next composite.
@@ -535,201 +535,202 @@ parent:
 
     prio(high) sync DispatchWheelEvent(WidgetWheelEvent event);
     prio(high) sync DispatchMouseEvent(WidgetMouseEvent event);
     prio(high) sync DispatchKeyboardEvent(WidgetKeyboardEvent event);
 
     // Start an APZ drag on a scrollbar
     async StartScrollbarDrag(AsyncDragMetrics aDragMetrics);
 
-    InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action,
-                      nsCString visualData, uint32_t width, uint32_t height,
-                      uint32_t stride, uint8_t format, int32_t dragAreaX, int32_t dragAreaY);
+    async InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action,
+                            nsCString visualData, uint32_t width, uint32_t height,
+                            uint32_t stride, uint8_t format,
+                            int32_t dragAreaX, int32_t dragAreaY);
 
     async AudioChannelActivityNotification(uint32_t aAudioChannel,
                                            bool aActive);
 
 child:
     /**
      * Notify the remote browser that it has been Show()n on this
      * side, with the given |visibleRect|.  This message is expected
      * to trigger creation of the remote browser's "widget".
      *
      * |Show()| and |Move()| take IntSizes rather than Rects because
      * content processes always render to a virtual <0, 0> top-left
      * point.
      */
-    Show(ScreenIntSize size,
-         ShowInfo info,
-         TextureFactoryIdentifier textureFactoryIdentifier,
-         uint64_t layersId,
-         nullable PRenderFrame renderFrame,
-         bool parentIsActive);
+    async Show(ScreenIntSize size,
+               ShowInfo info,
+               TextureFactoryIdentifier textureFactoryIdentifier,
+               uint64_t layersId,
+               nullable PRenderFrame renderFrame,
+               bool parentIsActive);
 
-    LoadURL(nsCString uri, BrowserConfiguration config, ShowInfo info);
+    async LoadURL(nsCString uri, BrowserConfiguration config, ShowInfo info);
 
-    OpenURI(URIParams uri, uint32_t flags);
+    async OpenURI(URIParams uri, uint32_t flags);
 
-    CacheFileDescriptor(nsString path, FileDescriptor fd);
+    async CacheFileDescriptor(nsString path, FileDescriptor fd);
 
-    UpdateDimensions(CSSRect rect, CSSSize size, nsSizeMode sizeMode,
-                     ScreenOrientationInternal orientation,
-                     LayoutDeviceIntPoint chromeDisp) compressall;
+    async UpdateDimensions(CSSRect rect, CSSSize size, nsSizeMode sizeMode,
+                           ScreenOrientationInternal orientation,
+                           LayoutDeviceIntPoint chromeDisp) compressall;
 
-    UpdateFrame(FrameMetrics frame);
+    async UpdateFrame(FrameMetrics frame);
 
     // The following methods correspond to functions on the GeckoContentController
     // interface in gfx/layers/apz/public/GeckoContentController.h. Refer to documentation
     // in that file for these functions.
-    RequestFlingSnap(ViewID aScrollID, CSSPoint aDestination);
-    AcknowledgeScrollUpdate(ViewID aScrollId, uint32_t aScrollGeneration);
-    HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
-    HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
-    HandleLongTap(CSSPoint point, Modifiers aModifiers, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
-    NotifyAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg);
-    NotifyFlushComplete();
+    async RequestFlingSnap(ViewID aScrollID, CSSPoint aDestination);
+    async AcknowledgeScrollUpdate(ViewID aScrollId, uint32_t aScrollGeneration);
+    async HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
+    async HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
+    async HandleLongTap(CSSPoint point, Modifiers aModifiers, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
+    async NotifyAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg);
+    async NotifyFlushComplete();
 
 
     /**
      * Sending an activate message moves focus to the child.
      */
-    Activate();
+    async Activate();
 
-    Deactivate();
+    async Deactivate();
 
-    ParentActivated(bool aActivated);
+    async ParentActivated(bool aActivated);
 
     /**
      * StopIMEStateManagement() is called when the process loses focus and
      * should stop managing IME state.
      */
-    StopIMEStateManagement();
+    async StopIMEStateManagement();
 
     /**
      * MenuKeyboardListenerInstalled() is called when menu keyboard listener
      * is installed in the parent process.
      */
-    MenuKeyboardListenerInstalled(bool aInstalled);
+    async MenuKeyboardListenerInstalled(bool aInstalled);
 
     /**
      * @see nsIDOMWindowUtils sendMouseEvent.
      */
-    MouseEvent(nsString aType,
-               float aX,
-               float aY,
-               int32_t aButton,
-               int32_t aClickCount,
-               int32_t aModifiers,
-               bool aIgnoreRootScrollFrame);
+    async MouseEvent(nsString aType,
+                     float aX,
+                     float aY,
+                     int32_t aButton,
+                     int32_t aClickCount,
+                     int32_t aModifiers,
+                     bool aIgnoreRootScrollFrame);
 
     /**
      * When two consecutive mouse move events would be added to the message queue,
      * they are 'compressed' by dumping the oldest one.
      */
-    RealMouseMoveEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId) compress;
+    async RealMouseMoveEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId) compress;
     /**
      * Mouse move events with |reason == eSynthesized| are sent via a separate
      * message because they do not generate DOM 'mousemove' events, and the
      * 'compress' attribute on RealMouseMoveEvent() could result in a
      * |reason == eReal| event being dropped in favour of an |eSynthesized|
      * event, and thus a DOM 'mousemove' event to be lost.
      */
-    SynthMouseMoveEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
-    RealMouseButtonEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
-    RealKeyEvent(WidgetKeyboardEvent event, MaybeNativeKeyBinding keyBinding);
-    MouseWheelEvent(WidgetWheelEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
-    RealTouchEvent(WidgetTouchEvent aEvent,
-                   ScrollableLayerGuid aGuid,
-                   uint64_t aInputBlockId,
-                   nsEventStatus aApzResponse);
-    RealTouchMoveEvent(WidgetTouchEvent aEvent,
-                       ScrollableLayerGuid aGuid,
-                       uint64_t aInputBlockId,
-                       nsEventStatus aApzResponse);
-    RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction, uint32_t aDropEffect);
-    PluginEvent(WidgetPluginEvent aEvent);
+    async SynthMouseMoveEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
+    async RealMouseButtonEvent(WidgetMouseEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
+    async RealKeyEvent(WidgetKeyboardEvent event, MaybeNativeKeyBinding keyBinding);
+    async MouseWheelEvent(WidgetWheelEvent event, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
+    async RealTouchEvent(WidgetTouchEvent aEvent,
+                         ScrollableLayerGuid aGuid,
+                         uint64_t aInputBlockId,
+                         nsEventStatus aApzResponse);
+    async RealTouchMoveEvent(WidgetTouchEvent aEvent,
+                             ScrollableLayerGuid aGuid,
+                             uint64_t aInputBlockId,
+                             nsEventStatus aApzResponse);
+    async RealDragEvent(WidgetDragEvent aEvent, uint32_t aDragAction, uint32_t aDropEffect);
+    async PluginEvent(WidgetPluginEvent aEvent);
 
     /**
      * @see nsIDOMWindowUtils sendKeyEvent.
      */
-    KeyEvent(nsString aType,
-             int32_t aKeyCode,
-             int32_t aCharCode,
-             int32_t aModifiers,
-             bool aPreventDefault);
+    async KeyEvent(nsString aType,
+                   int32_t aKeyCode,
+                   int32_t aCharCode,
+                   int32_t aModifiers,
+                   bool aPreventDefault);
 
     /**
      * APZ notification for mouse scroll testing events.
      */
-    MouseScrollTestEvent(ViewID aScrollId, nsString aEvent);
+    async MouseScrollTestEvent(ViewID aScrollId, nsString aEvent);
 
-    CompositionEvent(WidgetCompositionEvent event);
+    async CompositionEvent(WidgetCompositionEvent event);
 
-    SelectionEvent(WidgetSelectionEvent event);
+    async SelectionEvent(WidgetSelectionEvent event);
 
     /**
      * Activate event forwarding from client to parent.
      */
-    ActivateFrameEvent(nsString aType, bool capture);
+    async ActivateFrameEvent(nsString aType, bool capture);
 
-    LoadRemoteScript(nsString aURL, bool aRunInGlobalScope);
+    async LoadRemoteScript(nsString aURL, bool aRunInGlobalScope);
 
     /**
      * Create a asynchronous request to render whatever document is
      * loaded in the child when this message arrives.  When the
      * request finishes, PDocumentRenderer:__delete__ is sent back to
      * this side to notify completion.
      *
      * |documentRect| is the area of the remote document to draw,
      * transformed by |transform|.  The rendered area will have the
      * default background color |bgcolor|.  |renderFlags| are the
      * nsIPresShell::RenderDocument() flags to use on the remote side,
      * and if true, |flushLayout| will do just that before rendering
      * the document.  The rendered image will be of size |renderSize|.
      */
-    PDocumentRenderer(nsRect documentRect, Matrix transform,
-                      nsString bgcolor,
-                      uint32_t renderFlags, bool flushLayout,
-                      IntSize renderSize);
+    async PDocumentRenderer(nsRect documentRect, Matrix transform,
+                            nsString bgcolor,
+                            uint32_t renderFlags, bool flushLayout,
+                            IntSize renderSize);
 
     /**
      * Sent by the chrome process when it no longer wants this remote
      * <browser>.  The child side cleans up in response, then
      * finalizing its death by sending back __delete__() to the
      * parent.
      */
-    Destroy();
+    async Destroy();
 
 
     /**
      * Tell the child side if it has to update it's touchable region
      * to the parent.
      */
-    SetUpdateHitRegion(bool aEnabled);
+    async SetUpdateHitRegion(bool aEnabled);
 
     /**
      * Update the child side docShell active (resource use) state.
      */
-    SetDocShellIsActive(bool aIsActive, bool aIsHidden);
+    async SetDocShellIsActive(bool aIsActive, bool aIsHidden);
 
     /**
      * Notify the child that it shouldn't paint the offscreen displayport.
      * This is useful to speed up interactive operations over async
      * scrolling performance like resize, tabswitch, pageload.
      *
      * Each enable call must be matched with a disable call. The child
      * will remain in the suppress mode as long as there's
      * a single unmatched call.
      */
     async SuppressDisplayport(bool aEnabled);
 
     /**
      * Navigate by key (Tab/Shift+Tab/F6/Shift+f6).
      */
-    NavigateByKey(bool aForward, bool aForDocumentNavigation);
+    async NavigateByKey(bool aForward, bool aForDocumentNavigation);
 
     /**
      * The parent (chrome thread) requests that the child inform it when
      * the graphics objects are ready to display.
      * @see PCompositor
      * @see RemotePaintIsReady
      */
     async RequestNotifyAfterRemotePaint();
@@ -738,51 +739,51 @@ child:
      * Tell the child that the UI resolution changed for the containing
      * window.
      * To avoid some sync messages from child to parent, we also send the dpi
      * and default scale with the notification.
      * If we don't know the dpi and default scale, we just pass in a negative
      * value (-1) but in the majority of the cases this saves us from two
      * sync requests from the child to the parent.
      */
-    UIResolutionChanged(float dpi, double scale);
+    async UIResolutionChanged(float dpi, double scale);
 
     /**
      * Tell the child that the system theme has changed, and that a repaint
      * is necessary.
      */
-    ThemeChanged(LookAndFeelInt[] lookAndFeelIntCache);
+    async ThemeChanged(LookAndFeelInt[] lookAndFeelIntCache);
 
     /**
      * Tell the child of an app's offline status
      */
-    AppOfflineStatus(uint32_t id, bool offline);
+    async AppOfflineStatus(uint32_t id, bool offline);
 
     /**
      * Tell the browser that its frame loader has been swapped
      * with another.
      */
-    SwappedWithOtherRemoteLoader();
+    async SwappedWithOtherRemoteLoader();
 
     /**
      * A potential accesskey was just pressed. Look for accesskey targets
      * using the list of provided charCodes.
      *
      * @param charCode array of potential character codes
      * @param isTrusted true if triggered by a trusted key event
      * @param modifierMask indicates which accesskey modifiers are pressed
      */
-    HandleAccessKey(uint32_t[] charCodes, bool isTrusted, int32_t modifierMask);
+    async HandleAccessKey(uint32_t[] charCodes, bool isTrusted, int32_t modifierMask);
 
     /**
      * Propagate a refresh to the child process
      */
-    AudioChannelChangeNotification(uint32_t aAudioChannel,
-                                   float aVolume,
-                                   bool aMuted);
+    async AudioChannelChangeNotification(uint32_t aAudioChannel,
+                                         float aVolume,
+                                         bool aMuted);
 
 /*
  * FIXME: write protocol!
 
 state LIVE:
     send LoadURL goto LIVE;
 //etc.
     send Destroy goto DYING;
--- a/dom/ipc/PColorPicker.ipdl
+++ b/dom/ipc/PColorPicker.ipdl
@@ -10,18 +10,18 @@ include protocol PBrowser;
 namespace mozilla {
 namespace dom {
 
 protocol PColorPicker
 {
     manager PBrowser;
 
 parent:
-    Open();
+    async Open();
 
 child:
-    Update(nsString color);
+    async Update(nsString color);
 
-    __delete__(nsString color);
+    async __delete__(nsString color);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -527,35 +527,35 @@ both:
     // access to (in the form of a TabChild).
     //
     // Keep the last 3 attributes in sync with GetProcessAttributes!
     async PBrowser(TabId tabId, IPCTabContext context, uint32_t chromeFlags,
                    ContentParentId cpId, bool isForApp, bool isForBrowser);
 
     async PBlob(BlobConstructorParams params);
 
-    PFileDescriptorSet(FileDescriptor fd);
+    async PFileDescriptorSet(FileDescriptor fd);
 
     // For parent->child, aBrowser must be non-null; aOuterWindowID can
     // be 0 to indicate the browser's current root document, or nonzero
     // to persist a subdocument.  For child->parent, arguments are
     // ignored and should be null/zero.
-    PWebBrowserPersistDocument(nullable PBrowser aBrowser,
-                               uint64_t aOuterWindowID);
+    async PWebBrowserPersistDocument(nullable PBrowser aBrowser,
+                                     uint64_t aOuterWindowID);
 
 child:
     /**
      * Enable system-level sandboxing features, if available.  Can
      * usually only be performed zero or one times.  The child may
      * abnormally exit if this fails; the details are OS-specific.
      */
     async SetProcessSandbox(MaybeFileDesc aBroker);
 
-    PMemoryReportRequest(uint32_t generation, bool anonymize,
-                         bool minimizeMemoryUsage, MaybeFileDesc DMDFile);
+    async PMemoryReportRequest(uint32_t generation, bool anonymize,
+                               bool minimizeMemoryUsage, MaybeFileDesc DMDFile);
 
     async SpeakerManagerNotify();
 
     /**
      * Communication between the PuppetBidiKeyboard and the actual
      * BidiKeyboard hosted by the parent
      */
     async BidiKeyboardNotify(bool isLangRTL);
@@ -564,104 +564,104 @@ child:
                           nsString aManifestURL);
 
     /**
      * Dump this process's GC and CC logs to the provided files.
      *
      * For documentation on the other args, see dumpGCAndCCLogsToFile in
      * nsIMemoryInfoDumper.idl
      */
-    PCycleCollectWithLogs(bool dumpAllTraces,
-                          FileDescriptor gcLog,
-                          FileDescriptor ccLog);
+    async PCycleCollectWithLogs(bool dumpAllTraces,
+                                FileDescriptor gcLog,
+                                FileDescriptor ccLog);
 
-    PTestShell();
+    async PTestShell();
 
-    RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
-                   OverrideMapping[] overrides, nsCString locale, bool reset);
-    RegisterChromeItem(ChromeRegistryItem item);
+    async RegisterChrome(ChromePackage[] packages, SubstitutionMapping[] substitutions,
+                         OverrideMapping[] overrides, nsCString locale, bool reset);
+    async RegisterChromeItem(ChromeRegistryItem item);
 
     async SetOffline(bool offline);
     async SetConnectivity(bool connectivity);
 
     async NotifyVisited(URIParams uri);
 
     async SystemMemoryAvailable(uint64_t getterId, uint32_t memoryAvailable);
 
-    PreferenceUpdate(PrefSetting pref);
+    async PreferenceUpdate(PrefSetting pref);
 
-    DataStoragePut(nsString aFilename, DataStorageItem aItem);
-    DataStorageRemove(nsString aFilename, nsCString aKey, DataStorageType aType);
-    DataStorageClear(nsString aFilename);
+    async DataStoragePut(nsString aFilename, DataStorageItem aItem);
+    async DataStorageRemove(nsString aFilename, nsCString aKey, DataStorageType aType);
+    async DataStorageClear(nsString aFilename);
 
-    NotifyAlertsObserver(nsCString topic, nsString data);
+    async NotifyAlertsObserver(nsCString topic, nsString data);
 
-    GeolocationUpdate(GeoPosition somewhere);
+    async GeolocationUpdate(GeoPosition somewhere);
 
-    GeolocationError(uint16_t errorCode);
+    async GeolocationError(uint16_t errorCode);
 
-    UpdateDictionaryList(nsString[] dictionaries);
+    async UpdateDictionaryList(nsString[] dictionaries);
 
     // nsIPermissionManager messages
-    AddPermission(Permission permission);
+    async AddPermission(Permission permission);
 
-    ScreenSizeChanged(IntSize size);
+    async ScreenSizeChanged(IntSize size);
 
-    Volumes(VolumeInfo[] volumes);
+    async Volumes(VolumeInfo[] volumes);
 
-    FlushMemory(nsString reason);
+    async FlushMemory(nsString reason);
 
-    GarbageCollect();
-    CycleCollect();
+    async GarbageCollect();
+    async CycleCollect();
 
     /**
      * Start accessibility engine in content process.
      */
-    ActivateA11y();
+    async ActivateA11y();
 
-    AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
-            nsCString ID, nsCString vendor);
-    AppInit();
+    async AppInfo(nsCString version, nsCString buildID, nsCString name, nsCString UAName,
+                  nsCString ID, nsCString vendor);
+    async AppInit();
 
     // Notify child that last-pb-context-exited notification was observed
-    LastPrivateDocShellDestroyed();
+    async LastPrivateDocShellDestroyed();
 
-    FilePathUpdate(nsString storageType, nsString storageName, nsString filepath,
-                   nsCString reasons);
+    async FilePathUpdate(nsString storageType, nsString storageName, nsString filepath,
+                         nsCString reasons);
 
     // Note: Any changes to this structure should also be changed in
     // VolumeInfo above.
-    FileSystemUpdate(nsString fsName, nsString mountPoint, int32_t fsState,
-                     int32_t mountGeneration, bool isMediaPresent,
-                     bool isSharing, bool isFormatting, bool isFake,
-                     bool isUnmounting, bool isRemovable, bool isHotSwappable);
+    async FileSystemUpdate(nsString fsName, nsString mountPoint, int32_t fsState,
+                           int32_t mountGeneration, bool isMediaPresent,
+                           bool isSharing, bool isFormatting, bool isFake,
+                           bool isUnmounting, bool isRemovable, bool isHotSwappable);
 
     // Notify volume is removed.
-    VolumeRemoved(nsString fsName);
+    async VolumeRemoved(nsString fsName);
 
-    NotifyProcessPriorityChanged(ProcessPriority priority);
-    MinimizeMemoryUsage();
+    async NotifyProcessPriorityChanged(ProcessPriority priority);
+    async MinimizeMemoryUsage();
 
     /**
      * Used to manage nsIStyleSheetService across processes.
      */
     async LoadAndRegisterSheet(URIParams uri, uint32_t type);
     async UnregisterSheet(URIParams uri, uint32_t type);
 
-    NotifyPhoneStateChange(nsString newState);
+    async NotifyPhoneStateChange(nsString newState);
 
     /**
      * Notify idle observers in the child
      */
-    NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
+    async NotifyIdleObserver(uint64_t observerId, nsCString topic, nsString str);
 
     /**
      * Notify windows in the child to apply a new app style.
      */
-    OnAppThemeChanged();
+    async OnAppThemeChanged();
 
     /**
      * Called during plugin initialization to map a plugin id to a child process
      * id.
      */
     async AssociatePluginId(uint32_t aPluginId, ProcessId aProcessId);
 
     /**
@@ -675,19 +675,19 @@ child:
      * Control the Gecko Profiler in the child process.
      */
     async StartProfiler(ProfilerInitParams params);
     async StopProfiler();
     async PauseProfiler(bool aPause);
 
     async GatherProfile();
 
-    InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action);
+    async InvokeDragSession(IPCDataTransfer[] transfers, uint32_t action);
 
-    EndDragSession(bool aDoneDrag, bool aUserCancelled);
+    async EndDragSession(bool aDoneDrag, bool aUserCancelled);
 
     async DomainSetChanged(uint32_t aSetType, uint32_t aChangeType, OptionalURIParams aDomain);
 
     /**
      * Notify the child to shutdown. The child will in turn call FinishShutdown
      * and let the parent close the channel.
      */
     async Shutdown();
@@ -698,17 +698,17 @@ child:
      * Requests a full native update of a native plugin child window. This is
      * a Windows specific call.
      */
     async UpdateWindow(uintptr_t aChildId);
 
     /**
      * Send gamepad status update to child.
      */
-    GamepadUpdate(GamepadChangeEvent aGamepadEvent);
+    async GamepadUpdate(GamepadChangeEvent aGamepadEvent);
 
     /**
      * Tell the child that for testing purposes, a graphics device reset has
      * occurred.
      */
     async TestGraphicsDeviceReset(uint32_t aReason);
 
     /**
@@ -726,27 +726,27 @@ child:
     /**
      * Notify the child that the Gecko Media Plugins installed changed.
      */
     async NotifyGMPsChanged();
 
     /**
      * Send a `push` event without data to a service worker in the child.
      */
-    Push(nsCString scope, Principal principal);
+    async Push(nsCString scope, Principal principal);
 
     /**
      * Send a `push` event with data to a service worker in the child.
      */
-    PushWithData(nsCString scope, Principal principal, uint8_t[] data);
+    async PushWithData(nsCString scope, Principal principal, uint8_t[] data);
 
     /**
      * Send a `pushsubscriptionchange` event to a service worker in the child.
      */
-    PushSubscriptionChange(nsCString scope, Principal principal);
+    async PushSubscriptionChange(nsCString scope, Principal principal);
 
 parent:
     /**
      * Tell the content process some attributes of itself.  This is
      * among the first information queried by content processes after
      * startup.  (The message is sync to allow the content process to
      * control when it receives the information.)
      *
@@ -809,20 +809,20 @@ parent:
      * |pluginEpoch| is the epoch last observed by the content
      * process. |newPluginEpoch| is the current epoch in the chrome process. If
      * |pluginEpoch == newPluginEpoch|, then |plugins| will be left empty.
      */
     sync FindPlugins(uint32_t pluginEpoch) returns (nsresult aResult, PluginTag[] plugins, uint32_t newPluginEpoch);
 
     async PJavaScript();
 
-    PRemoteSpellcheckEngine();
-    PDeviceStorageRequest(DeviceStorageParams params);
+    async PRemoteSpellcheckEngine();
+    async PDeviceStorageRequest(DeviceStorageParams params);
 
-    PFileSystemRequest(FileSystemParams params);
+    async PFileSystemRequest(FileSystemParams params);
 
     sync PCrashReporter(NativeThreadId tid, uint32_t processType);
 
     prio(urgent) sync GetRandomValues(uint32_t length)
         returns (uint8_t[] randomValues);
 
     async GetSystemMemory(uint64_t getterId);
 
@@ -833,50 +833,50 @@ parent:
 
     sync GetLookAndFeelCache()
         returns (LookAndFeelInt[] lookAndFeelIntCache);
 
     prio(urgent) async PHal();
 
     async PHeapSnapshotTempFileHelper();
 
-    PIcc(uint32_t serviceId);
+    async PIcc(uint32_t serviceId);
 
-    PMobileConnection(uint32_t clientId);
+    async PMobileConnection(uint32_t clientId);
 
-    PNecko();
+    async PNecko();
 
-    PPrinting();
+    async PPrinting();
 
     prio(high) sync PScreenManager()
         returns (uint32_t numberOfScreens,
                  float systemDefaultScale,
                  bool success);
 
-    PCellBroadcast();
+    async PCellBroadcast();
 
-    PSms();
+    async PSms();
 
-    PSpeechSynthesis();
+    async PSpeechSynthesis();
 
     prio(urgent) async PStorage();
 
-    PTelephony();
+    async PTelephony();
 
-    PVoicemail();
+    async PVoicemail();
 
-    PMedia();
+    async PMedia();
 
-    PBluetooth();
+    async PBluetooth();
 
-    PFMRadio();
+    async PFMRadio();
 
-    PWebrtcGlobal();
+    async PWebrtcGlobal();
 
-    PPresentation();
+    async PPresentation();
 
     // Services remoting
 
     async StartVisitedQuery(URIParams uri);
     async VisitURI(URIParams uri, OptionalURIParams referrer, uint32_t flags);
     async SetURITitle(URIParams uri, nsString title);
 
     async LoadURIExternal(URIParams uri, PBrowser windowContext);
@@ -892,78 +892,78 @@ parent:
     sync SyncMessage(nsString aMessage, ClonedMessageData aData,
                      CpowEntry[] aCpows, Principal aPrincipal)
       returns (StructuredCloneData[] retval);
 
     prio(high) sync RpcMessage(nsString aMessage, ClonedMessageData aData,
                                CpowEntry[] aCpows, Principal aPrincipal)
       returns (StructuredCloneData[] retval);
 
-    ShowAlert(AlertNotificationType alert);
+    async ShowAlert(AlertNotificationType alert);
 
-    CloseAlert(nsString name, Principal principal);
+    async CloseAlert(nsString name, Principal principal);
 
-    DisableNotifications(Principal principal);
+    async DisableNotifications(Principal principal);
 
-    OpenNotificationSettings(Principal principal);
+    async OpenNotificationSettings(Principal principal);
 
-    PPSMContentDownloader(uint32_t aCertType);
+    async PPSMContentDownloader(uint32_t aCertType);
 
-    PExternalHelperApp(OptionalURIParams uri,
-                       nsCString aMimeContentType,
-                       nsCString aContentDisposition,
-                       uint32_t aContentDispositionHint,
-                       nsString aContentDispositionFilename,
-                       bool aForceSave,
-                       int64_t aContentLength,
-                       OptionalURIParams aReferrer,
-                       nullable PBrowser aBrowser);
+    async PExternalHelperApp(OptionalURIParams uri,
+                             nsCString aMimeContentType,
+                             nsCString aContentDisposition,
+                             uint32_t aContentDispositionHint,
+                             nsString aContentDispositionFilename,
+                             bool aForceSave,
+                             int64_t aContentLength,
+                             OptionalURIParams aReferrer,
+                             nullable PBrowser aBrowser);
 
-    PHandlerService();
+    async PHandlerService();
 
-    AddGeolocationListener(Principal principal, bool highAccuracy);
-    RemoveGeolocationListener();
-    SetGeolocationHigherAccuracy(bool enable);
+    async AddGeolocationListener(Principal principal, bool highAccuracy);
+    async RemoveGeolocationListener();
+    async SetGeolocationHigherAccuracy(bool enable);
 
-    ConsoleMessage(nsString message);
-    ScriptError(nsString message, nsString sourceName, nsString sourceLine,
-                uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
-                nsCString category);
+    async ConsoleMessage(nsString message);
+    async ScriptError(nsString message, nsString sourceName, nsString sourceLine,
+                      uint32_t lineNumber, uint32_t colNumber, uint32_t flags,
+                      nsCString category);
 
     // nsIPermissionManager messages
     sync ReadPermissions() returns (Permission[] permissions);
 
     // Places the items within dataTransfer on the clipboard.
-    SetClipboard(IPCDataTransfer aDataTransfer,
-                 bool aIsPrivateData,
-                 int32_t aWhichClipboard);
+    async SetClipboard(IPCDataTransfer aDataTransfer,
+                       bool aIsPrivateData,
+                       int32_t aWhichClipboard);
 
     // Given a list of supported types, returns the clipboard data for the
     // first type that matches.
     sync GetClipboard(nsCString[] aTypes, int32_t aWhichClipboard)
         returns (IPCDataTransfer dataTransfer);
 
     // Clears the clipboard.
-    EmptyClipboard(int32_t aWhichClipboard);
+    async EmptyClipboard(int32_t aWhichClipboard);
 
     // Returns true if data of one of the specified types is on the clipboard.
     sync ClipboardHasType(nsCString[] aTypes, int32_t aWhichClipboard)
         returns (bool hasType);
 
     sync GetSystemColors(uint32_t colorsCount)
         returns (uint32_t[] colors);
 
     sync GetIconForExtension(nsCString aFileExt, uint32_t aIconSize)
         returns (uint8_t[] bits);
 
     sync GetShowPasswordSetting()
         returns (bool showPassword);
 
     // Notify the parent of the presence or absence of private docshells
-    PrivateDocShellsExist(bool aExist);
+    async PrivateDocShellsExist(bool aExist);
 
     // Tell the parent that the child has gone idle for the first time
     async FirstIdle();
 
     async AudioChannelServiceStatus(bool aActiveTelephonyChannel,
                                     bool aContentOrNormalChannel,
                                     bool aAnyActiveChannel);
 
@@ -1015,31 +1015,31 @@ parent:
                                 bool isVideo);
 
     sync GetGraphicsFeatureStatus(int32_t aFeature) returns (int32_t aStatus, bool aSuccess);
 
     // Driver crash guards. aGuardType must be a member of CrashGuardType.
     sync BeginDriverCrashGuard(uint32_t aGuardType) returns (bool crashDetected);
     sync EndDriverCrashGuard(uint32_t aGuardType);
 
-    AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
-    RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
+    async AddIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
+    async RemoveIdleObserver(uint64_t observerId, uint32_t idleTimeInS);
 
     /**
      * This message is only used on X11 platforms.
      *
      * Send a dup of the plugin process's X socket to the parent
      * process.  In theory, this scheme keeps the plugin's X resources
      * around until after both the plugin process shuts down *and* the
      * parent process closes the dup fd.  This is used to prevent the
      * parent process from crashing on X errors if, e.g., the plugin
      * crashes *just before* a repaint and the parent process tries to
      * use the newly-invalid surface.
      */
-    BackUpXResources(FileDescriptor aXSocketFd);
+    async BackUpXResources(FileDescriptor aXSocketFd);
 
     sync OpenAnonymousTemporaryFile() returns (FileDescOrError aFD);
 
     /**
      * Keygen requires us to call it after a <keygen> element is parsed and
      * before one is submitted. This is urgent because an extension might use
      * a CPOW to synchronously submit a keygen element.
      */
@@ -1051,17 +1051,17 @@ parent:
 
     /**
      * Called to provide the options for <keygen> elements.
      */
     sync KeygenProvideContent()
         returns (nsString aAttribute, nsString[] aContent);
 
     // Use only for testing!
-    FlushPendingFileDeletions();
+    async FlushPendingFileDeletions();
 
     /**
      * Tell the chrome process there is an creation of PBrowser.
      * return a system-wise unique Id.
      */
     sync AllocateTabId(TabId openerTabId, IPCTabContext context, ContentParentId cpId)
         returns (TabId tabId);
     async DeallocateTabId(TabId tabId,
@@ -1094,67 +1094,67 @@ parent:
      *   been changed since the last fetch, we will not do the application
      *   cache group update. But we must cache the document (identified by the
      *   documentURI). This argument will ensure that a previously uncached
      *   document will get cached and that we don't re-cache a document that
      *   has already been cached (stickDocument=false).
      * @param tabId
      *   To identify which tab owns the app.
      */
-    POfflineCacheUpdate(URIParams manifestURI, URIParams documentURI,
-                        PrincipalInfo loadingPrincipal, bool stickDocument);
+    async POfflineCacheUpdate(URIParams manifestURI, URIParams documentURI,
+                              PrincipalInfo loadingPrincipal, bool stickDocument);
 
     /**
      * Sets "offline-app" permission for the principal.  Called when we hit
      * a web app with the manifest attribute in <html> and
      * offline-apps.allow_by_default is set to true.
      */
-    SetOfflinePermission(Principal principal);
+    async SetOfflinePermission(Principal principal);
 
     /**
      * Notifies the parent to continue shutting down after the child performs
      * its shutdown tasks.
      */
     async FinishShutdown();
 
-    UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
+    async UpdateDropEffect(uint32_t aDragAction, uint32_t aDropEffect);
 
     /**
      * Initiates an asynchronous request for permission for the
      * provided principal.
      *
      * @param aRequests
      *   The array of permissions to request.
      * @param aPrincipal
      *   The principal of the request.
      * @param tabId
      *   To identify which tab issues this request.
      *
      * NOTE: The principal is untrusted in the parent process. Only
      *       principals that can live in the content process should
      *       provided.
      */
-    PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal,
-                              TabId tabId);
+    async PContentPermissionRequest(PermissionRequest[] aRequests, Principal aPrincipal,
+                                    TabId tabId);
 
     /**
      * Send ServiceWorkerRegistrationData to child process.
      */
     sync GetBrowserConfiguration(nsCString aUri)
         returns (BrowserConfiguration aConfig);
 
     /*
      * Tells the parent to start the gamepad listening service if it hasn't already.
      */
-    GamepadListenerAdded();
+    async GamepadListenerAdded();
 
     /**
      * Tells the parent to stop the gamepad listening service if it hasn't already.
      */
-    GamepadListenerRemoved();
+    async GamepadListenerRemoved();
 
     async Profile(nsCString aProfile);
 
     /**
      * Request graphics initialization information from the parent.
      */
     sync GetGraphicsDeviceInitData()
         returns (DeviceInitData aData);
@@ -1186,14 +1186,14 @@ parent:
     /**
      * Tells the parent to ungrab the pointer on the default display.
      *
      * This is for GTK platforms where we have to ensure the pointer ungrab happens in the
      * chrome process as that's the process that receives the pointer event.
      */
     sync UngrabPointer(uint32_t time);
 both:
-     AsyncMessage(nsString aMessage, ClonedMessageData aData,
-                  CpowEntry[] aCpows, Principal aPrincipal);
+     async AsyncMessage(nsString aMessage, ClonedMessageData aData,
+                        CpowEntry[] aCpows, Principal aPrincipal);
 };
 
 }
 }
--- a/dom/ipc/PContentBridge.ipdl
+++ b/dom/ipc/PContentBridge.ipdl
@@ -46,14 +46,14 @@ parent:
 both:
     // Both the parent and the child can construct the PBrowser.
     // See the comment in PContent::PBrowser().
     async PBrowser(TabId tabId, IPCTabContext context, uint32_t chromeFlags,
                    ContentParentId cpId, bool isForApp, bool isForBrowser);
 
     async PBlob(BlobConstructorParams params);
 
-    AsyncMessage(nsString aMessage, ClonedMessageData aData,
-                 CpowEntry[] aCpows, Principal aPrincipal);
+    async AsyncMessage(nsString aMessage, ClonedMessageData aData,
+                       CpowEntry[] aCpows, Principal aPrincipal);
 };
 
 }
 }
--- a/dom/ipc/PContentDialog.ipdl
+++ b/dom/ipc/PContentDialog.ipdl
@@ -10,13 +10,13 @@ include protocol PBrowser;
 namespace mozilla {
 namespace dom {
 
 protocol PContentDialog
 {
   manager PBrowser;
 
 child:
-    __delete__(int32_t[] aIntParams, nsString[] aStringParams);
+    async __delete__(int32_t[] aIntParams, nsString[] aStringParams);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/PContentPermissionRequest.ipdl
+++ b/dom/ipc/PContentPermissionRequest.ipdl
@@ -8,21 +8,21 @@ include PContentPermission;
 namespace mozilla {
 namespace dom {
 
 protocol PContentPermissionRequest
 {
   manager PContent;
 
 parent:
-  prompt();
-  NotifyVisibility(bool visibility);
-  Destroy();
+  async prompt();
+  async NotifyVisibility(bool visibility);
+  async Destroy();
 
 child:
-  GetVisibility();
-  NotifyResult(bool allow, PermissionChoice[] choices);
-  __delete__();
+  async GetVisibility();
+  async NotifyResult(bool allow, PermissionChoice[] choices);
+  async __delete__();
 };
 
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/PCrashReporter.ipdl
+++ b/dom/ipc/PCrashReporter.ipdl
@@ -17,15 +17,15 @@ struct Mapping {
   uintptr_t start_address;
   size_t mapping_length;
   size_t file_offset;
 };
 
 async protocol PCrashReporter {
   manager PContent or PPluginModule or PGMP;
 parent:
-  AnnotateCrashReport(nsCString key, nsCString data);
-  AppendAppNotes(nsCString data);
-  __delete__();
+  async AnnotateCrashReport(nsCString key, nsCString data);
+  async AppendAppNotes(nsCString data);
+  async __delete__();
 };
 
 }
 }
--- a/dom/ipc/PCycleCollectWithLogs.ipdl
+++ b/dom/ipc/PCycleCollectWithLogs.ipdl
@@ -7,16 +7,16 @@ include protocol PContent;
 
 namespace mozilla {
 namespace dom {
 
 protocol PCycleCollectWithLogs {
     manager PContent;
 
 parent:
-    CloseGCLog();
-    CloseCCLog();
+    async CloseGCLog();
+    async CloseCCLog();
 
-    __delete__();
+    async __delete__();
 };
 
 }
 }
--- a/dom/ipc/PDocumentRenderer.ipdl
+++ b/dom/ipc/PDocumentRenderer.ipdl
@@ -13,13 +13,13 @@ namespace mozilla {
 namespace ipc {
 
 protocol PDocumentRenderer
 {
   manager PBrowser;
 
 parent:
     // Returns the width and height, in pixels, of the returned ARGB32 data.
-    __delete__(nsIntSize renderedSize, nsCString data);
+    async __delete__(nsIntSize renderedSize, nsCString data);
 };
 
 } // namespace ipc
 } // namespace mozilla
--- a/dom/ipc/PFilePicker.ipdl
+++ b/dom/ipc/PFilePicker.ipdl
@@ -23,18 +23,18 @@ union MaybeInputFiles
   void_t;
 };
 
 protocol PFilePicker
 {
   manager PBrowser;
 
 parent:
-    Open(int16_t selectedType, bool addToRecentDocs, nsString defaultFile,
-         nsString defaultExtension, nsString[] filters, nsString[] filterNames,
-         nsString displayDirectory);
+    async Open(int16_t selectedType, bool addToRecentDocs, nsString defaultFile,
+               nsString defaultExtension, nsString[] filters, nsString[] filterNames,
+               nsString displayDirectory);
 
 child:
-    __delete__(MaybeInputFiles files, int16_t result);
+    async __delete__(MaybeInputFiles files, int16_t result);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/PMemoryReportRequest.ipdl
+++ b/dom/ipc/PMemoryReportRequest.ipdl
@@ -16,14 +16,14 @@ struct MemoryReport {
   int64_t amount;
   nsCString desc;
 };
 
 protocol PMemoryReportRequest {
   manager PContent;
 
 parent:
-  Report(MemoryReport aReport);
-  __delete__();
+  async Report(MemoryReport aReport);
+  async __delete__();
 };
 
 }
 }
--- a/dom/ipc/PScreenManager.ipdl
+++ b/dom/ipc/PScreenManager.ipdl
@@ -50,13 +50,13 @@ parent:
       returns (ScreenDetails screen,
                bool success);
 
     prio(high) sync ScreenForBrowser(TabId aTabId)
       returns (ScreenDetails screen,
                bool success);
 
 child:
-    __delete__();
+    async __delete__();
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -177,58 +177,118 @@ MP4Decoder::CanHandleMediaType(const nsA
 
 /* static */
 bool
 MP4Decoder::IsEnabled()
 {
   return Preferences::GetBool("media.mp4.enabled");
 }
 
+// sTestH264ExtraData represents the content of the avcC atom found in
+// an AVC1 h264 video. It contains the H264 SPS and PPS NAL.
+// the structure of the avcC atom is as follow:
+// write(0x1);  // version, always 1
+// write(sps[0].data[1]); // profile
+// write(sps[0].data[2]); // compatibility
+// write(sps[0].data[3]); // level
+// write(0xFC | 3); // reserved (6 bits), NULA length size - 1 (2 bits)
+// write(0xE0 | 1); // reserved (3 bits), num of SPS (5 bits)
+// write_word(sps[0].size); // 2 bytes for length of SPS
+// for(size_t i=0 ; i < sps[0].size ; ++i)
+//   write(sps[0].data[i]); // data of SPS
+// write(&b, pps.size());  // num of PPS
+// for(size_t i=0 ; i < pps.size() ; ++i) {
+//   write_word(pps[i].size);  // 2 bytes for length of PPS
+//   for(size_t j=0 ; j < pps[i].size ; ++j)
+//     write(pps[i].data[j]);  // data of PPS
+//   }
+// }
+// here we have a h264 Baseline, 640x360
+// We use a 640x360 extradata, as some video framework (Apple VT) will never
+// attempt to use hardware decoding for small videos.
 static const uint8_t sTestH264ExtraData[] = {
-  0x01, 0x64, 0x00, 0x0a, 0xff, 0xe1, 0x00, 0x17, 0x67, 0x64,
-  0x00, 0x0a, 0xac, 0xd9, 0x44, 0x26, 0x84, 0x00, 0x00, 0x03,
-  0x00, 0x04, 0x00, 0x00, 0x03, 0x00, 0xc8, 0x3c, 0x48, 0x96,
-  0x58, 0x01, 0x00, 0x06, 0x68, 0xeb, 0xe3, 0xcb, 0x22, 0xc0
+  0x01, 0x42, 0xc0, 0x1e, 0xff, 0xe1, 0x00, 0x17, 0x67, 0x42,
+  0xc0, 0x1e, 0xbb, 0x40, 0x50, 0x17, 0xfc, 0xb8, 0x08, 0x80,
+  0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0xb5, 0x07, 0x8b, 0x17,
+  0x50, 0x01, 0x00, 0x04, 0x68, 0xce, 0x32, 0xc8
 };
 
 static already_AddRefed<MediaDataDecoder>
 CreateTestH264Decoder(layers::LayersBackend aBackend,
-                      VideoInfo& aConfig)
+                      VideoInfo& aConfig,
+                      FlushableTaskQueue* aTaskQueue)
 {
   aConfig.mMimeType = "video/avc";
   aConfig.mId = 1;
   aConfig.mDuration = 40000;
   aConfig.mMediaTime = 0;
-  aConfig.mDisplay = nsIntSize(64, 64);
-  aConfig.mImage = nsIntRect(0, 0, 64, 64);
+  aConfig.mDisplay = nsIntSize(640, 360);
+  aConfig.mImage = nsIntRect(0, 0, 640, 360);
   aConfig.mExtraData = new MediaByteBuffer();
   aConfig.mExtraData->AppendElements(sTestH264ExtraData,
                                      MOZ_ARRAY_LENGTH(sTestH264ExtraData));
 
   PDMFactory::Init();
 
   RefPtr<PDMFactory> platform = new PDMFactory();
   RefPtr<MediaDataDecoder> decoder(
-    platform->CreateDecoder(aConfig, nullptr, nullptr, aBackend, nullptr));
+    platform->CreateDecoder(aConfig, aTaskQueue, nullptr, aBackend, nullptr));
 
   return decoder.forget();
 }
 
-/* static */ bool
-MP4Decoder::IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aFailureReason)
+/* static */ already_AddRefed<dom::Promise>
+MP4Decoder::IsVideoAccelerated(layers::LayersBackend aBackend, nsIGlobalObject* aParent)
 {
+  MOZ_ASSERT(NS_IsMainThread());
+
+  ErrorResult rv;
+  RefPtr<dom::Promise> promise;
+  promise = dom::Promise::Create(aParent, rv);
+  if (rv.Failed()) {
+    rv.SuppressException();
+    return nullptr;
+  }
+  RefPtr<FlushableTaskQueue> taskQueue =
+    new FlushableTaskQueue(GetMediaThreadPool(MediaThreadType::PLATFORM_DECODER));
   VideoInfo config;
-  RefPtr<MediaDataDecoder> decoder(CreateTestH264Decoder(aBackend, config));
+  RefPtr<MediaDataDecoder> decoder(CreateTestH264Decoder(aBackend, config, taskQueue));
   if (!decoder) {
-    aFailureReason.AssignLiteral("Failed to create H264 decoder");
-    return false;
+    promise->MaybeResolve(NS_LITERAL_STRING("No; Failed to create H264 decoder"));
+    return promise.forget();
   }
-  bool result = decoder->IsHardwareAccelerated(aFailureReason);
-  decoder->Shutdown();
-  return result;
+
+  decoder->Init()
+    ->Then(AbstractThread::MainThread(), __func__,
+           [promise, decoder, taskQueue] (TrackInfo::TrackType aTrack) {
+             nsCString failureReason;
+             bool ok = decoder->IsHardwareAccelerated(failureReason);
+             nsAutoString result;
+             if (ok) {
+               result.AssignLiteral("Yes");
+             } else {
+               result.AssignLiteral("No");
+               if (failureReason.Length()) {
+                 result.AppendLiteral("; ");
+                 AppendUTF8toUTF16(failureReason, result);
+               }
+             }
+             promise->MaybeResolve(result);
+             decoder->Shutdown();
+             taskQueue->BeginShutdown();
+             taskQueue->AwaitShutdownAndIdle();
+           },
+           [promise, decoder, taskQueue] (MediaDataDecoder::DecoderFailureReason aResult) {
+             promise->MaybeResolve(NS_LITERAL_STRING("No; Failed to initialize H264 decoder"));
+             decoder->Shutdown();
+             taskQueue->BeginShutdown();
+             taskQueue->AwaitShutdownAndIdle();
+           });
+
+  return promise.forget();
 }
 
 void
 MP4Decoder::GetMozDebugReaderData(nsAString& aString)
 {
   if (mReader) {
     mReader->GetMozDebugReaderData(aString);
   }
--- a/dom/media/fmp4/MP4Decoder.h
+++ b/dom/media/fmp4/MP4Decoder.h
@@ -3,16 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 #if !defined(MP4Decoder_h_)
 #define MP4Decoder_h_
 
 #include "MediaDecoder.h"
 #include "MediaFormatReader.h"
+#include "mozilla/dom/Promise.h"
 
 namespace mozilla {
 
 // Decoder that uses a bundled MP4 demuxer and platform decoders to play MP4.
 class MP4Decoder : public MediaDecoder
 {
 public:
   explicit MP4Decoder(MediaDecoderOwner* aOwner);
@@ -33,17 +34,18 @@ public:
   static bool CanHandleMediaType(const nsACString& aMIMETypeExcludingCodecs,
                                  const nsAString& aCodecs);
 
   static bool CanHandleMediaType(const nsAString& aMIMEType);
 
   // Returns true if the MP4 backend is preffed on.
   static bool IsEnabled();
 
-  static bool IsVideoAccelerated(layers::LayersBackend aBackend, nsACString& aReason);
+  static already_AddRefed<dom::Promise>
+  IsVideoAccelerated(layers::LayersBackend aBackend, nsIGlobalObject* aParent);
 
   void GetMozDebugReaderData(nsAString& aString) override;
 
 private:
   RefPtr<MediaFormatReader> mReader;
 };
 
 } // namespace mozilla
--- a/dom/media/gmp/PGMPAudioDecoder.ipdl
+++ b/dom/media/gmp/PGMPAudioDecoder.ipdl
@@ -13,25 +13,25 @@ include "GMPMessageUtils.h";
 
 namespace mozilla {
 namespace gmp {
 
 async protocol PGMPAudioDecoder
 {
   manager PGMPContent;
 child:
-  InitDecode(GMPAudioCodecData aCodecSettings);
-  Decode(GMPAudioEncodedSampleData aInput);
-  Reset();
-  Drain();
-  DecodingComplete();
+  async InitDecode(GMPAudioCodecData aCodecSettings);
+  async Decode(GMPAudioEncodedSampleData aInput);
+  async Reset();
+  async Drain();
+  async DecodingComplete();
 parent:
-  __delete__();
-  Decoded(GMPAudioDecodedSampleData aDecoded);
-  InputDataExhausted();
-  DrainComplete();
-  ResetComplete();
-  Error(GMPErr aErr);
+  async __delete__();
+  async Decoded(GMPAudioDecodedSampleData aDecoded);
+  async InputDataExhausted();
+  async DrainComplete();
+  async ResetComplete();
+  async Error(GMPErr aErr);
   async Shutdown();
 };
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/PGMPDecryptor.ipdl
+++ b/dom/media/gmp/PGMPDecryptor.ipdl
@@ -15,78 +15,78 @@ using GMPErr from "gmp-errors.h";
 namespace mozilla {
 namespace gmp {
 
 async protocol PGMPDecryptor
 {
   manager PGMPContent;
 child:
 
-  Init();
+  async Init();
 
-  CreateSession(uint32_t aCreateSessionToken,
-                uint32_t aPromiseId,
-                nsCString aInitDataType,
-                uint8_t[] aInitData,
-                GMPSessionType aSessionType);
+  async CreateSession(uint32_t aCreateSessionToken,
+                      uint32_t aPromiseId,
+                      nsCString aInitDataType,
+                      uint8_t[] aInitData,
+                      GMPSessionType aSessionType);
 
-  LoadSession(uint32_t aPromiseId,
-              nsCString aSessionId);
+  async LoadSession(uint32_t aPromiseId,
+                    nsCString aSessionId);
 
-  UpdateSession(uint32_t aPromiseId,
-                nsCString aSessionId,
-                uint8_t[] aResponse);
+  async UpdateSession(uint32_t aPromiseId,
+                      nsCString aSessionId,
+                      uint8_t[] aResponse);
 
-  CloseSession(uint32_t aPromiseId,
-               nsCString aSessionId);
+  async CloseSession(uint32_t aPromiseId,
+                     nsCString aSessionId);
 
-  RemoveSession(uint32_t aPromiseId,
-                nsCString aSessionId);
+  async RemoveSession(uint32_t aPromiseId,
+                      nsCString aSessionId);
 
-  SetServerCertificate(uint32_t aPromiseId,
-                       uint8_t[] aServerCert);
+  async SetServerCertificate(uint32_t aPromiseId,
+                             uint8_t[] aServerCert);
 
-  Decrypt(uint32_t aId,
-          uint8_t[] aBuffer,
-          GMPDecryptionData aMetadata);
+  async Decrypt(uint32_t aId,
+                uint8_t[] aBuffer,
+                GMPDecryptionData aMetadata);
 
-  DecryptingComplete();
+  async DecryptingComplete();
 
 parent:
-  __delete__();
+  async __delete__();
 
-  SetSessionId(uint32_t aCreateSessionToken,
-               nsCString aSessionId);
+  async SetSessionId(uint32_t aCreateSessionToken,
+                     nsCString aSessionId);
 
-  ResolveLoadSessionPromise(uint32_t aPromiseId,
-                            bool aSuccess);
+  async ResolveLoadSessionPromise(uint32_t aPromiseId,
+                                  bool aSuccess);
 
-  ResolvePromise(uint32_t aPromiseId);
+  async ResolvePromise(uint32_t aPromiseId);
 
-  RejectPromise(uint32_t aPromiseId,
-                GMPDOMException aDOMExceptionCode,
-                nsCString aMessage);
+  async RejectPromise(uint32_t aPromiseId,
+                      GMPDOMException aDOMExceptionCode,
+                      nsCString aMessage);
 
-  SessionMessage(nsCString aSessionId,
-                 GMPSessionMessageType aMessageType,
-                 uint8_t[] aMessage);
+  async SessionMessage(nsCString aSessionId,
+                       GMPSessionMessageType aMessageType,
+                       uint8_t[] aMessage);
 
-  ExpirationChange(nsCString aSessionId, double aExpiryTime);
+  async ExpirationChange(nsCString aSessionId, double aExpiryTime);
 
-  SessionClosed(nsCString aSessionId);
+  async SessionClosed(nsCString aSessionId);
 
-  SessionError(nsCString aSessionId,
-               GMPDOMException aDOMExceptionCode,
-               uint32_t aSystemCode,
-               nsCString aMessage);
+  async SessionError(nsCString aSessionId,
+                     GMPDOMException aDOMExceptionCode,
+                     uint32_t aSystemCode,
+                     nsCString aMessage);
 
-  KeyStatusChanged(nsCString aSessionId, uint8_t[] aKey,
-                   GMPMediaKeyStatus aStatus);
+  async KeyStatusChanged(nsCString aSessionId, uint8_t[] aKey,
+                         GMPMediaKeyStatus aStatus);
 
-  SetCaps(uint64_t aCaps);
+  async SetCaps(uint64_t aCaps);
 
-  Decrypted(uint32_t aId, GMPErr aResult, uint8_t[] aBuffer);
+  async Decrypted(uint32_t aId, GMPErr aResult, uint8_t[] aBuffer);
 
   async Shutdown();
 };
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/PGMPStorage.ipdl
+++ b/dom/media/gmp/PGMPStorage.ipdl
@@ -11,26 +11,26 @@ using GMPErr from "gmp-errors.h";
 namespace mozilla {
 namespace gmp {
 
 async protocol PGMPStorage
 {
   manager PGMP;
 
 child:
-  OpenComplete(nsCString aRecordName, GMPErr aStatus);
-  ReadComplete(nsCString aRecordName, GMPErr aStatus, uint8_t[] aBytes);
-  WriteComplete(nsCString aRecordName, GMPErr aStatus);
-  RecordNames(nsCString[] aRecordNames, GMPErr aStatus);
-  Shutdown();
+  async OpenComplete(nsCString aRecordName, GMPErr aStatus);
+  async ReadComplete(nsCString aRecordName, GMPErr aStatus, uint8_t[] aBytes);
+  async WriteComplete(nsCString aRecordName, GMPErr aStatus);
+  async RecordNames(nsCString[] aRecordNames, GMPErr aStatus);
+  async Shutdown();
 
 parent:
-  Open(nsCString aRecordName);
-  Read(nsCString aRecordName);
-  Write(nsCString aRecordName, uint8_t[] aBytes);
-  Close(nsCString aRecordName);
-  GetRecordNames();
-  __delete__();
+  async Open(nsCString aRecordName);
+  async Read(nsCString aRecordName);
+  async Write(nsCString aRecordName, uint8_t[] aBytes);
+  async Close(nsCString aRecordName);
+  async GetRecordNames();
+  async __delete__();
 
 };
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/gmp/PGMPTimer.ipdl
+++ b/dom/media/gmp/PGMPTimer.ipdl
@@ -7,16 +7,16 @@ include protocol PGMP;
 
 namespace mozilla {
 namespace gmp {
 
 async protocol PGMPTimer
 {
   manager PGMP;
 child:
-  TimerExpired(uint32_t aTimerId);
+  async TimerExpired(uint32_t aTimerId);
 parent:
-  SetTimer(uint32_t aTimerId, uint32_t aTimeoutMs);
-  __delete__();
+  async SetTimer(uint32_t aTimerId, uint32_t aTimeoutMs);
+  async __delete__();
 };
 
 } // namespace gmp
 } // namespace mozilla
--- a/dom/media/systemservices/PMedia.ipdl
+++ b/dom/media/systemservices/PMedia.ipdl
@@ -23,29 +23,29 @@ parent:
    * If no key exists, a temporal one is created.
    * If aPersist is true and key is temporal, the key is promoted to persistent.
    * Once persistent, a key cannot become temporal again.
    *
    * If aPrivateBrowsing is true, a different key for this origin is returned
    * from a secondary pool that is never persisted to disk, and aPersist is
    * ignored.
    */
-  GetOriginKey(uint32_t aRequestId, nsCString aOrigin, bool aPrivateBrowsing,
-               bool aPersist);
+  async GetOriginKey(uint32_t aRequestId, nsCString aOrigin, bool aPrivateBrowsing,
+                     bool aPersist);
 
   /**
    * Clear per-orgin list of persistent deviceIds stored for enumerateDevices
    * Fire and forget.
    *
    * aSinceTime - milliseconds since 1 January 1970 00:00:00 UTC. 0 = clear all
    *
    * aOnlyPrivateBrowsing - if true then only purge the separate in-memory
    *                        per-origin list used in Private Browsing.
    */
-  SanitizeOriginKeys(uint64_t aSinceWhen, bool aOnlyPrivateBrowsing);
+  async SanitizeOriginKeys(uint64_t aSinceWhen, bool aOnlyPrivateBrowsing);
 
 child:
-  GetOriginKeyResponse(uint32_t aRequestId, nsCString key);
-  __delete__();
+  async GetOriginKeyResponse(uint32_t aRequestId, nsCString key);
+  async __delete__();
 };
 
 } // namespace media
 } // namespace mozilla
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -134,17 +134,17 @@ skip-if = toolkit == 'gonk' # B2G emulat
 [test_peerConnection_offerRequiresReceiveAudio.html]
 [test_peerConnection_offerRequiresReceiveVideo.html]
 skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
 [test_peerConnection_offerRequiresReceiveVideoAudio.html]
 skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_promiseSendOnly.html]
 skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_simulcastOffer.html]
-skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version  || (os == 'linux' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), no simulcast support on android, linux (bug 1242058)
+skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version # b2g(Bug 960442, video support for WebRTC is disabled on b2g), no simulcast support on android
 #[test_peerConnection_relayOnly.html]
 #skip-if = toolkit == 'gonk' || buildapp == 'mulet' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
 [test_peerConnection_callbacks.html]
 skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_replaceTrack.html]
 skip-if = toolkit == 'gonk' || buildapp == 'mulet' || android_version == '18' # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
 [test_peerConnection_syncSetDescription.html]
 skip-if = toolkit == 'gonk' || buildapp == 'mulet' || (android_version == '18' && debug) # b2g(Bug 960442, video support for WebRTC is disabled on b2g), android(Bug 1189784, timeouts on 4.3 emulator)
--- a/dom/media/tests/mochitest/test_peerConnection_simulcastOffer.html
+++ b/dom/media/tests/mochitest/test_peerConnection_simulcastOffer.html
@@ -47,17 +47,19 @@
     ]);
 
   var ensureNoColorChange = (helper, canvas) => Promise.race([
       waitForColorChange(helper, canvas).then(() => ok(false, "Color should not change")),
       wait(2000).then(() => ok(true, "No color change"))
   ]);
 
   runNetworkTest(() =>
-    pushPrefs(['media.peerconnection.simulcast', true]).then(() => {
+    pushPrefs(['media.peerconnection.simulcast', true],
+              ['media.peerconnection.video.min_bitrate_estimate', 100*1000]).then(() => {
+      SimpleTest.requestCompleteLog();
       var stream;
       var helper = new CaptureStreamTestHelper2D(50,50);
       var canvas = helper.createAndAppendElement('canvas', 'source_canvas');
       helper.drawColor(canvas, helper.green); // Make sure this is initted
 
       test = new PeerConnectionTest({bundle: false});
       test.setMediaConstraints([{video: true}], []);
 
--- a/dom/media/webrtc/PWebrtcGlobal.ipdl
+++ b/dom/media/webrtc/PWebrtcGlobal.ipdl
@@ -11,23 +11,23 @@ using WebrtcGlobalLog from "mozilla/medi
 
 namespace mozilla {
 namespace dom {
 
 async protocol PWebrtcGlobal {
   manager PContent;
 
 child: // parent -> child messages
-  GetStatsRequest(int aRequestId, nsString aPcIdFilter);
-  ClearStatsRequest();
-  GetLogRequest(int aRequestId, nsCString aPattern);
-  ClearLogRequest();
-  SetAecLogging(bool aEnable);
-  SetDebugMode(int aLevel);
+  async GetStatsRequest(int aRequestId, nsString aPcIdFilter);
+  async ClearStatsRequest();
+  async GetLogRequest(int aRequestId, nsCString aPattern);
+  async ClearLogRequest();
+  async SetAecLogging(bool aEnable);
+  async SetDebugMode(int aLevel);
 
 parent: // child -> parent messages
-  GetStatsResult(int aRequestId, RTCStatsReportInternal[] aStats);
-  GetLogResult(int aRequestId, WebrtcGlobalLog aLog);
-  __delete__();
+  async GetStatsResult(int aRequestId, RTCStatsReportInternal[] aStats);
+  async GetLogResult(int aRequestId, WebrtcGlobalLog aLog);
+  async __delete__();
 };
 
 } // end namespace net
 } // end namespace mozilla
--- a/dom/media/webspeech/synth/ipc/PSpeechSynthesis.ipdl
+++ b/dom/media/webspeech/synth/ipc/PSpeechSynthesis.ipdl
@@ -20,28 +20,28 @@ struct RemoteVoice {
 
 sync protocol PSpeechSynthesis
 {
   manager PContent;
   manages PSpeechSynthesisRequest;
 
 child:
 
-    VoiceAdded(RemoteVoice aVoice);
+    async VoiceAdded(RemoteVoice aVoice);
 
-    VoiceRemoved(nsString aUri);
+    async VoiceRemoved(nsString aUri);
 
-    SetDefaultVoice(nsString aUri, bool aIsDefault);
+    async SetDefaultVoice(nsString aUri, bool aIsDefault);
 
-    IsSpeakingChanged(bool aIsSpeaking);
+    async IsSpeakingChanged(bool aIsSpeaking);
 
 parent:
-    __delete__();
+    async __delete__();
 
-    PSpeechSynthesisRequest(nsString aText, nsString aUri, nsString aLang,
-                            float aVolume, float aRate, float aPitch);
+    async PSpeechSynthesisRequest(nsString aText, nsString aUri, nsString aLang,
+                                  float aVolume, float aRate, float aPitch);
 
     sync ReadVoicesAndState() returns (RemoteVoice[] aVoices,
                                        nsString[] aDefaults, bool aIsSpeaking);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/media/webspeech/synth/ipc/PSpeechSynthesisRequest.ipdl
+++ b/dom/media/webspeech/synth/ipc/PSpeechSynthesisRequest.ipdl
@@ -10,37 +10,37 @@ namespace mozilla {
 namespace dom {
 
 async protocol PSpeechSynthesisRequest
 {
   manager PSpeechSynthesis;
 
  parent:
 
-  __delete__();
+  async __delete__();
 
-  Pause();
+  async Pause();
 
-  Resume();
+  async Resume();
 
-  Cancel();
+  async Cancel();
 
-  ForceEnd();
+  async ForceEnd();
 
-  SetAudioOutputVolume(float aVolume);
+  async SetAudioOutputVolume(float aVolume);
 
  child:
 
-  OnEnd(bool aIsError, float aElapsedTime, uint32_t aCharIndex);
+  async OnEnd(bool aIsError, float aElapsedTime, uint32_t aCharIndex);
 
-  OnStart(nsString aUri);
+  async OnStart(nsString aUri);
 
-  OnPause(float aElapsedTime, uint32_t aCharIndex);
+  async OnPause(float aElapsedTime, uint32_t aCharIndex);
 
-  OnResume(float aElapsedTime, uint32_t aCharIndex);
+  async OnResume(float aElapsedTime, uint32_t aCharIndex);
 
-  OnBoundary(nsString aName, float aElapsedTime, uint32_t aCharIndex);
+  async OnBoundary(nsString aName, float aElapsedTime, uint32_t aCharIndex);
 
-  OnMark(nsString aName, float aElapsedTime, uint32_t aCharIndex);
+  async OnMark(nsString aName, float aElapsedTime, uint32_t aCharIndex);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/messagechannel/PMessagePort.ipdl
+++ b/dom/messagechannel/PMessagePort.ipdl
@@ -39,24 +39,24 @@ protocol PMessagePort
 
   /* When the port is transferred the sequence is:
      1. SendStopSendingData();
      2. RecvStopSendingDataConfirmed();
      3. SendDisentangle();
      4. Recv__delete__(); */
 
 parent:
-  PostMessages(MessagePortMessage[] messages);
-  Disentangle(MessagePortMessage[] messages);
-  StopSendingData();
-  Close();
+  async PostMessages(MessagePortMessage[] messages);
+  async Disentangle(MessagePortMessage[] messages);
+  async StopSendingData();
+  async Close();
 
 child:
-  Entangled(MessagePortMessage[] messages);
-  ReceiveData(MessagePortMessage[] messages);
-  StopSendingDataConfirmed();
+  async Entangled(MessagePortMessage[] messages);
+  async ReceiveData(MessagePortMessage[] messages);
+  async StopSendingDataConfirmed();
 
-  __delete__();
+  async __delete__();
 };
 
 } // namespace dom
 } // namespace mozilla
 
--- a/dom/mobileconnection/ipc/PMobileConnection.ipdl
+++ b/dom/mobileconnection/ipc/PMobileConnection.ipdl
@@ -13,39 +13,39 @@ namespace dom {
 namespace mobileconnection {
 
 sync protocol PMobileConnection
 {
   manager PContent;
   manages PMobileConnectionRequest;
 
 child:
-  NotifyVoiceInfoChanged(nsMobileConnectionInfo aInfo);
-  NotifyDataInfoChanged(nsMobileConnectionInfo aInfo);
-  NotifyDataError(nsString aMessage);
-  NotifyCFStateChanged(uint16_t aAction, uint16_t aReason, nsString aNumber,
-                       uint16_t aTimeSeconds, uint16_t aServiceClass);
-  NotifyEmergencyCbModeChanged(bool aActive, uint32_t aTimeoutMs);
-  NotifyOtaStatusChanged(nsString aStatus);
-  NotifyRadioStateChanged(int32_t aRadioState);
-  NotifyClirModeChanged(uint32_t aMode);
-  NotifyLastNetworkChanged(nsString aNetwork);
-  NotifyLastHomeNetworkChanged(nsString aNetwork);
-  NotifyNetworkSelectionModeChanged(int32_t aMode);
+  async NotifyVoiceInfoChanged(nsMobileConnectionInfo aInfo);
+  async NotifyDataInfoChanged(nsMobileConnectionInfo aInfo);
+  async NotifyDataError(nsString aMessage);
+  async NotifyCFStateChanged(uint16_t aAction, uint16_t aReason, nsString aNumber,
+                             uint16_t aTimeSeconds, uint16_t aServiceClass);
+  async NotifyEmergencyCbModeChanged(bool aActive, uint32_t aTimeoutMs);
+  async NotifyOtaStatusChanged(nsString aStatus);
+  async NotifyRadioStateChanged(int32_t aRadioState);
+  async NotifyClirModeChanged(uint32_t aMode);
+  async NotifyLastNetworkChanged(nsString aNetwork);
+  async NotifyLastHomeNetworkChanged(nsString aNetwork);
+  async NotifyNetworkSelectionModeChanged(int32_t aMode);
 
 parent:
   /**
    * Send when child no longer needs to use PMobileConnection.
    */
-  __delete__();
+  async __delete__();
 
   /**
    * Sent when the child makes an asynchronous request to the parent.
    */
-  PMobileConnectionRequest(MobileConnectionRequest aRequest);
+  async PMobileConnectionRequest(MobileConnectionRequest aRequest);
 
   /**
    * Sync call only be called once per child actor for initialization.
    */
   sync Init()
     returns (nsMobileConnectionInfo aVoice, nsMobileConnectionInfo aData,
              nsString aLastKnownNetwork, nsString aLastKnownHomeNetwork,
              int32_t aNetworkSelectionMode, int32_t aRadioState,
--- a/dom/mobileconnection/ipc/PMobileConnectionRequest.ipdl
+++ b/dom/mobileconnection/ipc/PMobileConnectionRequest.ipdl
@@ -14,17 +14,17 @@ namespace mobileconnection {
 protocol PMobileConnectionRequest
 {
   manager PMobileConnection;
 
 child:
   /**
    * Send when asynchronous request has completed.
    */
-  __delete__(MobileConnectionReply aResponse);
+  async __delete__(MobileConnectionReply aResponse);
 };
 
 /**
  * MobileConnectionReply
  */
 // Success
 struct MobileConnectionReplySuccess
 {
--- a/dom/mobilemessage/ipc/PMobileMessageCursor.ipdl
+++ b/dom/mobilemessage/ipc/PMobileMessageCursor.ipdl
@@ -12,22 +12,22 @@ namespace mozilla {
 namespace dom {
 namespace mobilemessage {
 
 protocol PMobileMessageCursor
 {
   manager PSms;
 
 child:
-  NotifyResult(MobileMessageCursorData aData);
+  async NotifyResult(MobileMessageCursorData aData);
 
   /**
    * Sent when the asynchronous cursor request has completed.
    */
-  __delete__(int32_t aError);
+  async __delete__(int32_t aError);
 
 parent:
-  Continue();
+  async Continue();
 };
 
 } // namespace mobilemessage
 } // namespace dom
 } // namespace mozilla
--- a/dom/mobilemessage/ipc/PSms.ipdl
+++ b/dom/mobilemessage/ipc/PSms.ipdl
@@ -106,53 +106,53 @@ union IPCMobileMessageCursor
 };
 
 sync protocol PSms {
     manager PContent;
     manages PSmsRequest;
     manages PMobileMessageCursor;
 
 child:
-  NotifyReceivedMessage(MobileMessageData aMessageData);
+  async NotifyReceivedMessage(MobileMessageData aMessageData);
 
-  NotifyRetrievingMessage(MobileMessageData aMessageData);
+  async NotifyRetrievingMessage(MobileMessageData aMessageData);
 
-  NotifySendingMessage(MobileMessageData aMessageData);
+  async NotifySendingMessage(MobileMessageData aMessageData);
 
-  NotifySentMessage(MobileMessageData aMessageData);
+  async NotifySentMessage(MobileMessageData aMessageData);
 
-  NotifyFailedMessage(MobileMessageData aMessageData);
+  async NotifyFailedMessage(MobileMessageData aMessageData);
 
-  NotifyDeliverySuccessMessage(MobileMessageData aMessageData);
+  async NotifyDeliverySuccessMessage(MobileMessageData aMessageData);
 
-  NotifyDeliveryErrorMessage(MobileMessageData aMessageData);
+  async NotifyDeliveryErrorMessage(MobileMessageData aMessageData);
 
-  NotifyReceivedSilentMessage(MobileMessageData aMessageData);
+  async NotifyReceivedSilentMessage(MobileMessageData aMessageData);
 
-  NotifyReadSuccessMessage(MobileMessageData aMessageData);
+  async NotifyReadSuccessMessage(MobileMessageData aMessageData);
 
-  NotifyReadErrorMessage(MobileMessageData aMessageData);
+  async NotifyReadErrorMessage(MobileMessageData aMessageData);
 
-  NotifyDeletedMessageInfo(DeletedMessageInfoData aDeletedInfo);
+  async NotifyDeletedMessageInfo(DeletedMessageInfoData aDeletedInfo);
 
 parent:
   /**
    * Sent when the child no longer needs to use sms.
    */
-  __delete__();
+  async __delete__();
 
   /**
    * Sent when the child makes an asynchronous request to the parent.
    */
-  PSmsRequest(IPCSmsRequest request);
+  async PSmsRequest(IPCSmsRequest request);
 
   /**
    * Sent when the child makes an asynchronous cursor to the parent.
    */
-  PMobileMessageCursor(IPCMobileMessageCursor request);
+  async PMobileMessageCursor(IPCMobileMessageCursor request);
 
-  AddSilentNumber(nsString aNumber);
-  RemoveSilentNumber(nsString aNumber);
+  async AddSilentNumber(nsString aNumber);
+  async RemoveSilentNumber(nsString aNumber);
 };
 
 } // namespace mobilemessage
 } // namespace dom
 } // namespace mozilla
--- a/dom/mobilemessage/ipc/PSmsRequest.ipdl
+++ b/dom/mobilemessage/ipc/PSmsRequest.ipdl
@@ -17,17 +17,17 @@ namespace mobilemessage {
 protocol PSmsRequest
 {
   manager PSms;
 
 child:
   /**
    * Sent when the asynchronous request has completed.
    */
-  __delete__(MessageReply response);
+  async __delete__(MessageReply response);
 };
 
 struct ReplyMessageSend
 {
   MobileMessageData messageData;
 };
 
 union OptionalMobileMessageData
--- a/dom/network/PTCPServerSocket.ipdl
+++ b/dom/network/PTCPServerSocket.ipdl
@@ -14,19 +14,19 @@ namespace mozilla {
 namespace net {
 
 //-------------------------------------------------------------------
 protocol PTCPServerSocket
 {
   manager PNecko;
 
 parent:
-  Close();
-  RequestDelete();
+  async Close();
+  async RequestDelete();
 
 child:
-  CallbackAccept(PTCPSocket socket);
-  __delete__();
+  async CallbackAccept(PTCPSocket socket);
+  async __delete__();
 };
 
 } // namespace net
 } // namespace mozilla
 
--- a/dom/network/PTCPSocket.ipdl
+++ b/dom/network/PTCPSocket.ipdl
@@ -34,50 +34,50 @@ namespace net {
 protocol PTCPSocket
 {
   manager PNecko;
 
 parent:
   // Forward calling to child's open() method to parent, expect TCPOptions
   // is expanded to |useSSL| (from TCPOptions.useSecureTransport) and
   // |binaryType| (from TCPOption.binaryType).
-  Open(nsString host, uint16_t port, bool useSSL, bool useArrayBuffers);
+  async Open(nsString host, uint16_t port, bool useSSL, bool useArrayBuffers);
 
   // Ask parent to open a socket and bind the newly-opened socket to a local
   // address specified in |localAddr| and |localPort|.
-  OpenBind(nsCString host, uint16_t port,
-           nsCString localAddr, uint16_t localPort,
-           bool useSSL, bool aUseArrayBuffers);
+  async OpenBind(nsCString host, uint16_t port,
+                 nsCString localAddr, uint16_t localPort,
+                 bool useSSL, bool aUseArrayBuffers);
 
   // When child's send() is called, this message requrests parent to send
   // data and update it's trackingNumber.
-  Data(SendableData data, uint32_t trackingNumber);
+  async Data(SendableData data, uint32_t trackingNumber);
 
   // Forward calling to child's upgradeToSecure() method to parent.
-  StartTLS();
+  async StartTLS();
 
   // Forward calling to child's send() method to parent.
-  Suspend();
+  async Suspend();
 
   // Forward calling to child's resume() method to parent.
-  Resume();
+  async Resume();
 
   // Forward calling to child's close() method to parent.
-  Close();
+  async Close();
 
 child:
   // Forward events that are dispatched by parent.
-  Callback(nsString type, CallbackData data, uint32_t readyState);
+  async Callback(nsString type, CallbackData data, uint32_t readyState);
 
   // Update child's bufferedAmount when parent's bufferedAmount is updated.
   // trackingNumber is also passed back to child to ensure the bufferedAmount
   // is corresponding the last call to send().
-  UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber);
+  async UpdateBufferedAmount(uint32_t bufferedAmount, uint32_t trackingNumber);
 
 both:
-  RequestDelete();
-  __delete__();
+  async RequestDelete();
+  async __delete__();
 };
 
 
 } // namespace net
 } // namespace mozilla
 
--- a/dom/network/PUDPSocket.ipdl
+++ b/dom/network/PUDPSocket.ipdl
@@ -36,33 +36,33 @@ namespace mozilla {
 namespace net {
 
 //-------------------------------------------------------------------
 protocol PUDPSocket
 {
   manager PNecko or PBackground;
 
 parent:
-  Bind(UDPAddressInfo addressInfo, bool addressReuse, bool loopback);
-  Connect(UDPAddressInfo addressInfo);
+  async Bind(UDPAddressInfo addressInfo, bool addressReuse, bool loopback);
+  async Connect(UDPAddressInfo addressInfo);
 
-  OutgoingData(UDPData data, UDPSocketAddr addr);
+  async OutgoingData(UDPData data, UDPSocketAddr addr);
 
-  JoinMulticast(nsCString multicastAddress, nsCString iface);
-  LeaveMulticast(nsCString multicastAddress, nsCString iface);
+  async JoinMulticast(nsCString multicastAddress, nsCString iface);
+  async LeaveMulticast(nsCString multicastAddress, nsCString iface);
 
-  Close();
+  async Close();
 
-  RequestDelete();
+  async RequestDelete();
 
 child:
-  CallbackOpened(UDPAddressInfo addressInfo);
-  CallbackConnected(UDPAddressInfo addressInfo);
-  CallbackClosed();
-  CallbackReceivedData(UDPAddressInfo addressInfo, uint8_t[] data);
-  CallbackError(nsCString message, nsCString filename, uint32_t lineNumber);
-  __delete__();
+  async CallbackOpened(UDPAddressInfo addressInfo);
+  async CallbackConnected(UDPAddressInfo addressInfo);
+  async CallbackClosed();
+  async CallbackReceivedData(UDPAddressInfo addressInfo, uint8_t[] data);
+  async CallbackError(nsCString message, nsCString filename, uint32_t lineNumber);
+  async __delete__();
 };
 
 
 } // namespace net
 } // namespace mozilla
 
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -132,16 +132,17 @@ using mozilla::dom::FakePluginTagInit;
     }                                                                \
   }
 
 // this is the name of the directory which will be created
 // to cache temporary files.
 #define kPluginTmpDirName NS_LITERAL_CSTRING("plugtmp")
 
 static const char *kPrefWhitelist = "plugin.allowed_types";
+static const char *kPrefLoadInParentPrefix = "plugin.load_in_parent_process.";
 static const char *kPrefDisableFullPage = "plugin.disable_full_page_plugin_for_types";
 static const char *kPrefJavaMIME = "plugin.java.mime";
 
 // How long we wait before unloading an idle plugin process.
 // Defaults to 30 seconds.
 static const char *kPrefUnloadPluginTimeoutSecs = "dom.ipc.plugins.unloadTimeoutSecs";
 static const uint32_t kDefaultPluginUnloadingTimeout = 30;
 
@@ -2757,16 +2758,24 @@ nsPluginHost::IsTypeWhitelisted(const ch
   nsAdoptingCString whitelist = Preferences::GetCString(kPrefWhitelist);
   if (!whitelist.Length()) {
     return true;
   }
   nsDependentCString wrap(aMimeType);
   return IsTypeInList(wrap, whitelist);
 }
 
+/* static */ bool
+nsPluginHost::ShouldLoadTypeInParent(const nsACString& aMimeType)
+{
+  nsCString prefName(kPrefLoadInParentPrefix);
+  prefName += aMimeType;
+  return Preferences::GetBool(prefName.get(), false);
+}
+
 void
 nsPluginHost::RegisterWithCategoryManager(const nsCString& aMimeType,
                                           nsRegisterType aType)
 {
   PLUGIN_LOG(PLUGIN_LOG_NORMAL,
              ("nsPluginTag::RegisterWithCategoryManager type = %s, removing = %s\n",
               aMimeType.get(), aType == ePluginUnregister ? "yes" : "no"));
 
--- a/dom/plugins/base/nsPluginHost.h
+++ b/dom/plugins/base/nsPluginHost.h
@@ -184,16 +184,21 @@ public:
                       nsIChannel *aGenericChannel);
 
   static nsresult GetPluginTempDir(nsIFile **aDir);
 
   // Helper that checks if a type is whitelisted in plugin.allowed_types.
   // Always returns true if plugin.allowed_types is not set
   static bool IsTypeWhitelisted(const char *aType);
 
+  // Helper that checks if a plugin of a given MIME type can be loaded by the
+  // parent process. It checks the plugin.load_in_parent_process.<mime> pref.
+  // Always returns false if plugin.load_in_parent_process.<mime> is not set.
+  static bool ShouldLoadTypeInParent(const nsACString& aMimeType);
+
   // checks whether aType is a type we recognize for potential special handling
   enum SpecialType { eSpecialType_None,
                      // Needed to whitelist for async init support
                      eSpecialType_Test,
                      // Informs some decisions about OOP and quirks
                      eSpecialType_Flash,
                      // Binds to the <applet> tag, has various special
                      // rules around opening channels, codebase, ...
--- a/dom/plugins/ipc/PPluginBackgroundDestroyer.ipdl
+++ b/dom/plugins/ipc/PPluginBackgroundDestroyer.ipdl
@@ -22,16 +22,16 @@ namespace plugins {
  */
 protocol PPluginBackgroundDestroyer {
     manager PPluginInstance;
 
     // The ctor message for this protocol serves double-duty as
     // notification that that the background is stale.
 
 parent:
-    __delete__();
+    async __delete__();
 
 state DESTROYING:
     recv __delete__;
 };
 
 }  // namespace plugins
 }  // namespace mozilla
--- a/dom/presentation/ipc/PPresentation.ipdl
+++ b/dom/presentation/ipc/PPresentation.ipdl
@@ -45,32 +45,32 @@ union PresentationIPCRequest
 };
 
 sync protocol PPresentation
 {
   manager PContent;
   manages PPresentationRequest;
 
 child:
-  NotifyAvailableChange(bool aAvailable);
-  NotifySessionStateChange(nsString aSessionId, uint16_t aState);
-  NotifyMessage(nsString aSessionId, nsCString aData);
-  NotifySessionConnect(uint64_t aWindowId, nsString aSessionId);
+  async NotifyAvailableChange(bool aAvailable);
+  async NotifySessionStateChange(nsString aSessionId, uint16_t aState);
+  async NotifyMessage(nsString aSessionId, nsCString aData);
+  async NotifySessionConnect(uint64_t aWindowId, nsString aSessionId);
 
 parent:
-  __delete__();
+  async __delete__();
 
-  RegisterAvailabilityHandler();
-  UnregisterAvailabilityHandler();
+  async RegisterAvailabilityHandler();
+  async UnregisterAvailabilityHandler();
 
-  RegisterSessionHandler(nsString aSessionId);
-  UnregisterSessionHandler(nsString aSessionId);
+  async RegisterSessionHandler(nsString aSessionId);
+  async UnregisterSessionHandler(nsString aSessionId);
 
-  RegisterRespondingHandler(uint64_t aWindowId);
-  UnregisterRespondingHandler(uint64_t aWindowId);
+  async RegisterRespondingHandler(uint64_t aWindowId);
+  async UnregisterRespondingHandler(uint64_t aWindowId);
 
-  PPresentationRequest(PresentationIPCRequest aRequest);
+  async PPresentationRequest(PresentationIPCRequest aRequest);
 
-  NotifyReceiverReady(nsString aSessionId);
+  async NotifyReceiverReady(nsString aSessionId);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/presentation/ipc/PPresentationRequest.ipdl
+++ b/dom/presentation/ipc/PPresentationRequest.ipdl
@@ -9,13 +9,13 @@ include protocol PPresentation;
 namespace mozilla {
 namespace dom {
 
 sync protocol PPresentationRequest
 {
   manager PPresentation;
 
 child:
-  __delete__(nsresult result);
+  async __delete__(nsresult result);
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/quota/PQuota.ipdl
+++ b/dom/quota/PQuota.ipdl
@@ -59,22 +59,22 @@ union RequestParams
 protocol PQuota
 {
   manager PBackground;
 
   manages PQuotaRequest;
   manages PQuotaUsageRequest;
 
 parent:
-  __delete__();
+  async __delete__();
 
-  PQuotaUsageRequest(UsageRequestParams params);
+  async PQuotaUsageRequest(UsageRequestParams params);
 
-  PQuotaRequest(RequestParams params);
+  async PQuotaRequest(RequestParams params);
 
-  StartIdleMaintenance();
+  async StartIdleMaintenance();
 
-  StopIdleMaintenance();
+  async StopIdleMaintenance();
 };
 
 } // namespace quota
 } // namespace dom
 } // namespace mozilla
--- a/dom/quota/PQuotaRequest.ipdl
+++ b/dom/quota/PQuotaRequest.ipdl
@@ -33,14 +33,14 @@ union RequestResponse
   ResetAllResponse;
 };
 
 protocol PQuotaRequest
 {
   manager PQuota;
 
 child:
-  __delete__(RequestResponse response);
+  async __delete__(RequestResponse response);
 };
 
 } // namespace quota
 } // namespace dom
 } // namespace mozilla
--- a/dom/quota/PQuotaUsageRequest.ipdl
+++ b/dom/quota/PQuotaUsageRequest.ipdl
@@ -20,17 +20,17 @@ union UsageRequestResponse
   UsageResponse;
 };
 
 protocol PQuotaUsageRequest
 {
   manager PQuota;
 
 parent:
-  Cancel();
+  async Cancel();
 
 child:
-  __delete__(UsageRequestResponse response);
+  async __delete__(UsageRequestResponse response);
 };
 
 } // namespace quota
 } // namespace dom
 } // namespace mozilla
--- a/dom/storage/DOMStorageDBThread.cpp
+++ b/dom/storage/DOMStorageDBThread.cpp
@@ -1202,42 +1202,16 @@ namespace {
 bool OriginPatternMatches(const nsACString& aOriginSuffix, const OriginAttributesPattern& aPattern)
 {
   PrincipalOriginAttributes oa;
   DebugOnly<bool> rv = oa.PopulateFromSuffix(aOriginSuffix);
   MOZ_ASSERT(rv);
   return aPattern.Matches(oa);
 }
 
-PLDHashOperator
-ForgetUpdatesForOrigin(const nsACString& aMapping,
-                      nsAutoPtr<DOMStorageDBThread::DBOperation>& aPendingTask,
-                      void* aArg)
-{
-  DOMStorageDBThread::DBOperation* newOp = static_cast<DOMStorageDBThread::DBOperation*>(aArg);
-
-  if (newOp->Type() == DOMStorageDBThread::DBOperation::opClear &&
-      (aPendingTask->OriginNoSuffix() != newOp->OriginNoSuffix() ||
-       aPendingTask->OriginSuffix() != newOp->OriginSuffix())) {
-    return PL_DHASH_NEXT;
-  }
-
-  if (newOp->Type() == DOMStorageDBThread::DBOperation::opClearMatchingOrigin &&
-      !StringBeginsWith(aPendingTask->OriginNoSuffix(), newOp->Origin())) {
-    return PL_DHASH_NEXT;
-  }
-
-  if (newOp->Type() == DOMStorageDBThread::DBOperation::opClearMatchingOriginAttributes &&
-      !OriginPatternMatches(aPendingTask->OriginSuffix(), newOp->OriginPattern())) {
-    return PL_DHASH_NEXT;
-  }
-
-  return PL_DHASH_REMOVE;
-}
-
 } // namespace
 
 bool
 DOMStorageDBThread::PendingOperations::CheckForCoalesceOpportunity(DBOperation* aNewOp,
                                                                    DBOperation::OperationType aPendingType,
                                                                    DBOperation::OperationType aNewType)
 {
   if (aNewOp->Type() != aNewType) {
@@ -1299,61 +1273,72 @@ DOMStorageDBThread::PendingOperations::A
 
   case DBOperation::opClear:
   case DBOperation::opClearMatchingOrigin:
   case DBOperation::opClearMatchingOriginAttributes:
     // Drop all update (insert/remove) operations for equivavelent or matching scope.
     // We do this as an optimization as well as a must based on the logic,
     // if we would not delete the update tasks, changes would have been stored
     // to the database after clear operations have been executed.
-    mUpdates.Enumerate(ForgetUpdatesForOrigin, aOperation);
+    for (auto iter = mUpdates.Iter(); !iter.Done(); iter.Next()) {
+      nsAutoPtr<DBOperation>& pendingTask = iter.Data();
+
+      if (aOperation->Type() == DBOperation::opClear &&
+          (pendingTask->OriginNoSuffix() != aOperation->OriginNoSuffix() ||
+           pendingTask->OriginSuffix() != aOperation->OriginSuffix())) {
+        continue;
+      }
+
+      if (aOperation->Type() == DBOperation::opClearMatchingOrigin &&
+          !StringBeginsWith(pendingTask->OriginNoSuffix(), aOperation->Origin())) {
+        continue;
+      }
+
+      if (aOperation->Type() == DBOperation::opClearMatchingOriginAttributes &&
+          !OriginPatternMatches(pendingTask->OriginSuffix(), aOperation->OriginPattern())) {
+        continue;
+      }
+
+      iter.Remove();
+    }
+
     mClears.Put(aOperation->Target(), aOperation);
     break;
 
   case DBOperation::opClearAll:
     // Drop simply everything, this is a super-operation.
     mUpdates.Clear();
     mClears.Clear();
     mClears.Put(aOperation->Target(), aOperation);
     break;
 
   default:
     MOZ_ASSERT(false);
     break;
   }
 }
 
-namespace {
-
-PLDHashOperator
-CollectTasks(const nsACString& aMapping, nsAutoPtr<DOMStorageDBThread::DBOperation>& aOperation, void* aArg)
-{
-  nsTArray<nsAutoPtr<DOMStorageDBThread::DBOperation> >* tasks =
-    static_cast<nsTArray<nsAutoPtr<DOMStorageDBThread::DBOperation> >*>(aArg);
-
-  tasks->AppendElement(aOperation.forget());
-  return PL_DHASH_NEXT;
-}
-
-} // namespace
-
 bool
 DOMStorageDBThread::PendingOperations::Prepare()
 {
   // Called under the lock
 
   // First collect clear operations and then updates, we can
   // do this since whenever a clear operation for a scope is
   // scheduled, we drop all updates matching that scope. So,
   // all scope-related update operations we have here now were
   // scheduled after the clear operations.
-  mClears.Enumerate(CollectTasks, &mExecList);
+  for (auto iter = mClears.Iter(); !iter.Done(); iter.Next()) {
+    mExecList.AppendElement(iter.Data().forget());
+  }
   mClears.Clear();
 
-  mUpdates.Enumerate(CollectTasks, &mExecList);
+  for (auto iter = mUpdates.Iter(); !iter.Done(); iter.Next()) {
+    mExecList.AppendElement(iter.Data().forget());
+  }
   mUpdates.Clear();
 
   return !!mExecList.Length();
 }
 
 nsresult
 DOMStorageDBThread::PendingOperations::Execute(DOMStorageDBThread* aThread)
 {
--- a/dom/telephony/ipc/PTelephony.ipdl
+++ b/dom/telephony/ipc/PTelephony.ipdl
@@ -120,50 +120,50 @@ union IPCTelephonyRequest
   SendTonesRequest;
 };
 
 sync protocol PTelephony {
   manager PContent;
   manages PTelephonyRequest;
 
 child:
-  NotifyCallStateChanged(nsTelephonyCallInfo[] aAllInfo);
+  async NotifyCallStateChanged(nsTelephonyCallInfo[] aAllInfo);
 
-  NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);
+  async NotifyCdmaCallWaiting(uint32_t aClientId, IPCCdmaWaitingCallData aData);
 
-  NotifyConferenceError(nsString aName, nsString aMessage);
+  async NotifyConferenceError(nsString aName, nsString aMessage);
 
-  NotifySupplementaryService(uint32_t aClientId, int32_t aCallIndex,
-                             uint16_t aNotification);
+  async NotifySupplementaryService(uint32_t aClientId, int32_t aCallIndex,
+                                   uint16_t aNotification);
 
 parent:
   /**
    * Sent when the child no longer needs to use PTelephony.
    */
-  __delete__();
+  async __delete__();
 
   /**
    * Sent when the child makes an asynchronous request to the parent.
    */
-  PTelephonyRequest(IPCTelephonyRequest request);
+  async PTelephonyRequest(IPCTelephonyRequest request);
 
-  RegisterListener();
+  async RegisterListener();
 
-  UnregisterListener();
+  async UnregisterListener();
 
-  StartTone(uint32_t aClientId, nsString aTone);
+  async StartTone(uint32_t aClientId, nsString aTone);
 
-  StopTone(uint32_t aClientId);
+  async StopTone(uint32_t aClientId);
 
   sync GetMicrophoneMuted()
     returns (bool aMuted);
 
-  SetMicrophoneMuted(bool aMuted);
+  async SetMicrophoneMuted(bool aMuted);
 
   sync GetSpeakerEnabled()
     returns (bool aEnabled);
 
-  SetSpeakerEnabled(bool aEnabled);
+  async SetSpeakerEnabled(bool aEnabled);
 };
 
 } /* namespace telephony */
 } /* namespace dom */
 } /* namespace mozilla */
--- a/dom/telephony/ipc/PTelephonyRequest.ipdl
+++ b/dom/telephony/ipc/PTelephonyRequest.ipdl
@@ -61,21 +61,21 @@ union IPCTelephonyResponse
   DialResponseMMIError;
 };
 
 protocol PTelephonyRequest
 {
   manager PTelephony;
 
 child:
-  NotifyEnumerateCallState(nsTelephonyCallInfo aInfo);
+  async NotifyEnumerateCallState(nsTelephonyCallInfo aInfo);
 
-  NotifyDialMMI(nsString aServiceCode);
+  async NotifyDialMMI(nsString aServiceCode);
 
   /**
    * Sent when the asynchronous request has completed.
    */
-  __delete__(IPCTelephonyResponse aResponse);
+  async __delete__(IPCTelephonyResponse aResponse);
 };
 
 } /* namespace telephony */
 } /* namespace dom */
 } /* namespace mozilla */
--- a/dom/tests/mochitest/bugs/test_bug850517.html
+++ b/dom/tests/mochitest/bugs/test_bug850517.html
@@ -15,18 +15,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   function go() {
     var ifrA = $('a');
     var ifrB = $('b');
     var sb = new SpecialPowers.Cu.Sandbox('http://www.example.com');
     sb.win = window;
     sb.childA = ifrA.contentWindow;
     sb.childB = ifrB.contentWindow;
-    sb.is = SpecialPowers.wrap(is);
-    sb.ok = SpecialPowers.wrap(ok);
+    SpecialPowers.setWrapped(sb, 'is', SpecialPowers.wrap(is));
+    SpecialPowers.setWrapped(sb, 'ok', SpecialPowers.wrap(ok));
     is(window.theoneandonly.frameElement, ifrA, "Named child resolution works");
     SpecialPowers.Cu.evalInSandbox('is(win.theoneandonly, childA, "Named child resolution works via Xray");', sb);
     ifrA.removeAttribute('name');
     is(typeof window.theoneandonly, 'undefined', "Revocation works");
     SpecialPowers.Cu.evalInSandbox('try { win.theoneandonly; ok(false, "Should have thrown"); } ' +
                                    'catch (e) {ok(!!/denied/.exec(e) && !!/theoneandonly/.exec(e), "Revocation works via Xray");};', sb);
     ifrB.setAttribute('name', 'theoneandonly');
     is(window.theoneandonly.frameElement, ifrB, "Another mule kicking in the same old stall");
--- a/dom/tests/mochitest/general/test_showModalDialog.html
+++ b/dom/tests/mochitest/general/test_showModalDialog.html
@@ -14,18 +14,18 @@ https://bugzilla.mozilla.org/show_bug.cg
 
   // The modal window needs to touch Cu, which means that it needs
   // SpecialPowers. But given the semantics of modal windows, we have to
   // do some funny stuff with postMessage to set this up.
   window.onmessage = function(evt) {
     is(evt.data, 'dosetup', "message from modal window is correct");
     var win = SpecialPowers.wrap(evt.source);
     win.wrappedJSObject.SpecialPowers = SpecialPowers;
-    win.wrappedJSObject.is = SpecialPowers.wrap(is);
-    win.wrappedJSObject.ok = SpecialPowers.wrap(ok);
+    SpecialPowers.setWrapped(win.wrappedJSObject, 'is', SpecialPowers.wrap(is));
+    SpecialPowers.setWrapped(win.wrappedJSObject, 'ok', SpecialPowers.wrap(ok));
     win.wrappedJSObject.go();
   };
 
   var someObj = { foo: 42, bar: "hi"};
   var xurl = location.toString()
                      .replace('mochi.test:8888', 'example.org')
                      .replace('test_showModal', 'file_showModal');
   if (xurl.indexOf('?') != -1)
--- a/dom/voicemail/ipc/PVoicemail.ipdl
+++ b/dom/voicemail/ipc/PVoicemail.ipdl
@@ -10,31 +10,31 @@ namespace mozilla {
 namespace dom {
 namespace voicemail {
 
 sync protocol PVoicemail
 {
   manager PContent;
 
 child:
-  NotifyInfoChanged(uint32_t aServiceId,
-                    nsString aNumber,
-                    nsString aDisplayName);
+  async NotifyInfoChanged(uint32_t aServiceId,
+                          nsString aNumber,
+                          nsString aDisplayName);
 
-  NotifyStatusChanged(uint32_t aServiceId,
-                      bool aHasMessages,
-                      int32_t aMessageCount,
-                      nsString aNumber,
-                      nsString aDisplayName);
+  async NotifyStatusChanged(uint32_t aServiceId,
+                            bool aHasMessages,
+                            int32_t aMessageCount,
+                            nsString aNumber,
+                            nsString aDisplayName);
 
 parent:
   /**
    * Send when child no longer needs to use PVoicemail.
    */
-  __delete__();
+  async __delete__();
 
   sync GetAttributes(uint32_t aServiceId)
     returns (nsString aNumber,
              nsString aDisplayName,
              bool aHasMessages,
              int32_t aMessageCount,
              nsString aReturnNumber,
              nsString aReturnMessage);
--- a/dom/webidl/Animatable.webidl
+++ b/dom/webidl/Animatable.webidl
@@ -5,13 +5,21 @@
  *
  * The origin of this IDL file is
  * http://dev.w3.org/fxtf/web-animations/#the-animatable-interface
  *
  * Copyright © 2014 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
  * liability, trademark and document use rules apply.
  */
 
+dictionary KeyframeAnimationOptions : KeyframeEffectOptions {
+  DOMString id = "";
+};
+
 [NoInterfaceObject]
 interface Animatable {
+  [Func="nsDocument::IsWebAnimationsEnabled", Throws]
+  Animation animate(object? frames,
+                    optional (unrestricted double or KeyframeAnimationOptions)
+                      options);
   [Func="nsDocument::IsWebAnimationsEnabled"]
   sequence<Animation> getAnimations();
 };
--- a/dom/webidl/KeyframeEffect.webidl
+++ b/dom/webidl/KeyframeEffect.webidl
@@ -16,32 +16,22 @@ enum IterationCompositeOperation {
 };
 
 dictionary KeyframeEffectOptions : AnimationEffectTimingProperties {
   IterationCompositeOperation iterationComposite = "replace";
   CompositeOperation          composite = "replace";
   DOMString                   spacing = "distribute";
 };
 
-// For the constructor:
-//
-// 1. We use Element? for the first argument since we don't support Animatable
-//    for pseudo-elements yet.
-//
-// 2. We use object? instead of
-//
-//    (PropertyIndexedKeyframes or sequence<Keyframe> or SharedKeyframeList)
-//
-//    for the second argument so that we can get the property-value pairs from
-//    the PropertyIndexedKeyframes or Keyframe objects.  We also don't support
-//    SharedKeyframeList yet.
+// For the constructor we use Element? for the first argument since we
+// don't support Animatable for pseudo-elements yet.
 [HeaderFile="mozilla/dom/KeyframeEffect.h",
  Func="nsDocument::IsWebAnimationsEnabled",
  Constructor(Element? target,
-             optional object? frames,
+             object? frames,
              optional (unrestricted double or KeyframeEffectOptions) options)]
 interface KeyframeEffectReadOnly : AnimationEffectReadOnly {
   readonly attribute Element?  target;
   readonly attribute IterationCompositeOperation iterationComposite;
   readonly attribute CompositeOperation          composite;
   readonly attribute DOMString                   spacing;
 
   // Not yet implemented:
--- a/dom/workers/PServiceWorkerManager.ipdl
+++ b/dom/workers/PServiceWorkerManager.ipdl
@@ -12,34 +12,34 @@ using mozilla::PrincipalOriginAttributes
 namespace mozilla {
 namespace dom {
 
 protocol PServiceWorkerManager
 {
   manager PBackground;
 
 parent:
-  Register(ServiceWorkerRegistrationData data);
+  async Register(ServiceWorkerRegistrationData data);
 
-  Unregister(PrincipalInfo principalInfo, nsString scope);
+  async Unregister(PrincipalInfo principalInfo, nsString scope);
 
-  PropagateSoftUpdate(PrincipalOriginAttributes originAttributes,
-                      nsString scope);
-  PropagateUnregister(PrincipalInfo principalInfo, nsString scope);
+  async PropagateSoftUpdate(PrincipalOriginAttributes originAttributes,
+                            nsString scope);
+  async PropagateUnregister(PrincipalInfo principalInfo, nsString scope);
 
-  PropagateRemove(nsCString host);
+  async PropagateRemove(nsCString host);
 
-  PropagateRemoveAll();
+  async PropagateRemoveAll();
 
-  Shutdown();
+  async Shutdown();
 
 child:
-  NotifyRegister(ServiceWorkerRegistrationData data);
-  NotifySoftUpdate(PrincipalOriginAttributes originAttributes, nsString scope);
-  NotifyUnregister(PrincipalInfo principalInfo, nsString scope);
-  NotifyRemove(nsCString host);
-  NotifyRemoveAll();
+  async NotifyRegister(ServiceWorkerRegistrationData data);
+  async NotifySoftUpdate(PrincipalOriginAttributes originAttributes, nsString scope);
+  async NotifyUnregister(PrincipalInfo principalInfo, nsString scope);
+  async NotifyRemove(nsCString host);
+  async NotifyRemoveAll();
 
-  __delete__();
+  async __delete__();
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -2672,30 +2672,16 @@ XULDocument::LoadOverlayInternal(nsIURI*
         // completes, it will trigger an EndLoad(), which'll wind
         // us back in ResumeWalk().
         if (!aIsDynamic)
             *aShouldReturn = true;
     }
     return NS_OK;
 }
 
-static PLDHashOperator
-FirePendingMergeNotification(nsIURI* aKey, nsCOMPtr<nsIObserver>& aObserver, void* aClosure)
-{
-    aObserver->Observe(aKey, "xul-overlay-merged", EmptyString().get());
-
-    typedef nsInterfaceHashtable<nsURIHashKey,nsIObserver> table;
-    table* observers = static_cast<table*>(aClosure);
-    if (observers) {
-      observers->Remove(aKey);
-    }
-
-    return PL_DHASH_REMOVE;
-}
-
 nsresult
 XULDocument::ResumeWalk()
 {
     // Walk the prototype and build the delegate content model. The
     // walk is performed in a top-down, left-to-right fashion. That
     // is, a parent is built before any of its children; a node is
     // only built after all of its siblings to the left are fully
     // constructed.
@@ -3036,19 +3022,33 @@ XULDocument::DoneWalking()
         // DispatchContentLoadedEvents undoes the onload-blocking we
         // did in PrepareToWalk().
         DispatchContentLoadedEvents();
 
         mInitialLayoutComplete = true;
 
         // Walk the set of pending load notifications and notify any observers.
         // See below for detail.
-        if (mPendingOverlayLoadNotifications)
-            mPendingOverlayLoadNotifications->Enumerate(
-                FirePendingMergeNotification, mOverlayLoadObservers.get());
+        if (mPendingOverlayLoadNotifications) {
+            nsInterfaceHashtable<nsURIHashKey,nsIObserver>* observers =
+                mOverlayLoadObservers.get();
+            for (auto iter = mPendingOverlayLoadNotifications->Iter();
+                 !iter.Done();
+                 iter.Next()) {
+                nsIURI* aKey = iter.Key();
+                iter.Data()->Observe(aKey, "xul-overlay-merged",
+                                     EmptyString().get());
+
+                if (observers) {
+                  observers->Remove(aKey);
+                }
+
+                iter.Remove();
+            }
+        }
     }
     else {
         if (mOverlayLoadObservers) {
             nsCOMPtr<nsIURI> overlayURI = mCurrentPrototype->GetURI();
             nsCOMPtr<nsIObserver> obs;
             if (mInitialLayoutComplete) {
                 // We have completed initial layout, so just send the notification.
                 mOverlayLoadObservers->Get(overlayURI, getter_AddRefs(obs));
--- a/dom/xul/nsXULPrototypeCache.cpp
+++ b/dom/xul/nsXULPrototypeCache.cpp
@@ -1,9 +1,10 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- 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/. */
 
 #include "nsXULPrototypeCache.h"
 
 #include "plstr.h"
 #include "nsXULPrototypeDocument.h"
@@ -233,66 +234,43 @@ nsXULPrototypeCache::PutXBLDocumentInfo(
     RefPtr<nsXBLDocumentInfo> info;
     mXBLDocTable.Get(uri, getter_AddRefs(info));
     if (!info) {
         mXBLDocTable.Put(uri, aDocumentInfo);
     }
     return NS_OK;
 }
 
-static PLDHashOperator
-FlushSkinXBL(nsIURI* aKey, RefPtr<nsXBLDocumentInfo>& aDocInfo, void* aClosure)
-{
-  nsAutoCString str;
-  aKey->GetPath(str);
-
-  PLDHashOperator ret = PL_DHASH_NEXT;
-
-  if (!strncmp(str.get(), "/skin", 5)) {
-    ret = PL_DHASH_REMOVE;
-  }
-
-  return ret;
-}
-
-static PLDHashOperator
-FlushSkinSheets(nsIURI* aKey, RefPtr<CSSStyleSheet>& aSheet, void* aClosure)
-{
-  nsAutoCString str;
-  aSheet->GetSheetURI()->GetPath(str);
-
-  PLDHashOperator ret = PL_DHASH_NEXT;
-
-  if (!strncmp(str.get(), "/skin", 5)) {
-    // This is a skin binding. Add the key to the list.
-    ret = PL_DHASH_REMOVE;
-  }
-  return ret;
-}
-
-static PLDHashOperator
-FlushScopedSkinStylesheets(nsIURI* aKey, RefPtr<nsXBLDocumentInfo> &aDocInfo, void* aClosure)
-{
-  aDocInfo->FlushSkinStylesheets();
-  return PL_DHASH_NEXT;
-}
-
 void
 nsXULPrototypeCache::FlushSkinFiles()
 {
   // Flush out skin XBL files from the cache.
-  mXBLDocTable.Enumerate(FlushSkinXBL, nullptr);
+  for (auto iter = mXBLDocTable.Iter(); !iter.Done(); iter.Next()) {
+    nsAutoCString str;
+    iter.Key()->GetPath(str);
+    if (strncmp(str.get(), "/skin", 5) == 0) {
+      iter.Remove();
+    }
+  }
 
   // Now flush out our skin stylesheets from the cache.
-  mStyleSheetTable.Enumerate(FlushSkinSheets, nullptr);
+  for (auto iter = mStyleSheetTable.Iter(); !iter.Done(); iter.Next()) {
+    nsAutoCString str;
+    iter.Data()->GetSheetURI()->GetPath(str);
+    if (strncmp(str.get(), "/skin", 5) == 0) {
+      iter.Remove();
+    }
+  }
 
   // Iterate over all the remaining XBL and make sure cached
   // scoped skin stylesheets are flushed and refetched by the
   // prototype bindings.
-  mXBLDocTable.Enumerate(FlushScopedSkinStylesheets, nullptr);
+  for (auto iter = mXBLDocTable.Iter(); !iter.Done(); iter.Next()) {
+    iter.Data()->FlushSkinStylesheets();
+  }
 }
 
 void
 nsXULPrototypeCache::FlushScripts()
 {
     mScriptTable.Clear();
 }
 
@@ -596,46 +574,27 @@ nsXULPrototypeCache::BeginCaching(nsIURI
             mStartupCacheURITable.Clear();
             return NS_ERROR_FAILURE;
         }
     }
 
     return NS_OK;
 }
 
-static PLDHashOperator
-MarkXBLInCCGeneration(nsIURI* aKey, RefPtr<nsXBLDocumentInfo> &aDocInfo,
-                      void* aClosure)
-{
-    uint32_t* gen = static_cast<uint32_t*>(aClosure);
-    aDocInfo->MarkInCCGeneration(*gen);
-    return PL_DHASH_NEXT;
-}
-
-static PLDHashOperator
-MarkXULInCCGeneration(nsIURI* aKey, RefPtr<nsXULPrototypeDocument> &aDoc,
-                      void* aClosure)
-{
-    uint32_t* gen = static_cast<uint32_t*>(aClosure);
-    aDoc->MarkInCCGeneration(*gen);
-    return PL_DHASH_NEXT;
-}
-
 void
 nsXULPrototypeCache::MarkInCCGeneration(uint32_t aGeneration)
 {
-    mXBLDocTable.Enumerate(MarkXBLInCCGeneration, &aGeneration);
-    mPrototypeTable.Enumerate(MarkXULInCCGeneration, &aGeneration);
-}
-
-static PLDHashOperator
-MarkScriptsInGC(nsIURI* aKey, JS::Heap<JSScript*>& aScript, void* aClosure)
-{
-    JSTracer* trc = static_cast<JSTracer*>(aClosure);
-    JS::TraceEdge(trc, &aScript, "nsXULPrototypeCache script");
-    return PL_DHASH_NEXT;
+    for (auto iter = mXBLDocTable.Iter(); !iter.Done(); iter.Next()) {
+        iter.Data()->MarkInCCGeneration(aGeneration);
+    }
+    for (auto iter = mPrototypeTable.Iter(); !iter.Done(); iter.Next()) {
+        iter.Data()->MarkInCCGeneration(aGeneration);
+    }
 }
 
 void
 nsXULPrototypeCache::MarkInGC(JSTracer* aTrc)
 {
-    mScriptTable.Enumerate(MarkScriptsInGC, aTrc);
+    for (auto iter = mScriptTable.Iter(); !iter.Done(); iter.Next()) {
+        JS::Heap<JSScript*>& script = iter.Data();
+        JS::TraceEdge(aTrc, &script, "nsXULPrototypeCache script");
+    }
 }
--- a/dom/xul/templates/nsXULTemplateBuilder.cpp
+++ b/dom/xul/templates/nsXULTemplateBuilder.cpp
@@ -99,27 +99,30 @@ nsXULTemplateBuilder::nsXULTemplateBuild
     : mQueriesCompiled(false),
       mFlags(0),
       mTop(nullptr),
       mObservedDocument(nullptr)
 {
     MOZ_COUNT_CTOR(nsXULTemplateBuilder);
 }
 
-static PLDHashOperator
-DestroyMatchList(nsISupports* aKey, nsTemplateMatch*& aMatch, void* aContext)
+void
+nsXULTemplateBuilder::DestroyMatchMap()
 {
-    // delete all the matches in the list
-    while (aMatch) {
-        nsTemplateMatch* next = aMatch->mNext;
-        nsTemplateMatch::Destroy(aMatch, true);
-        aMatch = next;
+    for (auto iter = mMatchMap.Iter(); !iter.Done(); iter.Next()) {
+        nsTemplateMatch*& match = iter.Data();
+        // delete all the matches in the list
+        while (match) {
+            nsTemplateMatch* next = match->mNext;
+            nsTemplateMatch::Destroy(match, true);
+            match = next;
+        }
+
+        iter.Remove();
     }
-
-    return PL_DHASH_REMOVE;
 }
 
 nsXULTemplateBuilder::~nsXULTemplateBuilder(void)
 {
     Uninit(true);
 
     if (--gRefCnt == 0) {
         NS_IF_RELEASE(gRDFService);
@@ -190,17 +193,17 @@ nsXULTemplateBuilder::CleanUp(bool aIsFi
 {
     for (int32_t q = mQuerySets.Length() - 1; q >= 0; q--) {
         nsTemplateQuerySet* qs = mQuerySets[q];
         delete qs;
     }
 
     mQuerySets.Clear();
 
-    mMatchMap.Enumerate(DestroyMatchList, nullptr);
+    DestroyMatchMap();
 
     // Setting mQueryProcessor to null will close connections. This would be
     // handled by the cycle collector, but we want to close them earlier.
     if (aIsFinal)
         mQueryProcessor = nullptr;
 }
 
 void
@@ -227,17 +230,17 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsXULTemp
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsXULTemplateBuilder)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mDataSource)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mDB)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mCompDB)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mRoot)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mRootResult)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mListeners)
     NS_IMPL_CYCLE_COLLECTION_UNLINK(mQueryProcessor)
-    tmp->mMatchMap.Enumerate(DestroyMatchList, nullptr);
+    tmp->DestroyMatchMap();
     for (uint32_t i = 0; i < tmp->mQuerySets.Length(); ++i) {
         nsTemplateQuerySet* qs = tmp->mQuerySets[i];
         delete qs;
     }
     tmp->mQuerySets.Clear();
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsXULTemplateBuilder)
     if (tmp->mObservedDocument && !cb.WantAllTraces()) {
--- a/dom/xul/templates/nsXULTemplateBuilder.h
+++ b/dom/xul/templates/nsXULTemplateBuilder.h
@@ -36,16 +36,17 @@ class nsIRDFCompositeDataSource;
  * An object that translates an RDF graph into a presentation using a
  * set of rules.
  */
 class nsXULTemplateBuilder : public nsIXULTemplateBuilder,
                              public nsIObserver,
                              public nsStubDocumentObserver
 {
     void CleanUp(bool aIsFinal);
+    void DestroyMatchMap();
 
 public:
     nsXULTemplateBuilder();
 
     nsresult InitGlobals();
 
     /**
      * Clear the template builder structures. The aIsFinal flag is set to true
--- a/embedding/components/printingui/ipc/PPrintProgressDialog.ipdl
+++ b/embedding/components/printingui/ipc/PPrintProgressDialog.ipdl
@@ -8,28 +8,28 @@ include protocol PPrinting;
 namespace mozilla {
 namespace embedding {
 
 protocol PPrintProgressDialog
 {
   manager PPrinting;
 
 parent:
-  StateChange(long stateFlags,
-              nsresult status);
+  async StateChange(long stateFlags,
+                    nsresult status);
 
-  ProgressChange(long curSelfProgress,
-                 long maxSelfProgress,
-                 long curTotalProgress,
-                 long maxTotalProgress);
+  async ProgressChange(long curSelfProgress,
+                       long maxSelfProgress,
+                       long curTotalProgress,
+                       long maxTotalProgress);
 
-  DocTitleChange(nsString newTitle);
+  async DocTitleChange(nsString newTitle);
 
-  DocURLChange(nsString newURL);
+  async DocURLChange(nsString newURL);
 
-  __delete__();
+  async __delete__();
 
 child:
-  DialogOpened();
+  async DialogOpened();
 };
 
 } // namespace embedding
 } // namespace mozilla
--- a/embedding/components/printingui/ipc/PPrintSettingsDialog.ipdl
+++ b/embedding/components/printingui/ipc/PPrintSettingsDialog.ipdl
@@ -17,13 +17,13 @@ union PrintDataOrNSResult
   nsresult;
 };
 
 protocol PPrintSettingsDialog
 {
   manager PPrinting;
 
 child:
-  __delete__(PrintDataOrNSResult result);
+  async __delete__(PrintDataOrNSResult result);
 };
 
 } // namespace embedding
 } // namespace mozilla
--- a/embedding/components/printingui/ipc/PPrinting.ipdl
+++ b/embedding/components/printingui/ipc/PPrinting.ipdl
@@ -26,22 +26,22 @@ parent:
                     bool isForPrinting)
     returns(bool notifyOnOpen,
             nsresult rv);
 
   async ShowPrintDialog(PPrintSettingsDialog dialog,
                         PBrowser browser,
                         PrintData settings);
 
-  PPrintProgressDialog();
-  PPrintSettingsDialog();
+  async PPrintProgressDialog();
+  async PPrintSettingsDialog();
 
   sync SavePrintSettings(PrintData settings, bool usePrinterNamePrefix,
                          uint32_t flags)
     returns(nsresult rv);
 
 child:
   async PRemotePrintJob();
-  __delete__();
+  async __delete__();
 };
 
 } // namespace embedding
 } // namespace mozilla
--- a/embedding/components/webbrowserpersist/PWebBrowserPersistDocument.ipdl
+++ b/embedding/components/webbrowserpersist/PWebBrowserPersistDocument.ipdl
@@ -54,29 +54,29 @@ protocol PWebBrowserPersistDocument {
   manages PWebBrowserPersistResources;
   manages PWebBrowserPersistSerialize;
 
 parent:
   // The actor isn't exposed to XPCOM until after it gets one of these
   // two messages; see also the state transition rules.  The message
   // is either a response to the constructor (if it was parent->child)
   // or sent after it (if it was child->parent).
-  Attributes(WebBrowserPersistDocumentAttrs aAttrs,
-             OptionalInputStreamParams postData,
-             FileDescriptor[] postFiles);
-  InitFailure(nsresult aStatus);
+  async Attributes(WebBrowserPersistDocumentAttrs aAttrs,
+                   OptionalInputStreamParams postData,
+                   FileDescriptor[] postFiles);
+  async InitFailure(nsresult aStatus);
 
 child:
-  SetPersistFlags(uint32_t aNewFlags);
-  PWebBrowserPersistResources();
-  PWebBrowserPersistSerialize(WebBrowserPersistURIMap aMap,
-                              nsCString aRequestedContentType,
-                              uint32_t aEncoderFlags,
-                              uint32_t aWrapColumn);
-  __delete__();
+  async SetPersistFlags(uint32_t aNewFlags);
+  async PWebBrowserPersistResources();
+  async PWebBrowserPersistSerialize(WebBrowserPersistURIMap aMap,
+                                    nsCString aRequestedContentType,
+                                    uint32_t aEncoderFlags,
+                                    uint32_t aWrapColumn);
+  async __delete__();
 
 state START:
   recv Attributes goto MAIN;
   recv InitFailure goto FAILED;
 
 state MAIN:
   send SetPersistFlags goto MAIN;
   send PWebBrowserPersistResources goto MAIN;
--- a/embedding/components/webbrowserpersist/PWebBrowserPersistResources.ipdl
+++ b/embedding/components/webbrowserpersist/PWebBrowserPersistResources.ipdl
@@ -7,20 +7,20 @@ include protocol PWebBrowserPersistDocum
 
 namespace mozilla {
 
 // == nsIWebBrowserPersistResourceVisitor
 protocol PWebBrowserPersistResources {
   manager PWebBrowserPersistDocument;
 
 parent:
-  VisitResource(nsCString aURI);
+  async VisitResource(nsCString aURI);
 
   // The actor sent here is in the START state; the parent-side
   // receiver will have to wait for it to enter the MAIN state
   // before exposing it with a visitDocument call.
-  VisitDocument(PWebBrowserPersistDocument aSubDocument);
+  async VisitDocument(PWebBrowserPersistDocument aSubDocument);
 
   // This reflects the endVisit method.
-  __delete__(nsresult aStatus);
+  async __delete__(nsresult aStatus);
 };
 
 } // namespace mozilla
--- a/embedding/components/webbrowserpersist/PWebBrowserPersistSerialize.ipdl
+++ b/embedding/components/webbrowserpersist/PWebBrowserPersistSerialize.ipdl
@@ -14,16 +14,16 @@ protocol PWebBrowserPersistSerialize {
 
 parent:
   // This sends the data with no flow control, so the parent could
   // wind up buffering an arbitrarily large amount of data...  but
   // it's a serialized DOM that's already in memory as DOM nodes, so
   // this is at worst just a constant-factor increase in memory usage.
   // Also, Chromium does the same thing; see
   // content::RenderViewImpl::didSerializeDataForFrame.
-  WriteData(uint8_t[] aData);
+  async WriteData(uint8_t[] aData);
 
   // This is the onFinish method.
-  __delete__(nsCString aContentType,
-             nsresult aStatus);
+  async __delete__(nsCString aContentType,
+                   nsresult aStatus);
 };
 
 } // namespace mozilla
--- a/extensions/auth/nsAuth.h
+++ b/extensions/auth/nsAuth.h
@@ -15,13 +15,13 @@ enum pType {
 #include "mozilla/Logging.h"
 
 //
 // in order to do logging, the following environment variables need to be set:
 // 
 //      set NSPR_LOG_MODULES=negotiateauth:4
 //      set NSPR_LOG_FILE=negotiateauth.log
 //
-extern PRLogModuleInfo* gNegotiateLog;
+extern mozilla::LazyLogModule gNegotiateLog;
 
 #define LOG(args) MOZ_LOG(gNegotiateLog, mozilla::LogLevel::Debug, args)
 
 #endif /* !defined( nsAuth_h__ ) */
--- a/extensions/auth/nsAuthFactory.cpp
+++ b/extensions/auth/nsAuthFactory.cpp
@@ -215,23 +215,22 @@ static const mozilla::Module::ContractID
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "sys-ntlm", &kNS_SAMBANTLMAUTH_CID },
 #endif
   { NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX "negotiate", &kNS_HTTPNEGOTIATEAUTH_CID },
   { NS_AUTH_MODULE_CONTRACTID_PREFIX "sasl-gssapi", &kNS_AUTHSASL_CID },
   { nullptr }
 };
 
 //-----------------------------------------------------------------------------
-PRLogModuleInfo *gNegotiateLog;
+mozilla::LazyLogModule gNegotiateLog("negotiateauth");
 
 // setup nspr logging ...
 static nsresult
 InitNegotiateAuth()
 {
-  gNegotiateLog = PR_NewLogModule("negotiateauth");
   return NS_OK;
 }
 
 static void
 DestroyNegotiateAuth()
 {
   nsAuthGSSAPI::Shutdown();
 }
--- a/extensions/gio/nsGIOProtocolHandler.cpp
+++ b/extensions/gio/nsGIOProtocolHandler.cpp
@@ -32,17 +32,17 @@
 #include <algorithm>
 
 #define MOZ_GIO_SCHEME              "moz-gio"
 #define MOZ_GIO_SUPPORTED_PROTOCOLS "network.gio.supported-protocols"
 
 //-----------------------------------------------------------------------------
 
 // NSPR_LOG_MODULES=gio:5
-static PRLogModuleInfo *sGIOLog;
+static mozilla::LazyLogModule sGIOLog("gio");
 #define LOG(args) MOZ_LOG(sGIOLog, mozilla::LogLevel::Debug, args)
 
 
 //-----------------------------------------------------------------------------
 static nsresult
 MapGIOResult(gint code) 
 {
   switch (code)
@@ -906,18 +906,16 @@ class nsGIOProtocolHandler final : publi
     nsCString mSupportedProtocols;
 };
 
 NS_IMPL_ISUPPORTS(nsGIOProtocolHandler, nsIProtocolHandler, nsIObserver)
 
 nsresult
 nsGIOProtocolHandler::Init()
 {
-  sGIOLog = PR_NewLogModule("gio");
-
   nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
   if (prefs)
   {
     InitSupportedProtocolsPref(prefs);
     prefs->AddObserver(MOZ_GIO_SUPPORTED_PROTOCOLS, this, false);
   }
 
   return NS_OK;
--- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp
@@ -21,17 +21,17 @@
 #include "nsNetUtil.h"
 #include "nspr.h"
 #include <algorithm>
 
 #include "mozilla/Logging.h"
 
 using mozilla::LogLevel;
 
-PRLogModuleInfo *MCD;
+mozilla::LazyLogModule MCD("MCD");
 
 extern nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length,
                                           const char *filename, 
                                           bool bGlobalContext, 
                                           bool bCallbacks, 
                                           bool skipFirstLine);
 
 // nsISupports Implementation
--- a/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
+++ b/extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp
@@ -14,17 +14,17 @@
 #include "mozilla/Attributes.h"
 #include "mozilla/Maybe.h"
 #include "nsContentUtils.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsJSPrincipals.h"
 #include "nsIScriptError.h"
 #include "jswrapper.h"
 
-extern PRLogModuleInfo *MCD;
+extern mozilla::LazyLogModule MCD;
 using mozilla::AutoSafeJSContext;
 
 //*****************************************************************************
 
 static JS::PersistentRooted<JSObject *> autoconfigSb;
 
 nsresult CentralizedAdminPrefManagerInit()
 {
--- a/extensions/pref/autoconfig/src/nsReadConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp
@@ -21,17 +21,17 @@
 #include "nsNetUtil.h"
 #include "prmem.h"
 #include "nsString.h"
 #include "nsCRT.h"
 #include "nspr.h"
 #include "nsXULAppAPI.h"
 #include "nsContentUtils.h"
 
-extern PRLogModuleInfo *MCD;
+extern mozilla::LazyLogModule MCD;
 
 extern nsresult EvaluateAdminConfigScript(const char *js_buffer, size_t length,
                                           const char *filename, 
                                           bool bGlobalContext, 
                                           bool bCallbacks, 
                                           bool skipFirstLine);
 extern nsresult CentralizedAdminPrefManagerInit();
 extern nsresult CentralizedAdminPrefManagerFinish();
@@ -70,18 +70,16 @@ static void DisplayError(void)
 
 // nsISupports Implementation
 
 NS_IMPL_ISUPPORTS(nsReadConfig, nsIReadConfig, nsIObserver)
 
 nsReadConfig::nsReadConfig() :
     mRead(false)
 {
-    if (!MCD)
-      MCD = PR_NewLogModule("MCD");
 }
 
 nsresult nsReadConfig::Init()
 {
     nsresult rv;
     
     nsCOMPtr<nsIObserverService> observerService = 
         do_GetService("@mozilla.org/observer-service;1", &rv);
--- a/extensions/spellcheck/hunspell/glue/PRemoteSpellcheckEngine.ipdl
+++ b/extensions/spellcheck/hunspell/glue/PRemoteSpellcheckEngine.ipdl
@@ -5,17 +5,17 @@
 include protocol PContent;
 
 namespace mozilla {
 
 sync protocol PRemoteSpellcheckEngine {
   manager PContent;
 
 parent:
-  __delete__();
+  async __delete__();
 
   sync Check(nsString aWord) returns (bool aIsMisspelled);
 
   sync CheckAndSuggest(nsString aWord) returns (bool aIsMisspelled, nsString[] aSuggestions);
 
   sync SetDictionary(nsString aDictionary) returns (bool success);
 };
 
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -1263,16 +1263,26 @@ APZCTreeManager::CancelAnimation(const S
 {
   RefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aGuid);
   if (apzc) {
     apzc->CancelAnimation();
   }
 }
 
 void
+APZCTreeManager::AdjustScrollForSurfaceShift(const ScreenPoint& aShift)
+{
+  MonitorAutoLock lock(mTreeLock);
+  RefPtr<AsyncPanZoomController> apzc = FindRootContentOrRootApzc();
+  if (apzc) {
+    apzc->AdjustScrollForSurfaceShift(aShift);
+  }
+}
+
+void
 APZCTreeManager::ClearTree()
 {
   // Ensure that no references to APZCs are alive in any lingering input
   // blocks. This breaks cycles from InputBlockState::mTargetApzc back to
   // the InputQueue.
   APZThreadUtils::RunOnControllerThread(NewRunnableMethod(
     mInputQueue.get(), &InputQueue::Clear));
 
@@ -1737,16 +1747,43 @@ APZCTreeManager::FindRootContentApzcForL
         AsyncPanZoomController* apzc = aNode->GetApzc();
         return apzc
             && apzc->GetLayersId() == aLayersId
             && apzc->IsRootContent();
       });
   return resultNode ? resultNode->GetApzc() : nullptr;
 }
 
+AsyncPanZoomController*
+APZCTreeManager::FindRootContentOrRootApzc() const
+{
+  mTreeLock.AssertCurrentThreadOwns();
+
+  // Note: this is intended to find the same "root" that would be found
+  // by AsyncCompositionManager::ApplyAsyncContentTransformToTree inside
+  // the MOZ_ANDROID_APZ block. That is, it should find the RCD node if there
+  // is one, or the root APZC if there is not.
+  // Since BreadthFirstSearch is a pre-order search, we first do a search for
+  // the RCD, and then if we don't find one, we do a search for the root APZC.
+  HitTestingTreeNode* resultNode = BreadthFirstSearch(mRootNode.get(),
+      [](HitTestingTreeNode* aNode) {
+        AsyncPanZoomController* apzc = aNode->GetApzc();
+        return apzc && apzc->IsRootContent();
+      });
+  if (resultNode) {
+    return resultNode->GetApzc();
+  }
+  resultNode = BreadthFirstSearch(mRootNode.get(),
+      [](HitTestingTreeNode* aNode) {
+        AsyncPanZoomController* apzc = aNode->GetApzc();
+        return (apzc != nullptr);
+      });
+  return resultNode ? resultNode->GetApzc() : nullptr;
+}
+
 /* The methods GetScreenToApzcTransform() and GetApzcToGeckoTransform() return
    some useful transformations that input events may need applied. This is best
    illustrated with an example. Consider a chain of layers, L, M, N, O, P, Q, R. Layer L
    is the layer that corresponds to the argument |aApzc|, and layer R is the root
    of the layer tree. Layer M is the parent of L, N is the parent of M, and so on.
    When layer L is displayed to the screen by the compositor, the set of transforms that
    are applied to L are (in order from top to bottom):
 
--- a/gfx/layers/apz/src/APZCTreeManager.h
+++ b/gfx/layers/apz/src/APZCTreeManager.h
@@ -257,16 +257,24 @@ public:
   /**
    * Cancels any currently running animation. Note that all this does is set the
    * state of the AsyncPanZoomController back to NOTHING, but it is the
    * animation's responsibility to check this before advancing.
    */
   void CancelAnimation(const ScrollableLayerGuid &aGuid);
 
   /**
+   * Adjusts the root APZC to compensate for a shift in the surface. See the
+   * documentation on AsyncPanZoomController::AdjustScrollForSurfaceShift for
+   * some more details. This is only currently needed due to surface shifts
+   * caused by the dynamic toolbar on Android.
+   */
+  void AdjustScrollForSurfaceShift(const ScreenPoint& aShift);
+
+  /**
    * Calls Destroy() on all APZC instances attached to the tree, and resets the
    * tree back to empty. This function may be called multiple times during the
    * lifetime of this APZCTreeManager, but it must always be called at least once
    * when this APZCTreeManager is no longer needed. Failing to call this function
    * may prevent objects from being freed properly.
    */
   void ClearTree();
 
@@ -445,16 +453,17 @@ private:
   HitTestingTreeNode* FindTargetNode(HitTestingTreeNode* aNode,
                                      const ScrollableLayerGuid& aGuid,
                                      GuidComparator aComparator);
   AsyncPanZoomController* GetAPZCAtPoint(HitTestingTreeNode* aNode,
                                          const ParentLayerPoint& aHitTestPoint,
                                          HitTestResult* aOutHitResult);
   AsyncPanZoomController* FindRootApzcForLayersId(uint64_t aLayersId) const;
   AsyncPanZoomController* FindRootContentApzcForLayersId(uint64_t aLayersId) const;
+  AsyncPanZoomController* FindRootContentOrRootApzc() const;
   already_AddRefed<AsyncPanZoomController> GetMultitouchTarget(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const;
   already_AddRefed<AsyncPanZoomController> CommonAncestor(AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const;
   already_AddRefed<AsyncPanZoomController> GetTouchInputBlockAPZC(const MultiTouchInput& aEvent,
                                                                   HitTestResult* aOutHitResult);
   nsEventStatus ProcessTouchInput(MultiTouchInput& aInput,
                                   ScrollableLayerGuid* aOutTargetGuid,
                                   uint64_t* aOutInputBlockId);
   nsEventStatus ProcessWheelEvent(WidgetWheelEvent& aEvent,
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -2634,16 +2634,29 @@ void AsyncPanZoomController::ClearOversc
 void AsyncPanZoomController::SetCompositorParent(CompositorParent* aCompositorParent) {
   mCompositorParent = aCompositorParent;
 }
 
 void AsyncPanZoomController::ShareFrameMetricsAcrossProcesses() {
   mSharingFrameMetricsAcrossProcesses = true;
 }
 
+void AsyncPanZoomController::AdjustScrollForSurfaceShift(const ScreenPoint& aShift)
+{
+  ReentrantMonitorAutoEnter lock(mMonitor);
+  CSSPoint adjustment =
+    ViewAs<ParentLayerPixel>(aShift, PixelCastJustification::ScreenIsParentLayerForRoot)
+    / mFrameMetrics.GetZoom();
+  APZC_LOG("%p adjusting scroll position by %s for surface shift\n",
+    this, Stringify(adjustment).c_str());
+  mFrameMetrics.ScrollBy(adjustment);
+  ScheduleCompositeAndMaybeRepaint();
+  UpdateSharedCompositorFrameMetrics();
+}
+
 void AsyncPanZoomController::ScrollBy(const CSSPoint& aOffset) {
   mFrameMetrics.ScrollBy(aOffset);
 }
 
 void AsyncPanZoomController::ScaleWithFocus(float aScale,
                                             const CSSPoint& aFocus) {
   mFrameMetrics.ZoomBy(aScale);
   // We want to adjust the scroll offset such that the CSS point represented by aFocus remains
--- a/gfx/layers/apz/src/AsyncPanZoomController.h
+++ b/gfx/layers/apz/src/AsyncPanZoomController.h
@@ -311,16 +311,25 @@ public:
   /**
    * Cancels any currently running animation.
    * aFlags is a bit-field to provide specifics of how to cancel the animation.
    * See CancelAnimationFlags.
    */
   void CancelAnimation(CancelAnimationFlags aFlags = Default);
 
   /**
+   * Adjusts the scroll position to compensate for a shift in the surface, such
+   * that the content appears to remain visually in the same position. i.e. if
+   * the surface moves up by 10 screenpixels, the scroll position should also
+   * move up by 10 pixels so that what used to be at the top of the surface is
+   * now 10 pixels down the surface.
+   */
+  void AdjustScrollForSurfaceShift(const ScreenPoint& aShift);
+
+  /**
    * Clear any overscroll on this APZC.
    */
   void ClearOverscroll();
 
   /**
    * Returns whether this APZC is for an element marked with the 'scrollgrab'
    * attribute.
    */
--- a/hal/Hal.cpp
+++ b/hal/Hal.cpp
@@ -56,23 +56,20 @@ using namespace mozilla::dom;
     } else {                                      \
       return hal_impl::_call;                     \
     }                                             \
   } while (0)
 
 namespace mozilla {
 namespace hal {
 
-PRLogModuleInfo *
+mozilla::LogModule *
 GetHalLog()
 {
-  static PRLogModuleInfo *sHalLog;
-  if (!sHalLog) {
-    sHalLog = PR_NewLogModule("hal");
-  }
+  static mozilla::LazyLogModule sHalLog("hal");
   return sHalLog;
 }
 
 namespace {
 
 void
 AssertMainThread()
 {
--- a/hal/HalLog.h
+++ b/hal/HalLog.h
@@ -15,17 +15,17 @@
  * This should be considered a private include and not used in non-HAL code.
  * To enable logging in non-debug builds define the PR_FORCE_LOG macro here.
  */
 
 namespace mozilla {
 
 namespace hal {
 
-extern PRLogModuleInfo *GetHalLog();
+mozilla::LogModule *GetHalLog();
 #define HAL_LOG(...) \
   MOZ_LOG(mozilla::hal::GetHalLog(), LogLevel::Debug, (__VA_ARGS__))
 #define HAL_ERR(...) \
   MOZ_LOG(mozilla::hal::GetHalLog(), LogLevel::Error, (__VA_ARGS__))
 
 } // namespace hal
 
 } // namespace mozilla
--- a/hal/sandbox/PHal.ipdl
+++ b/hal/sandbox/PHal.ipdl
@@ -95,89 +95,89 @@ struct SystemTimezoneChangeInformation {
 } // namespace hal
 
 namespace hal_sandbox {
 
 prio(normal upto urgent) sync protocol PHal {
     manager PContent;
 
 child:
-    NotifyBatteryChange(BatteryInformation aBatteryInfo);
-    NotifyNetworkChange(NetworkInformation aNetworkInfo);
-    NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
-    NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
-    NotifySwitchChange(SwitchEvent aEvent);
-    NotifySystemClockChange(int64_t aClockDeltaMS); 
-    NotifySystemTimezoneChange(SystemTimezoneChangeInformation aSystemTimezoneChangeInfo); 
+    async NotifyBatteryChange(BatteryInformation aBatteryInfo);
+    async NotifyNetworkChange(NetworkInformation aNetworkInfo);
+    async NotifyWakeLockChange(WakeLockInformation aWakeLockInfo);
+    async NotifyScreenConfigurationChange(ScreenConfiguration aScreenOrientation);
+    async NotifySwitchChange(SwitchEvent aEvent);
+    async NotifySystemClockChange(int64_t aClockDeltaMS); 
+    async NotifySystemTimezoneChange(SystemTimezoneChangeInformation aSystemTimezoneChangeInfo); 
 
 parent:
-    Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
-    CancelVibrate(uint64_t[] id, PBrowser browser);
+    async Vibrate(uint32_t[] pattern, uint64_t[] id, PBrowser browser);
+    async CancelVibrate(uint64_t[] id, PBrowser browser);
 
-    EnableBatteryNotifications();
-    DisableBatteryNotifications();
+    async EnableBatteryNotifications();
+    async DisableBatteryNotifications();
     sync GetCurrentBatteryInformation()
       returns (BatteryInformation aBatteryInfo);
 
-    EnableNetworkNotifications();
-    DisableNetworkNotifications();
+    async EnableNetworkNotifications();
+    async DisableNetworkNotifications();
     sync GetCurrentNetworkInformation()
       returns (NetworkInformation aNetworkInfo);
 
     sync GetScreenEnabled() returns (bool enabled);
-    SetScreenEnabled(bool aEnabled);
+    async SetScreenEnabled(bool aEnabled);
 
     sync GetKeyLightEnabled() returns (bool enabled);
-    SetKeyLightEnabled(bool aEnabled);
+    async SetKeyLightEnabled(bool aEnabled);
 
     sync GetCpuSleepAllowed() returns (bool allowed);
-    SetCpuSleepAllowed(bool aAllowed);
+    async SetCpuSleepAllowed(bool aAllowed);
 
     sync GetScreenBrightness() returns (double brightness);
-    SetScreenBrightness(double aBrightness);
+    async SetScreenBrightness(double aBrightness);
 
-    AdjustSystemClock(int64_t aDeltaMilliseconds);
-    SetTimezone(nsCString aTimezoneSpec);
+    async AdjustSystemClock(int64_t aDeltaMilliseconds);
+    async SetTimezone(nsCString aTimezoneSpec);
     sync GetTimezone()
       returns (nsCString aTimezoneSpec);
     sync GetTimezoneOffset()
       returns (int32_t aTimezoneOffset);
-    EnableSystemClockChangeNotifications();
-    DisableSystemClockChangeNotifications();
-    EnableSystemTimezoneChangeNotifications();
-    DisableSystemTimezoneChangeNotifications();
+    async EnableSystemClockChangeNotifications();
+    async DisableSystemClockChangeNotifications();
+    async EnableSystemTimezoneChangeNotifications();
+    async DisableSystemTimezoneChangeNotifications();
 
-    ModifyWakeLock(nsString aTopic,
-                   WakeLockControl aLockAdjust,
-                   WakeLockControl aHiddenAdjust,
-                   uint64_t aProcessID);
-    EnableWakeLockNotifications();
-    DisableWakeLockNotifications();
+    async ModifyWakeLock(nsString aTopic,
+                         WakeLockControl aLockAdjust,
+                         WakeLockControl aHiddenAdjust,
+                         uint64_t aProcessID);
+    async EnableWakeLockNotifications();
+    async DisableWakeLockNotifications();
     sync GetWakeLockInfo(nsString aTopic)
       returns (WakeLockInformation aWakeLockInfo);
 
-    EnableScreenConfigurationNotifications();
-    DisableScreenConfigurationNotifications();
+    async EnableScreenConfigurationNotifications();
+    async DisableScreenConfigurationNotifications();
     prio(urgent) sync GetCurrentScreenConfiguration()
       returns (ScreenConfiguration aScreenConfiguration);
     sync LockScreenOrientation(ScreenOrientationInternal aOrientation)
       returns (bool allowed);
-    UnlockScreenOrientation();
+    async UnlockScreenOrientation();
  
-    EnableSwitchNotifications(SwitchDevice aDevice);
-    DisableSwitchNotifications(SwitchDevice aDevice);
+    async EnableSwitchNotifications(SwitchDevice aDevice);
+    async DisableSwitchNotifications(SwitchDevice aDevice);
     sync GetCurrentSwitchState(SwitchDevice aDevice)
       returns (SwitchState aState);
 
-    FactoryReset(nsString aReason);
+    async FactoryReset(nsString aReason);
 
 child:
-    NotifySensorChange(SensorData aSensorData);
+    async NotifySensorChange(SensorData aSensorData);
 
 parent:
-    EnableSensorNotifications(SensorType aSensor);
-    DisableSensorNotifications(SensorType aSensor);
+    async EnableSensorNotifications(SensorType aSensor);
+    async DisableSensorNotifications(SensorType aSensor);
 
-    __delete__();
+    async __delete__();
 };
 
 } // namespace hal
 } // namespace mozilla
--- a/image/Downscaler.cpp
+++ b/image/Downscaler.cpp
@@ -101,21 +101,31 @@ Downscaler::BeginFrame(const nsIntSize& 
 
   auto resizeMethod = skia::ImageOperations::RESIZE_LANCZOS3;
 
   skia::resize::ComputeFilters(resizeMethod,
                                mOriginalSize.width, mTargetSize.width,
                                0, mTargetSize.width,
                                mXFilter.get());
 
+  if (mXFilter->max_filter() <= 0 || mXFilter->num_values() != mTargetSize.width) {
+    NS_WARNING("Failed to compute filters for image downscaling");
+    return NS_ERROR_OUT_OF_MEMORY;
+  }
+
   skia::resize::ComputeFilters(resizeMethod,
                                mOriginalSize.height, mTargetSize.height,
                                0, mTargetSize.height,
                                mYFilter.get());
 
+  if (mYFilter->max_filter() <= 0 || mYFilter->num_values() != mTargetSize.height) {
+    NS_WARNING("Failed to compute filters for image downscaling");
+    return NS_ERROR_OUT_OF_MEMORY;
+  }
+
   // Allocate the buffer, which contains scanlines of the original image.
   // pad by 15 to handle overreads by the simd code
   size_t bufferLen = mOriginalSize.width * sizeof(uint32_t) + 15;
   mRowBuffer.reset(new (fallible) uint8_t[bufferLen]);
   if (MOZ_UNLIKELY(!mRowBuffer)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
--- a/ipc/chromium/src/base/logging.cc
+++ b/ipc/chromium/src/base/logging.cc
@@ -37,41 +37,33 @@ Logger::~Logger()
     break;
 
   case LOG_FATAL:
     prlevel = LogLevel::Error;
     xpcomlevel = NS_DEBUG_ABORT;
     break;
   }
 
-  MOZ_LOG(GetLog(), prlevel, ("%s:%i: %s", mFile, mLine, mMsg ? mMsg : "<no message>"));
+  MOZ_LOG(gChromiumPRLog, prlevel, ("%s:%i: %s", mFile, mLine, mMsg ? mMsg : "<no message>"));
   if (xpcomlevel != -1)
     NS_DebugBreak(xpcomlevel, mMsg, NULL, mFile, mLine);
 
   PR_Free(mMsg);
 }
 
 void
 Logger::printf(const char* fmt, ...)
 {
   va_list args;
   va_start(args, fmt);
   mMsg = PR_vsprintf_append(mMsg, fmt, args);
   va_end(args);
 }
 
-PRLogModuleInfo* Logger::gChromiumPRLog;
-
-PRLogModuleInfo* Logger::GetLog()
-{
-  if (!gChromiumPRLog)
-    gChromiumPRLog = PR_NewLogModule("chromium");
-  return gChromiumPRLog;
-}
-
+LazyLogModule Logger::gChromiumPRLog("chromium");
 } // namespace mozilla 
 
 mozilla::Logger&
 operator<<(mozilla::Logger& log, const char* s)
 {
   log.printf("%s", s);
   return log;
 }
--- a/ipc/chromium/src/base/logging.h
+++ b/ipc/chromium/src/base/logging.h
@@ -40,18 +40,18 @@ public:
   { }
 
   ~Logger();
 
   // not private so that the operator<< overloads can get to it
   void printf(const char* fmt, ...);
 
 private:
-  static PRLogModuleInfo* gChromiumPRLog;
-  static PRLogModuleInfo* GetLog();
+  static mozilla::LazyLogModule gChromiumPRLog;
+//  static PRLogModuleInfo* GetLog();
 
   LogSeverity mSeverity;
   const char* mFile;
   int mLine;
   char* mMsg;
 
   DISALLOW_EVIL_CONSTRUCTORS(Logger);
 };
--- a/ipc/glue/PBackground.ipdl
+++ b/ipc/glue/PBackground.ipdl
@@ -55,52 +55,52 @@ sync protocol PBackground
   manages PNuwa;
   manages PQuota;
   manages PServiceWorkerManager;
   manages PUDPSocket;
   manages PVsync;
 
 parent:
   // Only called at startup during mochitests to check the basic infrastructure.
-  PBackgroundTest(nsCString testArg);
+  async PBackgroundTest(nsCString testArg);
 
-  PBackgroundIDBFactory(LoggingInfo loggingInfo);
+  async PBackgroundIDBFactory(LoggingInfo loggingInfo);
 
-  PBackgroundIndexedDBUtils();
+  async PBackgroundIndexedDBUtils();
 
-  PVsync();
+  async PVsync();
 
-  PCameras();
+  async PCameras();
 
-  PUDPSocket(OptionalPrincipalInfo pInfo, nsCString filter);
-  PBroadcastChannel(PrincipalInfo pInfo, nsCString origin, nsString channel,
-                    bool privateBrowsing);
+  async PUDPSocket(OptionalPrincipalInfo pInfo, nsCString filter);
+  async PBroadcastChannel(PrincipalInfo pInfo, nsCString origin, nsString channel,
+                          bool privateBrowsing);
 
-  PServiceWorkerManager();
+  async PServiceWorkerManager();
 
-  ShutdownServiceWorkerRegistrar();
+  async ShutdownServiceWorkerRegistrar();
 
-  PCacheStorage(Namespace aNamespace, PrincipalInfo aPrincipalInfo);
+  async PCacheStorage(Namespace aNamespace, PrincipalInfo aPrincipalInfo);
 
-  PMessagePort(nsID uuid, nsID destinationUuid, uint32_t sequenceId);
+  async PMessagePort(nsID uuid, nsID destinationUuid, uint32_t sequenceId);
 
-  PNuwa();
+  async PNuwa();
 
-  MessagePortForceClose(nsID uuid, nsID destinationUuid, uint32_t sequenceId);
+  async MessagePortForceClose(nsID uuid, nsID destinationUuid, uint32_t sequenceId);
 
-  PAsmJSCacheEntry(OpenMode openMode,
-                   WriteParams write,
-                   PrincipalInfo principalInfo);
+  async PAsmJSCacheEntry(OpenMode openMode,
+                         WriteParams write,
+                         PrincipalInfo principalInfo);
 
-  PQuota();
+  async PQuota();
 
 child:
-  PCache();
-  PCacheStreamControl();
+  async PCache();
+  async PCacheStreamControl();
 
 both:
-  PBlob(BlobConstructorParams params);
+  async PBlob(BlobConstructorParams params);
 
-  PFileDescriptorSet(FileDescriptor fd);
+  async PFileDescriptorSet(FileDescriptor fd);
 };
 
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/glue/PBackgroundTest.ipdl
+++ b/ipc/glue/PBackgroundTest.ipdl
@@ -8,13 +8,13 @@ namespace mozilla {
 namespace ipc {
 
 // This is a very simple testing protocol that is only used during mochitests.
 protocol PBackgroundTest
 {
   manager PBackground;
 
 child:
-  __delete__(nsCString testArg);
+  async __delete__(nsCString testArg);
 };
 
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/glue/PFileDescriptorSet.ipdl
+++ b/ipc/glue/PFileDescriptorSet.ipdl
@@ -8,15 +8,15 @@ include protocol PContent;
 namespace mozilla {
 namespace ipc {
 
 protocol PFileDescriptorSet
 {
   manager PBackground or PContent;
 
 both:
-  AddFileDescriptor(FileDescriptor fd);
+  async AddFileDescriptor(FileDescriptor fd);
 
-  __delete__();
+  async __delete__();
 };
 
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/ipdl/ipdl/parser.py
+++ b/ipc/ipdl/ipdl/parser.py
@@ -494,17 +494,17 @@ def p_MessageDirectionLabel(p):
     elif p[1] == 'child':
         Parser.current.direction = OUT
     elif p[1] == 'both':
         Parser.current.direction = INOUT
     else:
         assert 0
 
 def p_MessageDecl(p):
-    """MessageDecl : OptionalSendSemanticsQual MessageBody"""
+    """MessageDecl : SendSemanticsQual MessageBody"""
     msg = p[2]
     msg.priority = p[1][0]
     msg.sendSemantics = p[1][1]
 
     if Parser.current.direction is None:
         _error(msg.loc, 'missing message direction')
     msg.direction = Parser.current.direction
 
@@ -631,22 +631,16 @@ def p_Priority(p):
     """Priority : NORMAL
                 | HIGH
                 | URGENT"""
     prios = {'normal': 1,
              'high': 2,
              'urgent': 3}
     p[0] = prios[p[1]]
 
-def p_OptionalSendSemanticsQual(p):
-    """OptionalSendSemanticsQual : SendSemanticsQual
-                                 | """
-    if 2 == len(p): p[0] = p[1]
-    else:           p[0] = [ NORMAL_PRIORITY, ASYNC ]
-
 def p_SendSemanticsQual(p):
     """SendSemanticsQual : ASYNC
                          | SYNC
                          | PRIO '(' Priority ')' ASYNC
                          | PRIO '(' Priority ')' SYNC
                          | INTR"""
     if p[1] == 'prio':
         mtype = p[5]
--- a/ipc/ipdl/test/cxx/PTestActorPunning.ipdl
+++ b/ipc/ipdl/test/cxx/PTestActorPunning.ipdl
@@ -8,23 +8,23 @@ using struct mozilla::_ipdltest::Bad fro
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestActorPunning {
     manages PTestActorPunningPunned;
     manages PTestActorPunningSub;
 
 child:
-    Start();
+    async Start();
 
 parent:
-    PTestActorPunningPunned();
-    PTestActorPunningSub();
-    Pun(PTestActorPunningSub a, Bad bad);
-    __delete__();
+    async PTestActorPunningPunned();
+    async PTestActorPunningSub();
+    async Pun(PTestActorPunningSub a, Bad bad);
+    async __delete__();
 
 
 state PING:
     send Start goto CONSTRUCTING;
 
 state CONSTRUCTING:
     recv PTestActorPunningPunned goto CONSTRUCTING;
     recv PTestActorPunningSub goto CONSTRUCTING;
--- a/ipc/ipdl/test/cxx/PTestActorPunningPunned.ipdl
+++ b/ipc/ipdl/test/cxx/PTestActorPunningPunned.ipdl
@@ -3,13 +3,13 @@ include protocol PTestActorPunning;
 
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestActorPunningPunned {
     manager PTestActorPunning;
 
 child:
-    __delete__();
+    async __delete__();
 };
 
 } // namespace mozilla
 } // namespace _ipdltes
--- a/ipc/ipdl/test/cxx/PTestActorPunningSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestActorPunningSub.ipdl
@@ -3,14 +3,14 @@ include protocol PTestActorPunning;
 
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestActorPunningSub {
     manager PTestActorPunning;
 
 child:
-    Bad();
-    __delete__();
+    async Bad();
+    async __delete__();
 };
 
 } // namespace mozilla
 } // namespace _ipdltes
--- a/ipc/ipdl/test/cxx/PTestBadActor.ipdl
+++ b/ipc/ipdl/test/cxx/PTestBadActor.ipdl
@@ -5,14 +5,14 @@ namespace _ipdltest {
 
 // Test that a parent sending a reentrant __delete__ message
 // is not killed if a child's message races with the reply.
 
 intr protocol PTestBadActor {
   manages PTestBadActorSub;
 
 child:
-  PTestBadActorSub();
-  __delete__();
+  async PTestBadActorSub();
+  async __delete__();
 };
 
 } // namespace _ipdltest
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/PTestBadActorSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestBadActorSub.ipdl
@@ -5,13 +5,13 @@ namespace _ipdltest {
 
 intr protocol PTestBadActorSub {
   manager PTestBadActor;
 
 child:
   intr __delete__();
 
 parent:
-  Ping();
+  async Ping();
 };
 
 } // namespace _ipdltest
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/PTestBridgeMain.ipdl
+++ b/ipc/ipdl/test/cxx/PTestBridgeMain.ipdl
@@ -5,20 +5,20 @@ namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestBridgeMain {
     child spawns PTestBridgeSub;
     child opens PTestBridgeMainSub;
 
 child:
-    Start();
+    async Start();
 
 parent:
-    __delete__();
+    async __delete__();
 
 state START:
     send Start goto DEAD;
 state DEAD:
     recv __delete__;
 };
 
 
--- a/ipc/ipdl/test/cxx/PTestBridgeMainSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestBridgeMainSub.ipdl
@@ -5,24 +5,24 @@ namespace mozilla {
 namespace _ipdltest {
 
 // (Bridge protocols can have different semantics than the endpoints
 // they bridge)
 intr protocol PTestBridgeMainSub {
     bridges PTestBridgeMain, PTestBridgeSub;
 
 child:
-    Hi();
+    async Hi();
     intr HiRpc();
 
 parent:
-    Hello();
+    async Hello();
     sync HelloSync();
     intr HelloRpc();
-    __delete__();
+    async __delete__();
 
 state START:       recv Hello goto HI;
 state HI:          send Hi goto HELLO_SYNC;
 state HELLO_SYNC:  recv HelloSync goto HELLO_RPC;
 state HELLO_RPC:   answer HelloRpc goto HI_RPC;
 state HI_RPC:      call HiRpc goto DEAD;
 state DEAD:
     recv __delete__;
--- a/ipc/ipdl/test/cxx/PTestBridgeSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestBridgeSub.ipdl
@@ -1,21 +1,21 @@
 include protocol PTestBridgeMainSub;
 
 namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestBridgeSub {
 child:
-    Ping();
+    async Ping();
 
 parent:
-    BridgeEm();
-    __delete__();
+    async BridgeEm();
+    async __delete__();
 
 state START:
     send Ping goto BRIDGEEM;
 state BRIDGEEM:
     recv BridgeEm goto DEAD;
 state DEAD:
     recv __delete__;
 };
--- a/ipc/ipdl/test/cxx/PTestCrashCleanup.ipdl
+++ b/ipc/ipdl/test/cxx/PTestCrashCleanup.ipdl
@@ -5,17 +5,17 @@
 
 namespace mozilla {
 namespace _ipdltest {
 
 // NB: needs to be RPC so that the parent blocks on the child's crash.
 intr protocol PTestCrashCleanup {
 child:
     intr DIEDIEDIE();
-    __delete__();
+    async __delete__();
 
 state ALIVE:
     call DIEDIEDIE goto CRASH;
 state CRASH:
     send __delete__;
 };
 
 }
--- a/ipc/ipdl/test/cxx/PTestDataStructures.ipdl
+++ b/ipc/ipdl/test/cxx/PTestDataStructures.ipdl
@@ -5,22 +5,22 @@ include "mozilla/GfxMessageUtils.h";
 
 namespace mozilla {
 namespace _ipdltest {
 
 sync protocol PTestDataStructures {
     manages PTestDataStructuresSub;
 
 child:
-    PTestDataStructuresSub(int i);
+    async PTestDataStructuresSub(int i);
 
-    Start();
+    async Start();
 
 parent:
-    __delete__();
+    async __delete__();
 
     sync Test1(int[] i1)
         returns (int[] o1);
 
     sync Test2(PTestDataStructuresSub[] i1)
         returns (PTestDataStructuresSub[] o1);
 
     sync Test3(IntDouble i1,
--- a/ipc/ipdl/test/cxx/PTestDesc.ipdl
+++ b/ipc/ipdl/test/cxx/PTestDesc.ipdl
@@ -4,22 +4,22 @@ include protocol PTestDescSubsub;
 namespace mozilla {
 namespace _ipdltest {
 
 intr protocol PTestDesc {
     manages PTestDescSub; 
 child:
     intr PTestDescSub(nullable PTestDescSubsub dummy);
 
-    Test(PTestDescSubsub a);
+    async Test(PTestDescSubsub a);
 
-    __delete__();
+    async __delete__();
 
 parent:
-    Ok(PTestDescSubsub a);
+    async Ok(PTestDescSubsub a);
 
 
 state CONSTRUCT:
     call PTestDescSub goto TEST;
 state TEST:
     send Test goto ACK;
 state ACK:
     recv Ok goto DEAD;
--- a/ipc/ipdl/test/cxx/PTestDescSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestDescSub.ipdl
@@ -4,15 +4,15 @@ include protocol PTestDescSubsub;
 namespace mozilla {
 namespace _ipdltest {
 
 intr protocol PTestDescSub {
     manager PTestDesc;
     manages PTestDescSubsub;
 
 child:
-    __delete__();
+    async __delete__();
 
     intr PTestDescSubsub();
 };
 
 }
 }
--- a/ipc/ipdl/test/cxx/PTestEndpointBridgeMain.ipdl
+++ b/ipc/ipdl/test/cxx/PTestEndpointBridgeMain.ipdl
@@ -7,17 +7,17 @@ include protocol PTestEndpointBridgeSub;
 namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestEndpointBridgeMain {
   child spawns PTestEndpointBridgeSub;
 
 child:
-  Start();
+  async Start();
 
 parent:
-  Bridged(Endpoint<PTestEndpointBridgeMainSubParent> endpoint);
+  async Bridged(Endpoint<PTestEndpointBridgeMainSubParent> endpoint);
 };
 
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/PTestEndpointBridgeMainSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestEndpointBridgeMainSub.ipdl
@@ -6,20 +6,20 @@ include protocol PTestEndpointBridgeSub;
 
 namespace mozilla {
 namespace _ipdltest {
 
 // (Bridge protocols can have different semantics than the endpoints
 // they bridge)
 intr protocol PTestEndpointBridgeMainSub {
 child:
-  Hi();
+  async Hi();
   intr HiRpc();
 
 parent:
-  Hello();
+  async Hello();
   sync HelloSync();
   intr HelloRpc();
 };
 
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/PTestEndpointBridgeSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestEndpointBridgeSub.ipdl
@@ -4,19 +4,19 @@
 include protocol PTestEndpointBridgeMainSub;
 
 namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestEndpointBridgeSub {
 child:
-  Ping();
+  async Ping();
 
-  Bridged(Endpoint<PTestEndpointBridgeMainSubChild> endpoint);
+  async Bridged(Endpoint<PTestEndpointBridgeMainSubChild> endpoint);
 
 parent:
-  BridgeEm();
+  async BridgeEm();
 };
 
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/PTestEndpointOpens.ipdl
+++ b/ipc/ipdl/test/cxx/PTestEndpointOpens.ipdl
@@ -2,18 +2,18 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 include protocol PTestEndpointOpensOpened;
 
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestEndpointOpens {
 child:
-  Start();
+  async Start();
 
 parent:
-  StartSubprotocol(Endpoint<PTestEndpointOpensOpenedParent> endpoint);
+  async StartSubprotocol(Endpoint<PTestEndpointOpensOpenedParent> endpoint);
 
-  __delete__();
+  async __delete__();
 };
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/PTestEndpointOpensOpened.ipdl
+++ b/ipc/ipdl/test/cxx/PTestEndpointOpensOpened.ipdl
@@ -2,24 +2,24 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 namespace mozilla {
 namespace _ipdltest2 {
 
 // (Opens protocols can have different semantics than the endpoints
 // that opened them)
 intr protocol PTestEndpointOpensOpened {
 child:
-    Hi();
+    async Hi();
     intr HiRpc();
 
 parent:
-    Hello();
+    async Hello();
     sync HelloSync();
     intr HelloRpc();
-    __delete__();
+    async __delete__();
 
 state START:       recv Hello goto HI;
 state HI:          send Hi goto HELLO_SYNC;
 state HELLO_SYNC:  recv HelloSync goto HELLO_RPC;
 state HELLO_RPC:   answer HelloRpc goto HI_RPC;
 state HI_RPC:      call HiRpc goto DEAD;
 state DEAD:
     recv __delete__;
--- a/ipc/ipdl/test/cxx/PTestFailedCtor.ipdl
+++ b/ipc/ipdl/test/cxx/PTestFailedCtor.ipdl
@@ -2,17 +2,17 @@ include protocol PTestFailedCtorSub;
 
 namespace mozilla {
 namespace _ipdltest {
 
 intr protocol PTestFailedCtor {
     manages PTestFailedCtorSub; 
 child:
     intr PTestFailedCtorSub();
-    __delete__();
+    async __delete__();
 
 state CONSTRUCT:
     call PTestFailedCtorSub goto DEAD;
 state DEAD:
     send __delete__;
 };
 
 }
--- a/ipc/ipdl/test/cxx/PTestFailedCtorSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestFailedCtorSub.ipdl
@@ -6,13 +6,13 @@ namespace _ipdltest {
 
 intr protocol PTestFailedCtorSub {
     manager PTestFailedCtor;
     manages PTestFailedCtorSubsub;
 
 parent:
     async PTestFailedCtorSubsub();
     sync Sync();
-    __delete__();
+    async __delete__();
 };
 
 }
 }
--- a/ipc/ipdl/test/cxx/PTestFailedCtorSubsub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestFailedCtorSubsub.ipdl
@@ -3,13 +3,13 @@ include protocol PTestFailedCtorSub;
 
 namespace mozilla {
 namespace _ipdltest {
 
 intr protocol PTestFailedCtorSubsub {
     manager PTestFailedCtorSub;
 
 parent:
-     __delete__();
+     async __delete__();
 };
 
 }
 }
--- a/ipc/ipdl/test/cxx/PTestHandle.ipdl
+++ b/ipc/ipdl/test/cxx/PTestHandle.ipdl
@@ -2,13 +2,13 @@ include protocol PTestJSON;
 
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestHandle {
     manager PTestJSON;
 
 child:
-    __delete__();
+    async __delete__();
 };
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/PTestHangs.ipdl
+++ b/ipc/ipdl/test/cxx/PTestHangs.ipdl
@@ -7,17 +7,17 @@ both:
     intr StackFrame();
 
 parent:
     async Nonce();
 
 child:
     async Start();
     intr Hang();
-    __delete__();
+    async __delete__();
 
 
 state START:
     send Start goto RACE;
 
 state RACE:
     recv Nonce goto RACE1;
     call StackFrame goto RACE2;
--- a/ipc/ipdl/test/cxx/PTestIndirectProtocolParamFirst.ipdl
+++ b/ipc/ipdl/test/cxx/PTestIndirectProtocolParamFirst.ipdl
@@ -7,13 +7,13 @@ include PTestIndirectProtocolParam;
 namespace mozilla {
 namespace _ipdltest {
 
 sync protocol PTestIndirectProtocolParamFirst {
     manager PTestIndirectProtocolParamManage;
 parent:
     sync Test(IndirectParamUnion actor);
 both:
-    __delete__();
+    async __delete__();
 };
 
 }
 }
--- a/ipc/ipdl/test/cxx/PTestIndirectProtocolParamManage.ipdl
+++ b/ipc/ipdl/test/cxx/PTestIndirectProtocolParamManage.ipdl
@@ -3,15 +3,15 @@ include protocol PTestIndirectProtocolPa
 
 namespace mozilla {
 namespace _ipdltest {
 
 sync protocol PTestIndirectProtocolParamManage {
     manages PTestIndirectProtocolParamFirst;
     manages PTestIndirectProtocolParamSecond;
 both:
-    PTestIndirectProtocolParamFirst();
-    PTestIndirectProtocolParamSecond();
-    __delete__();
+    async PTestIndirectProtocolParamFirst();
+    async PTestIndirectProtocolParamSecond();
+    async __delete__();
 };
 
 }
 }
--- a/ipc/ipdl/test/cxx/PTestIndirectProtocolParamSecond.ipdl
+++ b/ipc/ipdl/test/cxx/PTestIndirectProtocolParamSecond.ipdl
@@ -1,13 +1,13 @@
 include protocol PTestIndirectProtocolParamManage;
 
 namespace mozilla {
 namespace _ipdltest {
 
 sync protocol PTestIndirectProtocolParamSecond {
     manager PTestIndirectProtocolParamManage;
 both:
-    __delete__();
+    async __delete__();
 };
 
 }
 }
--- a/ipc/ipdl/test/cxx/PTestInterruptRaces.ipdl
+++ b/ipc/ipdl/test/cxx/PTestInterruptRaces.ipdl
@@ -8,21 +8,21 @@ both:
     intr StackFrame3() returns ();
 
 parent:
     sync StartRace();
     intr Parent();
     sync GetAnsweredParent() returns (bool answeredParent);
 
 child:
-    Start();
-    Wakeup();
-    Wakeup3();
+    async Start();
+    async Wakeup();
+    async Wakeup3();
     intr Child();
-    __delete__();
+    async __delete__();
 
 state START:
     send Start goto TEST1;
 
 // First test: race while no other messages are on the Interrupt stack
 state TEST1:
     recv StartRace goto RACE1;
 state RACE1:
--- a/ipc/ipdl/test/cxx/PTestLatency.ipdl
+++ b/ipc/ipdl/test/cxx/PTestLatency.ipdl
@@ -1,29 +1,29 @@
 
 namespace mozilla {
 namespace _ipdltest {
 
 
 intr protocol PTestLatency {
 
 child:
-    __delete__();
-    Ping();
-    Ping5();
+    async __delete__();
+    async Ping();
+    async Ping5();
     intr Rpc();
-    Spam();
+    async Spam();
     intr Synchro();
-    CompressedSpam(uint32_t seqno) compress;
+    async CompressedSpam(uint32_t seqno) compress;
     intr Synchro2() returns (uint32_t lastSeqno,
                             uint32_t numMessagesDispatched);
 
 parent:
-    Pong();
-    Pong5();
+    async Pong();
+    async Pong5();
 
 state START:
     // if the timing resolution is too low, abort the test
     send __delete__;
     // otherwise, kick off the ping/pong trials
     send Ping goto PONG;
 
     // Trial 1: single ping/pong latency
--- a/ipc/ipdl/test/cxx/PTestManyChildAllocs.ipdl
+++ b/ipc/ipdl/test/cxx/PTestManyChildAllocs.ipdl
@@ -2,18 +2,18 @@ include protocol PTestManyChildAllocsSub
 
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestManyChildAllocs {
     manages PTestManyChildAllocsSub;
 
 child:
-    Go();                       // start allocating
+    async Go();                       // start allocating
 
 parent:
-    Done();
+    async Done();
 
-    PTestManyChildAllocsSub();
+    async PTestManyChildAllocsSub();
 };
 
 } // namespace _ipdltest
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/PTestManyChildAllocsSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestManyChildAllocsSub.ipdl
@@ -2,18 +2,18 @@ include protocol PTestManyChildAllocs;
 
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestManyChildAllocsSub {
     manager PTestManyChildAllocs;
 
 child:
-    __delete__();
+    async __delete__();
 
 parent:
-    Hello();
+    async Hello();
 
     // empty
 };
 
 } // namespace _ipdltest
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/PTestMultiMgrs.ipdl
+++ b/ipc/ipdl/test/cxx/PTestMultiMgrs.ipdl
@@ -4,23 +4,23 @@ include protocol PTestMultiMgrsRight;
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestMultiMgrs {
     manages PTestMultiMgrsLeft;
     manages PTestMultiMgrsRight;
 
 parent:
-    OK();
+    async OK();
 
 child:
-    PTestMultiMgrsLeft();
-    PTestMultiMgrsRight();
-    Check();
-    __delete__();
+    async PTestMultiMgrsLeft();
+    async PTestMultiMgrsRight();
+    async Check();
+    async __delete__();
 
 state START:
     send PTestMultiMgrsLeft goto CONSTRUCT_RIGHT;
 state CONSTRUCT_RIGHT:
     send PTestMultiMgrsRight goto CHILD_CHECK;
 state CHILD_CHECK:
     send Check goto CHILD_ACK;
 state CHILD_ACK:
--- a/ipc/ipdl/test/cxx/PTestMultiMgrsBottom.ipdl
+++ b/ipc/ipdl/test/cxx/PTestMultiMgrsBottom.ipdl
@@ -3,16 +3,16 @@ include protocol PTestMultiMgrsRight;
 
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestMultiMgrsBottom {
     manager PTestMultiMgrsLeft or PTestMultiMgrsRight;
 
 child:
-    __delete__();
+    async __delete__();
 
 state DOA:
     send __delete__;
 };
 
 } // namespace _ipdltest
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/PTestMultiMgrsLeft.ipdl
+++ b/ipc/ipdl/test/cxx/PTestMultiMgrsLeft.ipdl
@@ -5,18 +5,18 @@ namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestMultiMgrsLeft {
     manager PTestMultiMgrs;
 
     manages PTestMultiMgrsBottom;
 
 child:
-    PTestMultiMgrsBottom();
-    __delete__();
+    async PTestMultiMgrsBottom();
+    async __delete__();
 
 state START:
     send PTestMultiMgrsBottom goto DONE;
 
 state DONE:
     send __delete__;
 };
 
--- a/ipc/ipdl/test/cxx/PTestMultiMgrsRight.ipdl
+++ b/ipc/ipdl/test/cxx/PTestMultiMgrsRight.ipdl
@@ -5,18 +5,18 @@ namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestMultiMgrsRight {
     manager PTestMultiMgrs;
 
     manages PTestMultiMgrsBottom;
 
 child:
-    PTestMultiMgrsBottom();
-    __delete__();
+    async PTestMultiMgrsBottom();
+    async __delete__();
 
 state START:
     send PTestMultiMgrsBottom goto DONE;
 
 state DONE:
     send __delete__;
 };
 
--- a/ipc/ipdl/test/cxx/PTestNestedLoops.ipdl
+++ b/ipc/ipdl/test/cxx/PTestNestedLoops.ipdl
@@ -3,17 +3,17 @@ namespace mozilla {
 namespace _ipdltest {
 
 
 intr protocol PTestNestedLoops {
 
 child:
     async Start();
     intr R();
-    __delete__();
+    async __delete__();
 
 parent:
     async Nonce();
 
 
 state START:
     send Start goto RACE;
 
--- a/ipc/ipdl/test/cxx/PTestOpens.ipdl
+++ b/ipc/ipdl/test/cxx/PTestOpens.ipdl
@@ -4,20 +4,20 @@ namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestOpens {
     // This channel is opened and parked on a non-main thread
     child opens PTestOpensOpened;
 
 child:
-    Start();
+    async Start();
 
 parent:
-    __delete__();
+    async __delete__();
 
 state START:
     send Start goto DEAD;
 state DEAD:
     recv __delete__;
 };
 
 
--- a/ipc/ipdl/test/cxx/PTestOpensOpened.ipdl
+++ b/ipc/ipdl/test/cxx/PTestOpensOpened.ipdl
@@ -1,23 +1,23 @@
 namespace mozilla {
 namespace _ipdltest2 {
 
 // (Opens protocols can have different semantics than the endpoints
 // that opened them)
 intr protocol PTestOpensOpened {
 child:
-    Hi();
+    async Hi();
     intr HiRpc();
 
 parent:
-    Hello();
+    async Hello();
     sync HelloSync();
     intr HelloRpc();
-    __delete__();
+    async __delete__();
 
 state START:       recv Hello goto HI;
 state HI:          send Hi goto HELLO_SYNC;
 state HELLO_SYNC:  recv HelloSync goto HELLO_RPC;
 state HELLO_RPC:   answer HelloRpc goto HI_RPC;
 state HI_RPC:      call HiRpc goto DEAD;
 state DEAD:
     recv __delete__;
--- a/ipc/ipdl/test/cxx/PTestRacyReentry.ipdl
+++ b/ipc/ipdl/test/cxx/PTestRacyReentry.ipdl
@@ -2,17 +2,17 @@
 namespace mozilla {
 namespace _ipdltest {
 
 
 intr protocol PTestRacyReentry {
 
 parent:
     intr E();
-    __delete__();
+    async __delete__();
 
 child:
     async Start();
 
     async N();
     intr H();
 };
 
--- a/ipc/ipdl/test/cxx/PTestSanity.ipdl
+++ b/ipc/ipdl/test/cxx/PTestSanity.ipdl
@@ -1,21 +1,21 @@
 
 namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestSanity {
 
 child:
-    Ping(int zero, float zeroPtFive, int8_t dummy);
-    __delete__();
+    async Ping(int zero, float zeroPtFive, int8_t dummy);
+    async __delete__();
 
 parent:
-    Pong(int one, float zeroPtTwoFive, uint8_t dummy);
+    async Pong(int one, float zeroPtTwoFive, uint8_t dummy);
 
 
 state PING:
     send Ping goto PONG;
 
 state PONG:
     recv Pong goto DEAD;
 
--- a/ipc/ipdl/test/cxx/PTestSelfManage.ipdl
+++ b/ipc/ipdl/test/cxx/PTestSelfManage.ipdl
@@ -4,18 +4,18 @@ namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestSelfManage {
     manager PTestSelfManageRoot or PTestSelfManage;
     manages PTestSelfManage;
 
 child:
-    PTestSelfManage();
-    __delete__();
+    async PTestSelfManage();
+    async __delete__();
 
 state LIVE:
     send PTestSelfManage goto LIVE;
     send __delete__;
 };
 
 
 } // namespace mozilla
--- a/ipc/ipdl/test/cxx/PTestSelfManageRoot.ipdl
+++ b/ipc/ipdl/test/cxx/PTestSelfManageRoot.ipdl
@@ -3,18 +3,18 @@ include protocol PTestSelfManage;
 namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestSelfManageRoot {
     manages PTestSelfManage;
 
 child:
-    PTestSelfManage();
-    __delete__();
+    async PTestSelfManage();
+    async __delete__();
 
 state LIVE:
     send PTestSelfManage goto DEAD;
 
 state DEAD:
     send __delete__;
 };
 
--- a/ipc/ipdl/test/cxx/PTestShmem.ipdl
+++ b/ipc/ipdl/test/cxx/PTestShmem.ipdl
@@ -1,18 +1,18 @@
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestShmem {
 child:
-    Give(Shmem mem, Shmem unsafe, size_t expectedSize);
+    async Give(Shmem mem, Shmem unsafe, size_t expectedSize);
 
 parent:
-    Take(Shmem mem, Shmem unsafe, size_t expectedSize);
-    __delete__();
+    async Take(Shmem mem, Shmem unsafe, size_t expectedSize);
+    async __delete__();
 
 
 state GIVING:
     send Give goto TAKING;
 
 state TAKING:
     recv Take goto TAKING;
     recv __delete__;
--- a/ipc/ipdl/test/cxx/PTestShutdown.ipdl
+++ b/ipc/ipdl/test/cxx/PTestShutdown.ipdl
@@ -2,29 +2,29 @@ include protocol PTestShutdownSub;
 
 namespace mozilla {
 namespace _ipdltest {
 
 intr protocol PTestShutdown {
     manages PTestShutdownSub;
 
 child:
-    Start();
+    async Start();
 
 parent:
     // NB: we test deletion and crashing only, not shutdown, because
     // crashing is the same code path as shutdown, and other IPDL unit
     // tests check shutdown semantics
-    PTestShutdownSub(bool expectCrash);
+    async PTestShutdownSub(bool expectCrash);
 
     // Used to synchronize between parent and child, to avoid races
     // around flushing socket write queues
     sync Sync();
 
-    __delete__();
+    async __delete__();
 
 
 state START:
     send Start goto TESTING;
 
 state TESTING:
     recv PTestShutdownSub goto TESTING;
     recv Sync goto DYING;
--- a/ipc/ipdl/test/cxx/PTestShutdownSub.ipdl
+++ b/ipc/ipdl/test/cxx/PTestShutdownSub.ipdl
@@ -7,17 +7,17 @@ namespace _ipdltest {
 intr protocol PTestShutdownSub {
     manager PTestShutdown;
     manages PTestShutdownSubsub;
 
 both:
     intr StackFrame();
 
 parent:
-    PTestShutdownSubsub(bool expectParentDeleted);
+    async PTestShutdownSubsub(bool expectParentDeleted);
     sync __delete__();
 
 state CREATING:
     recv PTestShutdownSubsub goto CREATING;
     answer StackFrame goto DUMMYFRAME;
 
 state DUMMYFRAME:
     call StackFrame goto DEAD;
--- a/ipc/ipdl/test/cxx/PTestStackHooks.ipdl
+++ b/ipc/ipdl/test/cxx/PTestStackHooks.ipdl
@@ -13,17 +13,17 @@ parent:
     async Async();
     sync Sync();
     intr Rpc();
 
 both:
     intr StackFrame();
 
 parent:
-    __delete__();
+    async __delete__();
 
 
 state START:
     send Start goto TEST1;
 
 state TEST1:
     recv Async goto TEST2;
 
--- a/ipc/ipdl/test/cxx/PTestSyncError.ipdl
+++ b/ipc/ipdl/test/cxx/PTestSyncError.ipdl
@@ -1,21 +1,21 @@
 
 namespace mozilla {
 namespace _ipdltest {
 
 
 sync protocol PTestSyncError {
 
 child:
-    Start();
+    async Start();
 
 parent:
     sync Error();
-    __delete__();
+    async __delete__();
 
 
 state START:
     send Start goto SYNC_ERROR;
 
 state SYNC_ERROR:
     recv Error goto DEAD;
 
--- a/ipc/ipdl/test/cxx/PTestSyncHang.ipdl
+++ b/ipc/ipdl/test/cxx/PTestSyncHang.ipdl
@@ -1,15 +1,15 @@
 
 namespace mozilla {
 namespace _ipdltest {
 
 
 protocol PTestSyncHang {
 
 child:
-    __delete__();
+    async __delete__();
 
 };
 
 
 } // namespace mozilla
 } // namespace _ipdltest
--- a/ipc/ipdl/test/cxx/PTestSysVShmem.ipdl
+++ b/ipc/ipdl/test/cxx/PTestSysVShmem.ipdl
@@ -1,18 +1,18 @@
 namespace mozilla {
 namespace _ipdltest {
 
 protocol PTestSysVShmem {
 child:
-    Give(Shmem mem, Shmem unsafe, size_t expectedSize);
+    async Give(Shmem mem, Shmem unsafe, size_t expectedSize);
 
 parent:
-    Take(Shmem mem, Shmem unsafe, size_t expectedSize);
-    __delete__();
+    async Take(Shmem mem, Shmem unsafe, size_t expectedSize);
+    async __delete__();
 
 
 state GIVING:
     send Give goto TAKING;
 
 state TAKING:
     recv Take goto TAKING;
     recv __delete__;
--- a/ipc/ipdl/test/ipdl/error/DeleteRace.ipdl
+++ b/ipc/ipdl/test/ipdl/error/DeleteRace.ipdl
@@ -1,14 +1,14 @@
 // XXX kind of a gray area whether |__delete__| should be a part of the
 // top-level protocol.  but if it's ever not, this test will break and
 // we'll notice, right?
 protocol DeleteRace {
 parent:
-    M1();
+    async M1();
 
 child:
-    __delete__();
+    async __delete__();
 
 state START:
     send __delete__;
     recv M1 goto START;
 };
--- a/ipc/ipdl/test/ipdl/error/Nullable.ipdl
+++ b/ipc/ipdl/test/ipdl/error/Nullable.ipdl
@@ -1,4 +1,4 @@
 protocol Nullable {
 child:
-    Msg(nullable int i);
+    async Msg(nullable int i);
 };
--- a/ipc/ipdl/test/ipdl/error/Nullable2.ipdl
+++ b/ipc/ipdl/test/ipdl/error/Nullable2.ipdl
@@ -1,8 +1,8 @@
 union Union {
     nullable int;
 };
 
 protocol Nullable2 {
 child:
-    Msg(Union i);
+    async Msg(Union i);
 };
--- a/ipc/ipdl/test/ipdl/error/actorparam_badState.ipdl
+++ b/ipc/ipdl/test/ipdl/error/actorparam_badState.ipdl
@@ -1,10 +1,10 @@
 protocol actorparam_badState {
 
 child:
-    Msg(actorparam_badState:FARGEL p);
-    __delete__();
+    async Msg(actorparam_badState:FARGEL p);
+    async __delete__();
 
 state S1:
     send Msg goto S1;
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/bridgesSubprotocol.ipdl
+++ b/ipc/ipdl/test/ipdl/error/bridgesSubprotocol.ipdl
@@ -2,12 +2,12 @@ include protocol subprotocolBridges;
 
 protocol bridgesSubprotocol {
     bridges subprotocolBridges, subprotocolBridges;
 
     manages subprotocolBridges;
 
 child:
     subprotocolBridges();
-    __delete__();
+    async __delete__();
 
 state DEAD: send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/cyclecheck_Child.ipdl
+++ b/ipc/ipdl/test/ipdl/error/cyclecheck_Child.ipdl
@@ -2,11 +2,11 @@ include protocol cyclecheck_Parent;
 include protocol cyclecheck_Grandchild;
 
 protocol cyclecheck_Child {
     manager cyclecheck_Parent;
     manages cyclecheck_Grandchild;
 
 child:
     cyclecheck_Grandchild();
-    __delete__();
+    async __delete__();
 };
 
--- a/ipc/ipdl/test/ipdl/error/cyclecheck_Grandchild.ipdl
+++ b/ipc/ipdl/test/ipdl/error/cyclecheck_Grandchild.ipdl
@@ -2,11 +2,11 @@ include protocol cyclecheck_Child;
 include protocol cyclecheck_Parent;
 
 protocol cyclecheck_Grandchild {
     manager cyclecheck_Child;
     manages cyclecheck_Parent;
 
 child:
     cyclecheck_Parent();
-    __delete__();
+    async __delete__();
 };
 
--- a/ipc/ipdl/test/ipdl/error/cyclecheck_Parent.ipdl
+++ b/ipc/ipdl/test/ipdl/error/cyclecheck_Parent.ipdl
@@ -1,10 +1,10 @@
 include protocol cyclecheck_Child;
 
 protocol cyclecheck_Parent {
     manages cyclecheck_Child;
 
 child:
     cyclecheck_Child();
-    __delete__();
+    async __delete__();
 };
 
--- a/ipc/ipdl/test/ipdl/error/manageSelfToplevel.ipdl
+++ b/ipc/ipdl/test/ipdl/error/manageSelfToplevel.ipdl
@@ -1,8 +1,8 @@
 protocol manageSelfToplevel {
     manager manageSelfToplevel;
     manages manageSelfToplevel;
 
 child:
     manageSelfToplevel();
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/messageNoDirection.ipdl
+++ b/ipc/ipdl/test/ipdl/error/messageNoDirection.ipdl
@@ -1,3 +1,3 @@
 protocol messageNoDirection {
-    NoDirection();
+    async NoDirection();
 };
--- a/ipc/ipdl/test/ipdl/error/multimanDupMgrs.ipdl
+++ b/ipc/ipdl/test/ipdl/error/multimanDupMgrs.ipdl
@@ -1,8 +1,8 @@
 include protocol multimanDupMgrsMgr;
 
 protocol multimanDupMgrs {
     manager multimanDupMgrsMgr or multimanDupMgrsMgr;
 
 child:
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/multimanDupMgrsMgr.ipdl
+++ b/ipc/ipdl/test/ipdl/error/multimanDupMgrsMgr.ipdl
@@ -1,9 +1,9 @@
 include protocol multimanDupMgrs;
 
 protocol multimanDupMgrsMgr {
     manages multimanDupMgrs;
 
 child:
     multimanDupMgrs();
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/multimanNonexistentMgrs.ipdl
+++ b/ipc/ipdl/test/ipdl/error/multimanNonexistentMgrs.ipdl
@@ -1,7 +1,7 @@
 protocol multimanNonexistentManagers {
     manager Starsky or Hutch;
 
 child:
-    Dummy();
-    __delete__();
+    async Dummy();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/mutualRecStruct.ipdl
+++ b/ipc/ipdl/test/ipdl/error/mutualRecStruct.ipdl
@@ -10,11 +10,11 @@ struct Y {
 
 struct Z {
     double d;
     X x;
 };
 
 protocol mutualRecStruct {
 child:
-    Test(X x, Y y, Z z);
-    __delete__();
+    async Test(X x, Y y, Z z);
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/mutualRecStructUnion.ipdl
+++ b/ipc/ipdl/test/ipdl/error/mutualRecStructUnion.ipdl
@@ -10,11 +10,11 @@ union Y {
 
 struct Z {
     double d;
     X x;
 };
 
 protocol mutualRecStructUnion {
 child:
-    Test(X x, Y y, Z z);
-    __delete__();
+    async Test(X x, Y y, Z z);
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/opensSubprotocol.ipdl
+++ b/ipc/ipdl/test/ipdl/error/opensSubprotocol.ipdl
@@ -2,12 +2,12 @@ include protocol subprotocolOpens;
 
 protocol opensSubprotocol {
     child opens subprotocolOpens;
 
     manages subprotocolOpens;
 
 child:
     subprotocolOpens();
-    __delete__();
+    async __delete__();
 
 state DEAD: send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/race_OverlappingMultiOut.ipdl
+++ b/ipc/ipdl/test/ipdl/error/race_OverlappingMultiOut.ipdl
@@ -1,17 +1,17 @@
 protocol race_OverlappingMultiOut {
 child:
-    Msg1();
-    Msg1_();
-    __delete__(); suppressUndeleteableError();
+    async Msg1();
+    async Msg1_();
+    async __delete__(); suppressUndeleteableError();
 
 parent:
-    Msg2();
-    Msg2_();
+    async Msg2();
+    async Msg2_();
 
 
 start state _:
     send __delete__;
     send suppressUndeleteableError goto S10;
 
     // *** ERROR: send/recv of Msg1/Msg2 in state S10 goes to overlapping
     // sets { S11, S12 }, { S12, S13 } and thus can't be unidirectional
--- a/ipc/ipdl/test/ipdl/error/race_ViolateSameDirection.ipdl
+++ b/ipc/ipdl/test/ipdl/error/race_ViolateSameDirection.ipdl
@@ -1,16 +1,17 @@
 protocol race_ViolateSameDirection {
 child:
-    Msg1();
-    Msg1_();
-    __delete__(); suppressUndeleteableError();
+    async Msg1();
+    async Msg1_();
+    async __delete__();
+    async suppressUndeleteableError();
 parent:
-    Msg2();
-    Msg2_();
+    async Msg2();
+    async Msg2_();
 
     // *** ERROR: state S7 doesn't have all-same-direction
 start state _:
     send __delete__;
     send suppressUndeleteableError goto S6;
 
 state S6:
     send Msg1 goto S7;
--- a/ipc/ipdl/test/ipdl/error/redeclMessage.ipdl
+++ b/ipc/ipdl/test/ipdl/error/redeclMessage.ipdl
@@ -1,9 +1,9 @@
 protocol redeclMessage {
 
     // can't declare two messages with the same name
 
 child:
-    Msg();
-    Msg();
+    async Msg();
+    async Msg();
 
 };
--- a/ipc/ipdl/test/ipdl/error/redefState.ipdl
+++ b/ipc/ipdl/test/ipdl/error/redefState.ipdl
@@ -1,14 +1,14 @@
 protocol redefState {
 
     // error: redefining state in state machine
 child:
-    Msg();
-    __delete__();
+    async Msg();
+    async __delete__();
 
 state S1: send Msg goto S1;
 
 state S1: send Msg goto S1;
 
 start state _:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/shmem_access_union.ipdl
+++ b/ipc/ipdl/test/ipdl/error/shmem_access_union.ipdl
@@ -1,8 +1,8 @@
 union Union {
     [-r-w|+r+w] Shmem;
 };
 
 protocol shmem_access_union {
 child:
-    Msg(Union u);
+    async Msg(Union u);
 };
--- a/ipc/ipdl/test/ipdl/error/spawnsSubprotocol.ipdl
+++ b/ipc/ipdl/test/ipdl/error/spawnsSubprotocol.ipdl
@@ -2,12 +2,12 @@ include protocol subprotocolSpawns;
 
 protocol spawnsSubprotocol {
     parent spawns subprotocolSpawns;
 
     manages subprotocolSpawns;
 
 child:
     subprotocolSpawns();
-    __delete__();
+    async __delete__();
 
 state DEAD: send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongDirection.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection.ipdl
@@ -1,12 +1,12 @@
 protocol trans_WrongDirection {
 
 child:
-    Msg();
-    __delete__();
+    async Msg();
+    async __delete__();
 
 state S1:
     recv Msg goto S1;
 
 start state _:
     send __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongDirection2.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection2.ipdl
@@ -1,12 +1,12 @@
 protocol trans_WrongDirection2 {
 
 parent:
-    Msg();
-    __delete__();
+    async Msg();
+    async __delete__();
 
 state S1:
     send Msg goto S1;
 
 start state _:
     recv __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongDirection3.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection3.ipdl
@@ -1,12 +1,12 @@
 sync protocol trans_WrongDirection3 {
 
 parent:
     sync Msg();
-    __delete__();
+    async __delete__();
 
 state S1:
     send Msg goto S1;
 
 start state _:
     recv __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongDirection4.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection4.ipdl
@@ -1,12 +1,12 @@
 intr protocol trans_WrongDirection4 {
 
 child:
     intr Msg();
-    __delete__();
+    async __delete__();
 
 state S1:
     answer Msg goto S1;
 
 start state _:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongDirection5.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongDirection5.ipdl
@@ -1,12 +1,12 @@
 intr protocol trans_WrongDirection5 {
 
 parent:
     intr Msg();
-    __delete__()
+    async __delete__()
 
 state S1:
     call Msg goto S1;
 
 start state_:
     recv __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongName.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName.ipdl
@@ -1,10 +1,10 @@
 protocol trans_WrongName {
 
 child:
-    Msg();
-    __delete__();
+    async Msg();
+    async __delete__();
 
 state S1:
     call Msg goto S1;
     send __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongName2.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName2.ipdl
@@ -1,10 +1,10 @@
 protocol trans_WrongName2 {
 
 parent:
-    Msg();
-    __delete__();
+    async Msg();
+    async __delete__();
 
 state S1:
     answer Msg goto S1;
     recv __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongName3.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName3.ipdl
@@ -1,10 +1,10 @@
 sync protocol trans_WrongName3 {
 
 parent:
     sync Msg();
-    __delete__();
+    async __delete__();
 
 state S1:
     answer Msg goto S1;
     recv __delete__();
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongName4.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName4.ipdl
@@ -1,10 +1,10 @@
 intr protocol trans_WrongName4 {
 
 child:
     intr Msg();
-    __delete__();
+    async __delete__();
 
 state S1:
     send Msg goto S1;
     send __delete__
 };
--- a/ipc/ipdl/test/ipdl/error/trans_WrongName5.ipdl
+++ b/ipc/ipdl/test/ipdl/error/trans_WrongName5.ipdl
@@ -1,10 +1,10 @@
 intr protocol trans_WrongName5 {
 
 parent:
     intr Msg();
-    __delete__();
+    async __delete__();
 
 state S1:
     recv Msg goto S1;
     recv __delete__;
 };
--- a/ipc/ipdl/test/ipdl/error/unreachedDeleteMultiStart.ipdl
+++ b/ipc/ipdl/test/ipdl/error/unreachedDeleteMultiStart.ipdl
@@ -1,10 +1,10 @@
 protocol unreachedDeleteMultiStart {
 child:
-    M1(); M2(); __delete__();
+    async M1(); async M2(); async __delete__();
 
 start state S1:  send M1 goto S2;
 state S2:        send __delete__;
 
 start state S3:  send M2 goto S4;
 state S4:        send M1 goto S3;
 };
--- a/ipc/ipdl/test/ipdl/ok/Delete.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/Delete.ipdl
@@ -1,8 +1,8 @@
 include protocol DeleteSub;
 
 sync protocol Delete {
     manages DeleteSub;
 
 child:
-    DeleteSub();
+    async DeleteSub();
 };
--- a/ipc/ipdl/test/ipdl/ok/Nullable.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/Nullable.ipdl
@@ -1,11 +1,11 @@
 union Union {
     nullable Nullable;
     nullable Nullable[];
 };
 
 protocol Nullable {
 child:
-    Msg(nullable Nullable n);
-    Msg2(nullable Nullable[] N);
-    Msg3(Union u);
+    async Msg(nullable Nullable n);
+    async Msg2(nullable Nullable[] N);
+    async Msg3(Union u);
 };
--- a/ipc/ipdl/test/ipdl/ok/Struct.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/Struct.ipdl
@@ -1,10 +1,10 @@
 struct S {
     int i;
     double d;
 };
 
 sync protocol Struct {
 parent:
     sync test(S s) returns (S ss);
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/actorparam_state.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/actorparam_state.ipdl
@@ -1,10 +1,10 @@
 protocol actorparam_state {
 
 child:
-    Msg(actorparam_state:S1 p);
-    __delete__();
+    async Msg(actorparam_state:S1 p);
+    async __delete__();
 
 state S1:
     send Msg goto S1;
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/ok/array_Basic.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/array_Basic.ipdl
@@ -1,4 +1,4 @@
 protocol array_Basic {
 child:
-    Msg(int[] array);
+    async Msg(int[] array);
 };
--- a/ipc/ipdl/test/ipdl/ok/array_OfActors.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/array_OfActors.ipdl
@@ -1,10 +1,10 @@
 include protocol array_OfActorsSub;
 
 protocol array_OfActors {
     manages array_OfActorsSub;
 
 child:
-    Msg(array_OfActorsSub[] p);
+    async Msg(array_OfActorsSub[] p);
 
     array_OfActorsSub();
 };
--- a/ipc/ipdl/test/ipdl/ok/compositor.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/compositor.ipdl
@@ -1,11 +1,11 @@
 include protocol content;
 
 sync protocol compositor {
     bridges compositor, content;
 
 child:
-    __delete__();
+    async __delete__();
 
 state DEAD:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/ok/content.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/content.ipdl
@@ -5,13 +5,13 @@ include protocol plugin;
 
 sync protocol content {
     parent spawns compositor as parent;
     parent spawns jetpack;
     child spawns plugin;
     child opens media;
 
 child:
-    __delete__();
+    async __delete__();
 
 state DEAD:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/ok/headerProto.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/headerProto.ipdl
@@ -1,10 +1,10 @@
 include header;
 
 namespace c {
 
 protocol headerProto {
 child:
-    __delete__(foo a, baz b, Inner1 c, Inner2 d, X x);
+    async __delete__(foo a, baz b, Inner1 c, Inner2 d, X x);
 };
 
 }
--- a/ipc/ipdl/test/ipdl/ok/intrProtocol.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/intrProtocol.ipdl
@@ -1,13 +1,13 @@
 intr protocol intrProtocol {
 
     // sanity check of Interrupt protocols
 child:
-    AsyncMsg();
+    async AsyncMsg();
 
 parent:
     sync SyncMsg(int i) returns (int r);
 
 both:
     intr InterruptMsg(int x) returns (int y);
 
 };
--- a/ipc/ipdl/test/ipdl/ok/jetpack.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/jetpack.ipdl
@@ -1,7 +1,7 @@
 sync protocol jetpack {
 child:
-    __delete__();
+    async __delete__();
 
 state DEAD:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/ok/jetpackContent.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/jetpackContent.ipdl
@@ -1,12 +1,12 @@
 include protocol content;
 include protocol jetpack;
 
 intr protocol jetpackContent {
     bridges jetpack, content;
 
 child:
-    __delete__();
+    async __delete__();
 
 state DEAD:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/ok/manageSelf.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/manageSelf.ipdl
@@ -1,10 +1,10 @@
 include protocol manageSelf_Toplevel;
 
 protocol manageSelf {
     manager manageSelf_Toplevel or manageSelf;
     manages manageSelf;
 
 child:
     manageSelf();
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/manageSelf_Toplevel.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/manageSelf_Toplevel.ipdl
@@ -1,9 +1,9 @@
 include protocol manageSelf;
 
 protocol manageSelf_Toplevel {
     manages manageSelf;
 
 child:
     manageSelf();
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/managedProtocol.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/managedProtocol.ipdl
@@ -1,8 +1,8 @@
 include protocol managerProtocol;
 
 protocol managedProtocol {
     manager managerProtocol;
 
 child:
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/media.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/media.ipdl
@@ -1,7 +1,7 @@
 sync protocol media {
 child:
-    __delete__();
+    async __delete__();
 
 state DEAD:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/ok/multiManaged.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/multiManaged.ipdl
@@ -1,9 +1,9 @@
 include protocol multiManager1;
 include protocol multiManager2;
 
 protocol multiManaged {
     manager multiManager1 or multiManager2;
 
 child:
-    __delete__();
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/multipleUsingCxxTypes.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/multipleUsingCxxTypes.ipdl
@@ -1,7 +1,7 @@
 using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
 using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
 
 protocol multipleUsingCxxTypes {
 child:
-    Msg(void_t foo);
+    async Msg(void_t foo);
 };
--- a/ipc/ipdl/test/ipdl/ok/mutualRecStructUnion.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/mutualRecStructUnion.ipdl
@@ -11,11 +11,11 @@ union Y {
 
 struct Z {
     X x;
     Y y;
 };
 
 protocol mutualRecStructUnion {
 child:
-    Test(X x, Y y, Z z);
-    __delete__();
+    async Test(X x, Y y, Z z);
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/mutualRecUnion.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/mutualRecUnion.ipdl
@@ -10,11 +10,11 @@ union Y {
 
 union Z {
     double;
     X;
 };
 
 protocol mutualRecUnion {
 child:
-    Test(X x, Y y, Z z);
-    __delete__();
+    async Test(X x, Y y, Z z);
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/namespace_Basic.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/namespace_Basic.ipdl
@@ -1,12 +1,12 @@
 namespace basic {
 
 // sanity check of namespaced protocols
 
 protocol namespace_Basic {
 
 child:
-    Msg();
+    async Msg();
 
 };
 
 } // namespace basic
--- a/ipc/ipdl/test/ipdl/ok/noRedeclCrossMessage.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/noRedeclCrossMessage.ipdl
@@ -1,9 +1,9 @@
 protocol noRedeclCrossMessage {
 
     // each message has its own scope for param/return names
 
 child:
-    Msg1(int f);
-    Msg2(int f);
+    async Msg1(int f);
+    async Msg2(int f);
 
 };
--- a/ipc/ipdl/test/ipdl/ok/plugin.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/plugin.ipdl
@@ -1,7 +1,7 @@
 intr protocol plugin {
 child:
-    __delete__();
+    async __delete__();
 
 state DEAD:
     send __delete__;
 };
--- a/ipc/ipdl/test/ipdl/ok/race_DiamondRule1.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/race_DiamondRule1.ipdl
@@ -1,16 +1,16 @@
 protocol race_DiamondRule1 {
 
 child:
-    Msg1();
-    Msg1_();
+    async Msg1();
+    async Msg1_();
 parent:
-    Msg2();
-    Msg2_();
+    async Msg2();
+    async Msg2_();
 
     // OK: this state machine is one of the simplest that follows the
     // Diamond Rule
 
 start state S1:
     send Msg1 goto S2;
     recv Msg2 goto S3;
 
--- a/ipc/ipdl/test/ipdl/ok/race_KitchenSink.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/race_KitchenSink.ipdl
@@ -1,15 +1,15 @@
 protocol race_KitchenSink {
 child:
-    Msg1();
-    Msg1_();
+    async Msg1();
+    async Msg1_();
 parent:
-    Msg2();
-    Msg2_();
+    async Msg2();
+    async Msg2_();
 
 
     // concatenation of a few other state machines, should be OK
 
 start state S1:
     send Msg1 goto S2;
     recv Msg2 goto S3;
 
--- a/ipc/ipdl/test/ipdl/ok/race_MultiOut.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/race_MultiOut.ipdl
@@ -1,15 +1,15 @@
 protocol race_MultiOut {
 child:
-    Msg1();
-    Msg1_();
+    async Msg1();
+    async Msg1_();
 parent:
-    Msg2();
-    Msg2_();
+    async Msg2();
+    async Msg2_();
 
 start state S15:
     send Msg1 goto S16 or S17;
     recv Msg2 goto S18 or S19;
 
 state S16:
     recv Msg2 goto S20;
     recv Msg2_ goto S18;
--- a/ipc/ipdl/test/ipdl/ok/race_Stateless.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/race_Stateless.ipdl
@@ -1,16 +1,16 @@
 protocol race_Stateless {
 //    manages Child;
 
 child:
-    Msg1();
-    Msg1_();
+    async Msg1();
+    async Msg1_();
 parent:
-    Msg2();
-    Msg2_();
+    async Msg2();
+    async Msg2_();
 
 
     // OK: this is trivial stateless protocol, so race-free "by definition"
 start state S5:
     send Msg1 goto S5;
     recv Msg2 goto S5;
 };
--- a/ipc/ipdl/test/ipdl/ok/selfRecUnion.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/selfRecUnion.ipdl
@@ -1,11 +1,11 @@
 union R {
     int;
     double;
     R;
 };
 
 protocol selfRecUnion {
 child:
-    Test(R r);
-    __delete__();
+    async Test(R r);
+    async __delete__();
 };
--- a/ipc/ipdl/test/ipdl/ok/shmem.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/shmem.ipdl
@@ -1,13 +1,13 @@
 union Foo {
     int;
     Shmem;
 };
 
 intr protocol shmem {
 parent:
-    Msg(Shmem s, Foo f);
+    async Msg(Shmem s, Foo f);
     sync SyncMsg(Shmem s, Foo f)
         returns (Shmem t, Foo g);
     intr InterruptMsg(Shmem s, Foo f)
         returns (Shmem t, Foo g);
 };
--- a/ipc/ipdl/test/ipdl/ok/syncProtocol.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/syncProtocol.ipdl
@@ -1,11 +1,11 @@
 sync protocol syncProtocol {
 
     // sanity check of sync protocols
 
 child:
-    AsyncMsg();
+    async AsyncMsg();
 
 parent:
     sync SyncMsg() returns (int i);
 
 };
--- a/ipc/ipdl/test/ipdl/ok/threeDirections.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/threeDirections.ipdl
@@ -1,13 +1,13 @@
 protocol threeDirections {
 
     // sanity check that the three direction specifiers are being accepted
 child:
-    ChildMsg();
+    async ChildMsg();
 
 parent:
-    ParentMsg();
+    async ParentMsg();
 
 both:
-    BothMsg();
+    async BothMsg();
 
 };
--- a/ipc/ipdl/test/ipdl/ok/union_Namespaced.ipdl
+++ b/ipc/ipdl/test/ipdl/ok/union_Namespaced.ipdl
@@ -7,12 +7,12 @@ union Socks {
 
 } // namespace kitties
 
 
 namespace puppies {
 
 protocol union_Namespaced {
 child:
-    Msg(Socks s);
+    async Msg(Socks s);
 };
 
 } // namespace puppies
--- a/ipc/testshell/PTestShell.ipdl
+++ b/ipc/testshell/PTestShell.ipdl
@@ -11,17 +11,17 @@ namespace ipc {
 
 async protocol PTestShell
 {
   manager PContent;
 
   manages PTestShellCommand;
 
 child:
-  __delete__();
+  async __delete__();
 
-  ExecuteCommand(nsString aCommand);
+  async ExecuteCommand(nsString aCommand);
 
-  PTestShellCommand(nsString aCommand);
+  async PTestShellCommand(nsString aCommand);
 };
 
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/testshell/PTestShellCommand.ipdl
+++ b/ipc/testshell/PTestShellCommand.ipdl
@@ -8,13 +8,13 @@ include protocol PTestShell;
 namespace mozilla {
 namespace ipc {
 
 protocol PTestShellCommand
 {
   manager PTestShell;
 
 parent:
-  __delete__(nsString aResponse);
+  async __delete__(nsString aResponse);
 };
 
 } // namespace ipc
 } // namespace mozilla
--- a/js/public/GCPolicyAPI.h
+++ b/js/public/GCPolicyAPI.h
@@ -12,26 +12,28 @@
 // JSPropertyDescriptor or GCHashMap).
 //
 // The GCPolicy provides at a minimum:
 //
 //   static T initial()
 //       - Tells the GC how to construct an empty T.
 //
 //   static void trace(JSTracer, T* tp, const char* name)
-//       - Tells the GC how to traverse the edge itself or its children in the
-//         case of an aggregate.
+//       - Tells the GC how to traverse the edge. In the case of an aggregate,
+//         describe how to trace the children.
 //
 //   static bool needsSweep(T* tp)
-//       - Tells the GC how to tell if an edge is about to be finalized. For
-//         aggregates, the meaning is less clear. When the aggregate is used in
-//         a weak container, the return value will determine the semantcs of
-//         that container's weakness. This is the primary reason that GC-
-//         supporting containers can override the policy on a per-container
-//         basis.
+//       - Tells the GC how to determine if an edge is about to be finalized,
+//         and potentially updates the edge for moving GC if not. For
+//         aggregates, it determines the weakness semantics of storing the
+//         aggregate inside a weak container of some sort. For example, you
+//         might specialize a weak table's key type GCPolicy to describe
+//         when an entry should be kept during sweeping. This is the primary
+//         reason that GC-supporting weak containers can override the [sweep?]
+//         policy on a per-container basis.
 
 #ifndef GCPolicyAPI_h
 #define GCPolicyAPI_h
 
 #include "js/TraceKind.h"
 #include "js/TracingAPI.h"
 
 class JSAtom;
@@ -60,18 +62,18 @@ struct StructGCPolicy
 
     static bool needsSweep(T* tp) {
         return tp->needsSweep();
     }
 };
 
 // The default GC policy attempts to defer to methods on the underlying type.
 // Most C++ structures that contain a default constructor, a trace function and
-// a sweep function will work out of the box with Rooted, GCHash{Set,Map}, and
-// GCVector.
+// a sweep function will work out of the box with Rooted, Handle, GCVector,
+// and GCHash{Set,Map}.
 template <typename T> struct GCPolicy : public StructGCPolicy<T> {};
 
 // This policy ignores any GC interaction, e.g. for non-GC types.
 template <typename T>
 struct IgnoreGCPolicy {
     static T initial() { return T(); }
     static void trace(JSTracer* trc, T* t, const char* name) {}
     static bool needsSweep(T* v) { return false; }
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -1895,19 +1895,28 @@ BytecodeEmitter::bindNameToSlotHelper(Pa
     /*
      * Explicitly disallow accessing var/let bindings in global scope from
      * nested functions. The reason for this limitation is that, since the
      * global script is not included in the static scope chain (1. because it
      * has no object to stand in the static scope chain, 2. to minimize memory
      * bloat where a single live function keeps its whole global script
      * alive.), ScopeCoordinateToTypeSet is not able to find the var/let's
      * associated TypeSet.
+     *
+     * Note the following does not prevent us from optimizing block scopes at
+     * global level, e.g.,
+     *
+     *   { let x; function f() { x = 42; } }
      */
-    if (bceOfDef != this && bceOfDef->sc->isGlobalContext())
+    if (dn->kind() == Definition::LET || dn->kind() == Definition::CONSTANT) {
+        if (IsStaticGlobalLexicalScope(blockScopeOfDef(dn)))
+            return true;
+    } else if (bceOfDef != this && bceOfDef->sc->isGlobalContext()) {
         return true;
+    }
 
     if (!pn->pn_scopecoord.set(parser->tokenStream, hops, slot))
         return false;
 
     if (!computeDefinitionIsAliased(bceOfDef, dn, &op))
         return false;
 
     // Re-set the slot on if it is aliased, since the slot would have been
--- a/js/src/gc/Policy.h
+++ b/js/src/gc/Policy.h
@@ -10,17 +10,17 @@
 #define gc_Policy_h
 
 #include "mozilla/TypeTraits.h"
 #include "js/GCPolicyAPI.h"
 
 // Forward declare the types we're defining policies for. This file is
 // included in all places that define GC things, so the real definitions
 // will be available when we do template expansion, allowing for use of
-// static members in the underlying types. We cannot, however, user
+// static members in the underlying types. We cannot, however, use
 // static_assert to verify relations between types.
 namespace js {
 class AccessorShape;
 class ArgumentsObject;
 class ArrayBufferObject;
 class ArrayBufferObjectMaybeShared;
 class ArrayBufferViewObject;
 class ArrayObject;
--- a/js/src/gc/StoreBuffer.h
+++ b/js/src/gc/StoreBuffer.h
@@ -6,16 +6,18 @@
 
 #ifndef gc_StoreBuffer_h
 #define gc_StoreBuffer_h
 
 #include "mozilla/Attributes.h"
 #include "mozilla/DebugOnly.h"
 #include "mozilla/ReentrancyGuard.h"
 
+#include <algorithm>
+
 #include "jsalloc.h"
 
 #include "ds/LifoAlloc.h"
 #include "gc/Nursery.h"
 #include "js/MemoryMetrics.h"
 
 namespace js {
 namespace gc {
@@ -283,16 +285,45 @@ class StoreBuffer
                    start_ == other.start_ &&
                    count_ == other.count_;
         }
 
         bool operator!=(const SlotsEdge& other) const {
             return !(*this == other);
         }
 
+        // True if this SlotsEdge range overlaps with the other SlotsEdge range,
+        // false if they do not overlap.
+        bool overlaps(const SlotsEdge& other) const {
+            if (objectAndKind_ != other.objectAndKind_)
+                return false;
+
+            // Widen our range by one on each side so that we consider
+            // adjacent-but-not-actually-overlapping ranges as overlapping. This
+            // is particularly useful for coalescing a series of increasing or
+            // decreasing single index writes 0, 1, 2, ..., N into a SlotsEdge
+            // range of elements [0, N].
+            auto end = start_ + count_ + 1;
+            auto start = start_ - 1;
+
+            auto otherEnd = other.start_ + other.count_;
+            return (start <= other.start_ && other.start_ <= end) ||
+                   (start <= otherEnd && otherEnd <= end);
+        }
+
+        // Destructively make this SlotsEdge range the union of the other
+        // SlotsEdge range and this one. A precondition is that the ranges must
+        // overlap.
+        void merge(const SlotsEdge& other) {
+            MOZ_ASSERT(overlaps(other));
+            auto end = std::max(start_ + count_, other.start_ + other.count_);
+            start_ = std::min(start_, other.start_);
+            count_ = end - start_;
+        }
+
         bool maybeInRememberedSet(const Nursery& n) const {
             return !IsInsideNursery(reinterpret_cast<Cell*>(object()));
         }
 
         void trace(TenuringTracer& mover) const;
 
         explicit operator bool() const { return objectAndKind_ != 0; }
 
@@ -399,17 +430,21 @@ class StoreBuffer
     bool cancelIonCompilations() const { return cancelIonCompilations_; }
 
     /* Insert a single edge into the buffer/remembered set. */
     void putValue(JS::Value* vp) { put(bufferVal, ValueEdge(vp)); }
     void unputValue(JS::Value* vp) { unput(bufferVal, ValueEdge(vp)); }
     void putCell(Cell** cellp) { put(bufferCell, CellPtrEdge(cellp)); }
     void unputCell(Cell** cellp) { unput(bufferCell, CellPtrEdge(cellp)); }
     void putSlot(NativeObject* obj, int kind, int32_t start, int32_t count) {
-        put(bufferSlot, SlotsEdge(obj, kind, start, count));
+        SlotsEdge edge(obj, kind, start, count);
+        if (bufferSlot.last_.overlaps(edge))
+            bufferSlot.last_.merge(edge);
+        else
+            put(bufferSlot, edge);
     }
     void putWholeCell(Cell* cell) {
         MOZ_ASSERT(cell->isTenured());
         put(bufferWholeCell, WholeCellEdges(cell));
     }
 
     /* Insert an entry into the generic buffer. */
     template <typename T>
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/debug/bug-1240090.js
@@ -0,0 +1,24 @@
+gczeal(2);
+g = newGlobal();
+dbg = Debugger(g);
+dbg.onNewScript = function() function() this;
+schedulegc(10);
+g.eval("setLazyParsingDisabled(true)");
+g.evaluate("function one() {}");
+g.evaluate(`
+           function target () {}
+           function two2() {}
+           `, {});
+g.evaluate(`
+           function three1() {}
+           function three2() {}
+           function three3() {}
+           `, {});
+dbg.memory.takeCensus({
+  breakdown: {
+    by: "coarseType",
+    scripts: {
+      by: "filename"
+    }
+  }
+});
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/debug/bug1242111.js
@@ -0,0 +1,11 @@
+// |jit-test| allow-oom
+
+if (!('oomAfterAllocations' in this))
+  quit();
+
+var g = newGlobal();
+g.debuggeeGlobal = [];
+g.eval("(" + function() {
+    oomAfterAllocations(57);
+    Debugger(debuggeeGlobal).onEnterFrame = function() {}
+} + ")()");
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/gc/bug-1240503.js
@@ -0,0 +1,8 @@
+if (!('oomTest' in this))
+  quit();
+
+function arrayProtoOutOfRange() {
+    for (let [] = () => r, get;;)
+        var r = f(i % 2 ? a : b);
+}
+oomTest(arrayProtoOutOfRange);
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -2108,37 +2108,16 @@ UpdateExecutionObservabilityOfScriptsInZ
     // See note in js::ReleaseAllJITCode.
     cx->runtime()->gc.evictNursery();
 
     AutoSuppressProfilerSampling suppressProfilerSampling(cx);
 
     JSRuntime* rt = cx->runtime();
     FreeOp* fop = cx->runtime()->defaultFreeOp();
 
-    // Mark active baseline scripts in the observable set so that they don't
-    // get discarded. They will be recompiled.
-    for (JitActivationIterator actIter(rt); !actIter.done(); ++actIter) {
-        if (actIter->compartment()->zone() != zone)
-            continue;
-
-        for (JitFrameIterator iter(actIter); !iter.done(); ++iter) {
-            switch (iter.type()) {
-              case JitFrame_BaselineJS:
-                MarkBaselineScriptActiveIfObservable(iter.script(), obs);
-                break;
-              case JitFrame_IonJS:
-                MarkBaselineScriptActiveIfObservable(iter.script(), obs);
-                for (InlineFrameIterator inlineIter(rt, &iter); inlineIter.more(); ++inlineIter)
-                    MarkBaselineScriptActiveIfObservable(inlineIter.script(), obs);
-                break;
-              default:;
-            }
-        }
-    }
-
     Vector<JSScript*> scripts(cx);
 
     // Iterate through observable scripts, invalidating their Ion scripts and
     // appending them to a vector for discarding their baseline scripts later.
     {
         AutoEnterAnalysis enter(fop, zone);
         if (JSScript* script = obs.singleScriptForZoneInvalidation()) {
             if (obs.shouldRecompileOrInvalidate(script)) {
@@ -2153,16 +2132,40 @@ UpdateExecutionObservabilityOfScriptsInZ
                 {
                     if (!AppendAndInvalidateScript(cx, zone, script, scripts))
                         return false;
                 }
             }
         }
     }
 
+    // Code below this point must be infallible to ensure the active bit of
+    // BaselineScripts is in a consistent state.
+    //
+    // Mark active baseline scripts in the observable set so that they don't
+    // get discarded. They will be recompiled.
+    for (JitActivationIterator actIter(rt); !actIter.done(); ++actIter) {
+        if (actIter->compartment()->zone() != zone)
+            continue;
+
+        for (JitFrameIterator iter(actIter); !iter.done(); ++iter) {
+            switch (iter.type()) {
+              case JitFrame_BaselineJS:
+                MarkBaselineScriptActiveIfObservable(iter.script(), obs);
+                break;
+              case JitFrame_IonJS:
+                MarkBaselineScriptActiveIfObservable(iter.script(), obs);
+                for (InlineFrameIterator inlineIter(rt, &iter); inlineIter.more(); ++inlineIter)
+                    MarkBaselineScriptActiveIfObservable(inlineIter.script(), obs);
+                break;
+              default:;
+            }
+        }
+    }
+
     // Iterate through the scripts again and finish discarding
     // BaselineScripts. This must be done as a separate phase as we can only
     // discard the BaselineScript on scripts that have no IonScript.
     for (size_t i = 0; i < scripts.length(); i++) {
         MOZ_ASSERT_IF(scripts[i]->isDebuggee(), observing);
         FinishDiscardBaselineScript(fop, scripts[i]);
     }
 
--- a/js/src/vm/ScopeObject.cpp
+++ b/js/src/vm/ScopeObject.cpp
@@ -1434,25 +1434,38 @@ ScopeIter::incrementStaticScopeIter()
 void
 ScopeIter::settle()
 {
     // Check for trying to iterate a function frame before the prologue has
     // created the CallObject, in which case we have to skip.
     if (frame_ && frame_.isFunctionFrame() && frame_.callee()->needsCallObject() &&
         !frame_.hasCallObj())
     {
+        // At the very start of a script that starts with a lexical block, the
+        // static scope will be that block. Skip it if this is the case.
+        if (ssi_.type() == StaticScopeIter<CanGC>::Block)
+            incrementStaticScopeIter();
+
+        // We should now be at the function scope, so since we have no
+        // CallObject, skip that too.
         MOZ_ASSERT(ssi_.type() == StaticScopeIter<CanGC>::Function);
         incrementStaticScopeIter();
     }
 
     // Check for trying to iterate a strict eval frame before the prologue has
     // created the CallObject.
     if (frame_ && frame_.isStrictEvalFrame() && !frame_.hasCallObj() && !ssi_.done()) {
+        // Eval frames always have their own lexical scope. Analogous to the
+        // function frame case above, if the script starts with a lexical
+        // block, the SSI could see 2 block scopes here. So skip between 1-2
+        // static block scopes here.
         MOZ_ASSERT(ssi_.type() == StaticScopeIter<CanGC>::Block);
         incrementStaticScopeIter();
+        if (ssi_.type() == StaticScopeIter<CanGC>::Block)
+            incrementStaticScopeIter();
         MOZ_ASSERT(ssi_.type() == StaticScopeIter<CanGC>::Eval);
         MOZ_ASSERT(maybeStaticScope() == frame_.script()->enclosingStaticScope());
         incrementStaticScopeIter();
         frame_ = NullFramePtr();
     }
 
     // Check if we have left the extent of the initial frame after we've
     // settled on a static scope.
--- a/js/src/vm/UbiNodeCensus.cpp
+++ b/js/src/vm/UbiNodeCensus.cpp
@@ -275,48 +275,54 @@ static int compareEntries(const void* lh
     if (lhs > rhs)
         return -1;
     return 0;
 }
 
 // A hash map mapping from C strings to counts.
 using CStringCountMap = HashMap<const char*, CountBasePtr, CStringHasher, SystemAllocPolicy>;
 
-// Convert a CStringCountMap into an object with each key one of the c strings
-// from the map and each value the associated count's report. For use with
+// Convert a HashMap into an object with each key one of the entries from the
+// map and each value the associated count's report. For use during census
 // reporting.
+//
+// `Map` must be a `HashMap` from some key type to a `CountBasePtr`.
+//
+// `GetName` must be a callable type which takes `const Map::Key&` and returns
+// `const char*`.
+template <class Map, class GetName>
 static PlainObject*
-cStringCountMapToObject(JSContext* cx, CStringCountMap& map) {
+countMapToObject(JSContext* cx, Map& map, GetName getName) {
     // Build a vector of pointers to entries; sort by total; and then use
     // that to build the result object. This makes the ordering of entries
     // more interesting, and a little less non-deterministic.
 
-    mozilla::Vector<CStringCountMap::Entry*> entries;
+    mozilla::Vector<typename Map::Entry*> entries;
     if (!entries.reserve(map.count())) {
         ReportOutOfMemory(cx);
         return nullptr;
     }
 
     for (auto r = map.all(); !r.empty(); r.popFront())
         entries.infallibleAppend(&r.front());
 
     qsort(entries.begin(), entries.length(), sizeof(*entries.begin()),
-          compareEntries<CStringCountMap::Entry>);
+          compareEntries<typename Map::Entry>);
 
     RootedPlainObject obj(cx, NewBuiltinClassInstance<PlainObject>(cx));
     if (!obj)
         return nullptr;
 
     for (auto& entry : entries) {
         CountBasePtr& thenCount = entry->value();
         RootedValue thenReport(cx);
         if (!thenCount->report(cx, &thenReport))
             return nullptr;
 
-        const char* name = entry->key();
+        const char* name = getName(entry->key());
         MOZ_ASSERT(name);
         JSAtom* atom = Atomize(cx, name, strlen(name));
         if (!atom)
             return nullptr;
 
         RootedId entryId(cx, AtomToId(atom));
         if (!DefineProperty(cx, obj, entryId, thenReport))
             return nullptr;
@@ -412,17 +418,19 @@ ByObjectClass::count(CountBase& countBas
     return p->value()->count(mallocSizeOf, node);
 }
 
 bool
 ByObjectClass::report(JSContext* cx, CountBase& countBase, MutableHandleValue report)
 {
     Count& count = static_cast<Count&>(countBase);
 
-    RootedPlainObject obj(cx, cStringCountMapToObject(cx, count.table));
+    RootedPlainObject obj(cx, countMapToObject(cx, count.table, [](const char* key) {
+        return key;
+    }));
     if (!obj)
         return false;
 
     RootedValue otherReport(cx);
     if (!count.other->report(cx, &otherReport) ||
         !DefineProperty(cx, obj, cx->names().other, otherReport))
         return false;
 
@@ -721,20 +729,35 @@ ByAllocationStack::report(JSContext* cx,
     MOZ_ASSERT(generation == count.table.generation());
 
     report.setObject(*map);
     return true;
 }
 
 // A count type that categorizes nodes by their script's filename.
 class ByFilename : public CountType {
+    using UniqueCString = UniquePtr<char, JS::FreePolicy>;
+
+    struct UniqueCStringHasher {
+        using Lookup = UniqueCString;
+
+        static js::HashNumber hash(const Lookup& lookup) {
+            return CStringHasher::hash(lookup.get());
+        }
+
+        static bool match(const UniqueCString& key, const Lookup& lookup) {
+            return CStringHasher::match(key.get(), lookup.get());
+        }
+    };
+
     // A table mapping filenames to their counts. Note that we treat scripts
     // with the same filename as equivalent. If you have several sources with
     // the same filename, then all their scripts will get bucketed together.
-    using Table = CStringCountMap;
+    using Table = HashMap<UniqueCString, CountBasePtr, UniqueCStringHasher,
+                          SystemAllocPolicy>;
     using Entry = Table::Entry;
 
     struct Count : public CountBase {
         Table table;
         CountBasePtr then;
         CountBasePtr noFilename;
 
         Count(CountType& type, CountBasePtr&& then, CountBasePtr&& noFilename)
@@ -799,31 +822,37 @@ ByFilename::count(CountBase& countBase, 
 {
     Count& count = static_cast<Count&>(countBase);
     count.total_++;
 
     const char* filename = node.scriptFilename();
     if (!filename)
         return count.noFilename->count(mallocSizeOf, node);
 
-    Table::AddPtr p = count.table.lookupForAdd(filename);
+    UniqueCString myFilename(js_strdup(filename));
+    if (!myFilename)
+        return false;
+
+    Table::AddPtr p = count.table.lookupForAdd(myFilename);
     if (!p) {
         CountBasePtr thenCount(thenType->makeCount());
-        if (!thenCount || !count.table.add(p, filename, Move(thenCount)))
+        if (!thenCount || !count.table.add(p, Move(myFilename), Move(thenCount)))
             return false;
     }
     return p->value()->count(mallocSizeOf, node);
 }
 
 bool
 ByFilename::report(JSContext* cx, CountBase& countBase, MutableHandleValue report)
 {
     Count& count = static_cast<Count&>(countBase);
 
-    RootedPlainObject obj(cx, cStringCountMapToObject(cx, count.table));
+    RootedPlainObject obj(cx, countMapToObject(cx, count.table, [](const UniqueCString& key) {
+        return key.get();
+    }));
     if (!obj)
         return false;
 
     RootedValue noFilenameReport(cx);
     if (!count.noFilename->report(cx, &noFilenameReport) ||
         !DefineProperty(cx, obj, cx->names().noFilename, noFilenameReport))
     {
         return false;
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -66,17 +66,17 @@ static const char kJSCachePrefix[] = "js
 /**
  * Buffer sizes for serialization and deserialization of scripts.
  * FIXME: bug #411579 (tune this macro!) Last updated: Jan 2008
  */
 #define XPC_SERIALIZATION_BUFFER_SIZE   (64 * 1024)
 #define XPC_DESERIALIZATION_BUFFER_SIZE (12 * 8192)
 
 // NSPR_LOG_MODULES=JSComponentLoader:5
-static PRLogModuleInfo* gJSCLLog;
+static LazyLogModule gJSCLLog("JSComponentLoader");
 
 #define LOG(args) MOZ_LOG(gJSCLLog, mozilla::LogLevel::Debug, args)
 
 // Components.utils.import error messages
 #define ERROR_SCOPE_OBJ "%s - Second argument must be an object."
 #define ERROR_NOT_PRESENT "%s - EXPORTED_SYMBOLS is not present."
 #define ERROR_NOT_AN_ARRAY "%s - EXPORTED_SYMBOLS is not an array."
 #define ERROR_GETTING_ARRAY_LENGTH "%s - Error getting array length of EXPORTED_SYMBOLS."
@@ -193,20 +193,16 @@ mozJSComponentLoader::mozJSComponentLoad
     : mModules(16),
       mImports(16),
       mInProgressImports(16),
       mInitialized(false),
       mReuseLoaderGlobal(false)
 {
     MOZ_ASSERT(!sSelf, "mozJSComponentLoader should be a singleton");
 
-    if (!gJSCLLog) {
-        gJSCLLog = PR_NewLogModule("JSComponentLoader");
-    }
-
     sSelf = this;
 }
 
 #define ENSURE_DEP(name) { nsresult rv = Ensure##name(); NS_ENSURE_SUCCESS(rv, rv); }
 #define ENSURE_DEPS(...) MOZ_FOR_EACH(ENSURE_DEP, (), (__VA_ARGS__));
 #define BEGIN_ENSURE(self, ...) { \
     if (m##self) \
         return NS_OK; \
--- a/js/xpconnect/src/XPCLog.cpp
+++ b/js/xpconnect/src/XPCLog.cpp
@@ -20,40 +20,37 @@
 #define LINE_LEN        200
 #define INDENT_FACTOR   2
 
 #define CAN_RUN (g_InitState == 1 || (g_InitState == 0 && Init()))
 
 static char*    g_Spaces;
 static int      g_InitState = 0;
 static int      g_Indent = 0;
-static PRLogModuleInfo* g_LogMod = nullptr;
+static mozilla::LazyLogModule g_LogMod("xpclog");
 
 static bool Init()
 {
-    g_LogMod = PR_NewLogModule("xpclog");
     g_Spaces = new char[SPACE_COUNT+1];
-    if (!g_LogMod || !g_Spaces || !MOZ_LOG_TEST(g_LogMod,LogLevel::Error)) {
+    if (!g_Spaces || !MOZ_LOG_TEST(g_LogMod,LogLevel::Error)) {
         g_InitState = 1;
         XPC_Log_Finish();
         return false;
     }
     memset(g_Spaces, ' ', SPACE_COUNT);
     g_Spaces[SPACE_COUNT] = 0;
     g_InitState = 1;
     return true;
 }
 
 void
 XPC_Log_Finish()
 {
     if (g_InitState == 1) {
         delete [] g_Spaces;
-        // we'd like to properly cleanup the LogModule, but nspr owns that
-        g_LogMod = nullptr;
     }
     g_InitState = -1;
 }
 
 void
 XPC_Log_print(const char* fmt, ...)
 {
     va_list ap;
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -197,17 +197,17 @@ xpc::ErrorReport::Init(JSErrorReport* aR
     mSourceLine = static_cast<const char16_t*>(aReport->uclinebuf);
 
     mLineNumber = aReport->lineno;
     mColumn = aReport->column;
     mFlags = aReport->flags;
     mIsMuted = aReport->isMuted;
 }
 
-static PRLogModuleInfo* gJSDiagnostics;
+static LazyLogModule gJSDiagnostics("JSDiagnostics");
 
 void
 xpc::ErrorReport::LogToConsole()
 {
   LogToConsoleWithStack(nullptr);
 }
 void
 xpc::ErrorReport::LogToConsoleWithStack(JS::HandleObject aStack)
@@ -227,25 +227,20 @@ xpc::ErrorReport::LogToConsoleWithStack(
         error.AppendInt(mLineNumber, 10);
         error.AppendLiteral(": ");
         error.Append(NS_LossyConvertUTF16toASCII(mErrorMsg));
 
         fprintf(stderr, "%s\n", error.get());
         fflush(stderr);
     }
 
-    // Log to the PR Log Module.
-    if (!gJSDiagnostics)
-        gJSDiagnostics = PR_NewLogModule("JSDiagnostics");
-    if (gJSDiagnostics) {
-        MOZ_LOG(gJSDiagnostics,
-                JSREPORT_IS_WARNING(mFlags) ? LogLevel::Warning : LogLevel::Error,
-                ("file %s, line %u\n%s", NS_LossyConvertUTF16toASCII(mFileName).get(),
-                 mLineNumber, NS_LossyConvertUTF16toASCII(mErrorMsg).get()));
-    }
+    MOZ_LOG(gJSDiagnostics,
+            JSREPORT_IS_WARNING(mFlags) ? LogLevel::Warning : LogLevel::Error,
+            ("file %s, line %u\n%s", NS_LossyConvertUTF16toASCII(mFileName).get(),
+             mLineNumber, NS_LossyConvertUTF16toASCII(mErrorMsg).get()));
 
     // Log to the console. We do this last so that we can simply return if
     // there's no console service without affecting the other reporting
     // mechanisms.
     nsCOMPtr<nsIConsoleService> consoleService =
       do_GetService(NS_CONSOLESERVICE_CONTRACTID);
 
     nsCOMPtr<nsIScriptError> errorObject;
--- a/layout/inspector/tests/test_bug877690.html
+++ b/layout/inspector/tests/test_bug877690.html
@@ -35,19 +35,23 @@ function testValues(values, expected) {
   });
   return values.length === 0;
 }
 
 function do_test() {
   var utils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]
     .getService(SpecialPowers.Ci.inIDOMUtils);
 
+  var getCSSValuesForProperty = function(prop) {
+    return Array.from(utils.getCSSValuesForProperty(prop));
+  }
+
   // test a property with keywords and colors
   var prop = "color";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure",
       "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood",
       "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "currentColor",
       "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey",
       "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred",
       "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey",
       "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue",
       "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold",
@@ -63,17 +67,17 @@ function do_test() {
       "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen",
       "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen",
       "steelblue", "tan", "teal", "thistle", "tomato", "transparent", "turquoise", "violet", "wheat",
       "white", "whitesmoke", "yellow", "yellowgreen", "rgb", "hsl", "rgba", "hsla" ];
   ok(testValues(values, expected), "property color's values.");
 
   // test a shorthand property
   var prop = "background";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure",
       "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue",
       "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "currentColor", "cyan", "darkblue",
       "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta",
       "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue",
       "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray",
       "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite",
       "gold", "goldenrod", "gray", "grey", "green", "greenyellow", "honeydew", "hotpink", "indianred",
@@ -92,17 +96,17 @@ function do_test() {
       "repeat-x", "repeat-y", "fixed", "scroll", "local", "center", "top", "bottom", "left", "right",
       "border-box", "padding-box", "content-box", "border-box", "padding-box", "content-box", "contain",
       "cover", "rgb", "hsl", "rgba", "hsla", "none", "-moz-element", "-moz-image-rect", "url", "linear-gradient",
       "radial-gradient", "repeating-linear-gradient", "repeating-radial-gradient", "-moz-linear-gradient",
       "-moz-radial-gradient", "-moz-repeating-linear-gradient", "-moz-repeating-radial-gradient" ];
   ok(testValues(values, expected), "Shorthand property values.");
 
   var prop = "border";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "-moz-calc", "initial", "unset", "-moz-use-text-color", "aliceblue",
       "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet",
       "brown", "burlywood", "cadetblue", "calc", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk",
       "crimson", "currentColor", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki",
       "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
       "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "dashed", "deeppink",
       "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "dotted", "double", "fill", "firebrick", "floralwhite",
       "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow",
@@ -121,17 +125,17 @@ function do_test() {
       "transparent", "turquoise", "-moz-element", "-moz-image-rect", "url", "violet", "wheat", "white", "whitesmoke",
       "yellow", "yellowgreen", "linear-gradient", "radial-gradient", "repeating-linear-gradient",
       "repeating-radial-gradient", "-moz-linear-gradient", "-moz-radial-gradient", "-moz-repeating-linear-gradient",
       "-moz-repeating-radial-gradient" ]
   ok(testValues(values, expected), "Shorthand property values.");
 
   // test keywords only
   var prop = "border-top";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "thin", "medium", "thick", "none", "hidden", "dotted",
       "dashed", "solid", "double", "groove", "ridge", "inset", "outset", "-moz-use-text-color",
       "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black",
       "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse",
       "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "currentColor", "cyan", "darkblue", "darkcyan",
       "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen",
       "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray",
       "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey",
@@ -148,71 +152,71 @@ function do_test() {
       "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen",
       "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen",
       "steelblue", "tan", "teal", "thistle", "tomato", "transparent", "turquoise", "violet", "wheat", "white",
       "whitesmoke", "yellow", "yellowgreen", "calc", "-moz-calc", "rgb", "hsl", "rgba", "hsla" ];
   ok(testValues(values, expected), "property border-top's values.");
 
   // tests no keywords or colors
   var prop = "padding-bottom";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "calc", "-moz-calc" ];
   ok(testValues(values, expected), "property padding-bottom's values.");
 
   // test proprety
   var prop = "display";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "none", "inline", "block", "inline-block", "list-item",
       "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row",
       "table-column-group", "table-column", "table-cell", "table-caption", "-moz-box", "-moz-inline-box",
       "-moz-grid", "-moz-inline-grid", "-moz-grid-group", "-moz-grid-line", "-moz-stack", "-moz-inline-stack",
       "-moz-deck", "-moz-popup", "-moz-groupbox", "flex", "inline-flex", "grid",
       "inline-grid", "ruby", "ruby-base", "ruby-base-container", "ruby-text",
       "ruby-text-container", "contents" ];
   ok(testValues(values, expected), "property display's values.");
 
   // test property
   var prop = "float";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "none", "left", "right", "inline-start", "inline-end" ];
   ok(testValues(values, expected), "property float's values.");
 
   // Test property with "auto"
   var prop = "margin";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "-moz-calc", "initial", "unset", "auto", "calc", "inherit" ];
   ok(testValues(values, expected), "property margin's values.");
 
   // Test property with "normal"
   var prop = "font-style";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "inherit", "unset", "italic", "normal", "oblique" ];
   ok(testValues(values, expected), "property font-style's values.");
 
   // Test property with "cubic-bezier" and "step".
   var prop = "-moz-transition";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "initial", "all", "unset", "cubic-bezier", "ease", "ease-in", "ease-in-out",
                    "ease-out", "inherit", "linear", "none", "step-end", "step-start",
                    "steps" ];
   ok(testValues(values, expected), "property -moz-transition's values.");
 
   // test invalid property
   var prop = "invalidProperty";
   try {
-    utils.getCSSValuesForProperty(prop);
+    getCSSValuesForProperty(prop);
     ok(false, "invalid property should throw an exception");
   }
   catch(e) {
     // test passed
   }
 
   // test border-image propery, for bug 973345
   var prop = "border-image";
-  var values = utils.getCSSValuesForProperty(prop);
+  var values = getCSSValuesForProperty(prop);
   var expected = [ "-moz-calc", "initial", "unset", "-moz-use-text-color", "aliceblue",
       "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet",
       "brown", "burlywood", "cadetblue", "calc", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk",
       "crimson", "currentColor", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki",
       "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen",
       "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "dashed", "deeppink",
       "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "dotted", "double", "fill", "firebrick", "floralwhite",
       "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "grey", "green", "greenyellow",
--- a/layout/style/Loader.h
+++ b/layout/style/Loader.h
@@ -436,21 +436,16 @@ public:
 
   // Marks all the sheets at the given URI obsolete, and removes them from the
   // cache.
   nsresult ObsoleteSheet(nsIURI* aURI);
 
 private:
   friend class SheetLoadData;
 
-  static PLDHashOperator
-  RemoveEntriesWithURI(URIPrincipalReferrerPolicyAndCORSModeHashKey* aKey,
-                       RefPtr<CSSStyleSheet>& aSheet,
-                       void* aUserData);
-
   // Note: null aSourcePrincipal indicates that the content policy and
   // CheckLoadURI checks should be skipped.
   // aIsPreload indicates whether the html parser preloads that
   // stylesheet or if it is a regular load.
   nsresult CheckLoadAllowed(nsIPrincipal* aSourcePrincipal,
                             nsIURI* aTargetURI,
                             nsISupports* aContext,
                             bool aIsPreload);
--- a/media/mtransport/nricectx.cpp
+++ b/media/mtransport/nricectx.cpp
@@ -383,17 +383,16 @@ RefPtr<NrIceCtx> NrIceCtx::Create(const 
                                   bool allow_link_local,
                                   bool hide_non_default,
                                   Policy policy) {
    RefPtr<NrIceCtx> ctx = new NrIceCtx(name, offerer, policy);
 
   // Initialize the crypto callbacks and logging stuff
   if (!initialized) {
     NR_reg_init(NR_REG_MODE_LOCAL);
-    RLogRingBuffer::CreateInstance();
     nr_crypto_vtbl = &nr_ice_crypto_nss_vtbl;
     initialized = true;
 
     // Set the priorites for candidate type preferences.
     // These numbers come from RFC 5245 S. 4.1.2.2
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_SRV_RFLX, 100);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_PEER_RFLX, 110);
     NR_reg_set_uchar((char *)NR_ICE_REG_PREF_TYPE_HOST, 126);
--- a/media/mtransport/rlogringbuffer.cpp
+++ b/media/mtransport/rlogringbuffer.cpp
@@ -16,16 +16,17 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/Move.h" // Pinch hitting for <utility> and std::move
 #include "mozilla/Mutex.h"
 #include <vector>
 
 extern "C" {
 #include <csi_platform.h>
 #include "r_log.h"
+#include "registry.h"
 }
 
 /* Matches r_dest_vlog type defined in r_log.h */
 static int ringbuffer_vlog(int facility,
                            int level,
                            const char *format,
                            va_list ap) {
   MOZ_ASSERT(mozilla::RLogRingBuffer::GetInstance());
@@ -39,60 +40,91 @@ static int ringbuffer_vlog(int facility,
 }
 
 namespace mozilla {
 
 RLogRingBuffer* RLogRingBuffer::instance;
 
 RLogRingBuffer::RLogRingBuffer()
   : log_limit_(4096),
-    mutex_("RLogRingBuffer::mutex_") {
+    mutex_("RLogRingBuffer::mutex_"),
+    disableCount_(0) {
 }
 
 RLogRingBuffer::~RLogRingBuffer() {
 }
 
 void RLogRingBuffer::SetLogLimit(uint32_t new_limit) {
   OffTheBooksMutexAutoLock lock(mutex_);
   log_limit_ = new_limit;
   RemoveOld();
 }
 
 void RLogRingBuffer::Log(std::string&& log) {
   OffTheBooksMutexAutoLock lock(mutex_);
-  log_messages_.push_front(Move(log));
+  if (disableCount_ == 0) {
+    AddMsg(Move(log));
+  }
+}
+
+void RLogRingBuffer::AddMsg(std::string&& msg) {
+  log_messages_.push_front(Move(msg));
   RemoveOld();
 }
 
 inline void RLogRingBuffer::RemoveOld() {
   if (log_messages_.size() > log_limit_) {
     log_messages_.resize(log_limit_);
   }
 }
 
-
 RLogRingBuffer* RLogRingBuffer::CreateInstance() {
   if (!instance) {
     instance = new RLogRingBuffer;
+    NR_reg_init(NR_REG_MODE_LOCAL);
     r_log_set_extra_destination(LOG_INFO, &ringbuffer_vlog);
   }
   return instance;
 }
 
 RLogRingBuffer* RLogRingBuffer::GetInstance() {
   return instance;
 }
 
 void RLogRingBuffer::DestroyInstance() {
   // First param is ignored when passing null
   r_log_set_extra_destination(LOG_INFO, nullptr);
   delete instance;
   instance = nullptr;
 }
 
+// As long as at least one PeerConnection exists in a Private Window rlog messages will not
+// be saved in the RLogRingBuffer. This is necessary because the log_messages buffer
+// is shared across all instances of PeerConnectionImpls. There is no way with the current
+// structure of r_log to run separate logs.
+
+void RLogRingBuffer::EnterPrivateMode() {
+  OffTheBooksMutexAutoLock lock(mutex_);
+  ++disableCount_;
+  MOZ_ASSERT(disableCount_ != 0);
+
+  if (disableCount_ == 1) {
+    AddMsg("LOGGING SUSPENDED: a connection is active in a Private Window ***");
+  }
+}
+
+void RLogRingBuffer::ExitPrivateMode() {
+  OffTheBooksMutexAutoLock lock(mutex_);
+  MOZ_ASSERT(disableCount_ != 0);
+
+  if (--disableCount_ == 0) {
+    AddMsg("LOGGING RESUMED: no connections are active in a Private Window ***");
+  }
+}
+
 void RLogRingBuffer::Clear() {
   OffTheBooksMutexAutoLock lock(mutex_);
   log_messages_.clear();
 }
 
 void RLogRingBuffer::Filter(const std::string& substring,
                             uint32_t limit,
                             std::deque<std::string>* matching_logs) {
--- a/media/mtransport/rlogringbuffer.h
+++ b/media/mtransport/rlogringbuffer.h
@@ -93,30 +93,37 @@ class RLogRingBuffer {
                        std::deque<std::string>* matching_logs) {
       Filter("", limit, matching_logs);
     }
 
     void SetLogLimit(uint32_t new_limit);
     void Log(std::string&& log);
     void Clear();
 
+    // Methods to signal when a PeerConnection exists in a Private Window.
+    void EnterPrivateMode();
+    void ExitPrivateMode();
+
   private:
     RLogRingBuffer();
     ~RLogRingBuffer();
     void RemoveOld();
+    void AddMsg(std::string&& msg);
+
     static RLogRingBuffer* instance;
 
     /*
      * Might be worthwhile making this a circular buffer, but I think it is
      * preferable to take up as little space as possible if no logging is
      * happening/the ringbuffer is not being used.
     */
     std::deque<std::string> log_messages_;
     /* Max size of log buffer (should we use time-depth instead/also?) */
     uint32_t log_limit_;
     OffTheBooksMutex mutex_;
+    uint32_t disableCount_;
 
     DISALLOW_COPY_ASSIGN(RLogRingBuffer);
 }; // class RLogRingBuffer
 
 } // namespace mozilla
 
 #endif // rlogringbuffer_h__
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -85,19 +85,20 @@ WebrtcVideoConduit::WebrtcVideoConduit()
   mSendingHeight(0),
   mReceivingWidth(640),
   mReceivingHeight(480),
   mSendingFramerate(DEFAULT_VIDEO_MAX_FRAMERATE),
   mLastFramerateTenths(DEFAULT_VIDEO_MAX_FRAMERATE*10),
   mNumReceivingStreams(1),
   mVideoLatencyTestEnable(false),
   mVideoLatencyAvg(0),
-  mMinBitrate(200),
-  mStartBitrate(300),
-  mMaxBitrate(2000),
+  mMinBitrate(0),
+  mStartBitrate(0),
+  mMaxBitrate(0),
+  mMinBitrateEstimate(0),
   mCodecMode(webrtc::kRealtimeVideo)
 {}
 
 WebrtcVideoConduit::~WebrtcVideoConduit()
 {
   NS_ASSERTION(NS_IsMainThread(), "Only call on main thread");
   CSFLogDebug(logTag,  "%s ", __FUNCTION__);
 
@@ -281,16 +282,29 @@ WebrtcVideoConduit::InitMain()
       (void) NS_WARN_IF(NS_FAILED(branch->GetIntPref("media.peerconnection.video.start_bitrate", &temp)));
       if (temp >= 0) {
         mStartBitrate = temp;
       }
       (void) NS_WARN_IF(NS_FAILED(branch->GetIntPref("media.peerconnection.video.max_bitrate", &temp)));
       if (temp >= 0) {
         mMaxBitrate = temp;
       }
+      if (mMinBitrate != 0 && mMinBitrate < webrtc::kViEMinCodecBitrate) {
+        mMinBitrate = webrtc::kViEMinCodecBitrate;
+      }
+      if (mStartBitrate < mMinBitrate) {
+        mStartBitrate = mMinBitrate;
+      }
+      if (mStartBitrate > mMaxBitrate) {
+        mStartBitrate = mMaxBitrate;
+      }
+      (void) NS_WARN_IF(NS_FAILED(branch->GetIntPref("media.peerconnection.video.min_bitrate_estimate", &temp)));
+      if (temp >= 0) {
+        mMinBitrateEstimate = temp;
+      }
       bool use_loadmanager = false;
       (void) NS_WARN_IF(NS_FAILED(branch->GetBoolPref("media.navigator.load_adapt", &use_loadmanager)));
       if (use_loadmanager) {
         mLoadManager = LoadManagerBuild();
       }
     }
   }
 
@@ -707,16 +721,25 @@ WebrtcVideoConduit::ConfigureSendMediaCo
       CSFLogError(logTag, "%s Invalid Send Codec", __FUNCTION__);
       return kMediaConduitInvalidSendCodec;
     }
     CSFLogError(logTag, "%s SetSendCodec Failed %d ", __FUNCTION__,
                 mPtrViEBase->LastError());
     return kMediaConduitUnknownError;
   }
 
+  if (mMinBitrateEstimate != 0) {
+    mPtrViENetwork->SetBitrateConfig(mChannel,
+                                     mMinBitrateEstimate,
+                                     std::max(video_codec.startBitrate,
+                                              mMinBitrateEstimate),
+                                     std::max(video_codec.maxBitrate,
+                                              mMinBitrateEstimate));
+  }
+
   if (!mVideoCodecStat) {
     mVideoCodecStat = new VideoCodecStatistics(mChannel, mPtrViECodec);
   }
   mVideoCodecStat->Register(true);
 
   mSendingWidth = 0;
   mSendingHeight = 0;
   mSendingFramerate = video_codec.maxFramerate;
@@ -956,76 +979,95 @@ WebrtcVideoConduit::ConfigureRecvMediaCo
   mPtrRTP->SetRembStatus(mChannel, false, true);
   DumpCodecDB();
   return kMediaConduitNoError;
 }
 
 struct ResolutionAndBitrateLimits {
   uint32_t resolution_in_mb;
   uint16_t min_bitrate;
+  uint16_t start_bitrate;
   uint16_t max_bitrate;
 };
 
 #define MB_OF(w,h) ((unsigned int)((((w)>>4))*((unsigned int)((h)>>4))))
 
 // For now, try to set the max rates well above the knee in the curve.
 // Chosen somewhat arbitrarily; it's hard to find good data oriented for
 // realtime interactive/talking-head recording.  These rates assume
 // 30fps.
 
 // XXX Populate this based on a pref (which we should consider sorting because
 // people won't assume they need to).
 static ResolutionAndBitrateLimits kResolutionAndBitrateLimits[] = {
-  {MB_OF(1920, 1200), 1500, 10000}, // >HD (3K, 4K, etc)
-  {MB_OF(1280, 720), 1200, 5000}, // HD ~1080-1200
-  {MB_OF(800, 480), 600, 2500}, // HD ~720
-  {std::max(MB_OF(400, 240), MB_OF(352, 288)), 200, 1300}, // VGA, WVGA
-  {MB_OF(176, 144), 100, 500}, // WQVGA, CIF
-  {0 , 40, 250} // QCIF and below
+  {MB_OF(1920, 1200), 1500, 2000, 10000}, // >HD (3K, 4K, etc)
+  {MB_OF(1280, 720), 1200, 1500, 5000}, // HD ~1080-1200
+  {MB_OF(800, 480), 600, 800, 2500}, // HD ~720
+  {std::max(MB_OF(400, 240), MB_OF(352, 288)), 200, 300, 1300}, // VGA, WVGA
+  {MB_OF(176, 144), 100, 150, 500}, // WQVGA, CIF
+  {0 , 40, 80, 250} // QCIF and below
 };
 
-static void
-SelectBandwidth(webrtc::VideoCodec& vie_codec,
-                unsigned short width,
-                unsigned short height,
-                mozilla::Atomic<int32_t, mozilla::Relaxed>& aLastFramerateTenths)
+void
+WebrtcVideoConduit::SelectBandwidth(webrtc::VideoCodec& vie_codec,
+                                    unsigned short width,
+                                    unsigned short height,
+                                    mozilla::Atomic<int32_t, mozilla::Relaxed>& aLastFramerateTenths)
 {
   // max bandwidth should be proportional (not linearly!) to resolution, and
   // proportional (perhaps linearly, or close) to current frame rate.
   unsigned int fs, mb_width, mb_height;
 
   mb_width = (width + 15) >> 4;
   mb_height = (height + 15) >> 4;
   fs = mb_width * mb_height;
 
   for (ResolutionAndBitrateLimits resAndLimits : kResolutionAndBitrateLimits) {
     if (fs > resAndLimits.resolution_in_mb) {
       vie_codec.minBitrate = resAndLimits.min_bitrate;
+      vie_codec.startBitrate = resAndLimits.start_bitrate;
       vie_codec.maxBitrate = resAndLimits.max_bitrate;
       break;
     }
   }
 
   // mLastFramerateTenths is an atomic, and scaled by *10
   double framerate = std::min((aLastFramerateTenths/10.),60.0);
   MOZ_ASSERT(framerate > 0);
   // Now linear reduction/increase based on fps (max 60fps i.e. doubling)
   if (framerate >= 10) {
     vie_codec.minBitrate = vie_codec.minBitrate * (framerate/30);
+    vie_codec.startBitrate = vie_codec.startBitrate * (framerate/30);
     vie_codec.maxBitrate = vie_codec.maxBitrate * (framerate/30);
   } else {
     // At low framerates, don't reduce bandwidth as much - cut slope to 1/2.
     // Mostly this would be ultra-low-light situations/mobile or screensharing.
     vie_codec.minBitrate = vie_codec.minBitrate * ((10-(framerate/2))/30);
+    vie_codec.startBitrate = vie_codec.startBitrate * ((10-(framerate/2))/30);
     vie_codec.maxBitrate = vie_codec.maxBitrate * ((10-(framerate/2))/30);
   }
 
+  if (mMinBitrate && mMinBitrate > vie_codec.minBitrate) {
+    vie_codec.minBitrate = mMinBitrate;
+  }
   // If we try to set a minimum bitrate that is too low, ViE will reject it.
   vie_codec.minBitrate = std::max((unsigned int) webrtc::kViEMinCodecBitrate,
                                   vie_codec.minBitrate);
+  if (mStartBitrate && mStartBitrate > vie_codec.startBitrate) {
+    vie_codec.startBitrate = mStartBitrate;
+  }
+  vie_codec.startBitrate = std::max(vie_codec.startBitrate, vie_codec.minBitrate);
+
+  // Note: mMaxBitrate is the max transport bitrate - it applies to a
+  // single codec encoding, but should also apply to the sum of all
+  // simulcast layers in this encoding!
+  // So sum(layers.maxBitrate) <= mMaxBitrate
+  if (mMaxBitrate && mMaxBitrate > vie_codec.maxBitrate) {
+    vie_codec.maxBitrate = mMaxBitrate;
+  }
 }
 
 static void ConstrainPreservingAspectRatioExact(uint32_t max_fs,
                                                 unsigned short* width,
                                                 unsigned short* height)
 {
   unsigned int mb_width = (*width + 15) >> 4;
   unsigned int mb_height = (*height + 15) >> 4;
@@ -1280,16 +1322,25 @@ WebrtcVideoConduit::ReconfigureSendCodec
     }
 
     if ((err = mPtrViECodec->SetSendCodec(mChannel, vie_codec)) != 0)
     {
       CSFLogError(logTag, "%s: SetSendCodec(%ux%u) failed, err %d",
                   __FUNCTION__, width, height, err);
       return NS_ERROR_FAILURE;
     }
+    if (mMinBitrateEstimate != 0) {
+      mPtrViENetwork->SetBitrateConfig(mChannel,
+                                       mMinBitrateEstimate,
+                                       std::max(vie_codec.startBitrate,
+                                                mMinBitrateEstimate),
+                                       std::max(vie_codec.maxBitrate,
+                                                mMinBitrateEstimate));
+    }
+
     CSFLogDebug(logTag, "%s: Encoder resolution changed to %ux%u @ %ufps, bitrate %u:%u",
                 __FUNCTION__, width, height, mSendingFramerate,
                 vie_codec.minBitrate, vie_codec.maxBitrate);
   } // else no change; mSendingWidth likely was 0
   if (frame) {
     // XXX I really don't like doing this from MainThread...
     mPtrExtCapture->IncomingFrame(*frame);
     mVideoCodecStat->SentFrame();
@@ -1776,19 +1827,22 @@ WebrtcVideoConduit::CodecConfigToWebRTCC
   // width/height will be overridden on the first frame; they must be 'sane' for
   // SetSendCodec()
   if (codecInfo->mEncodingConstraints.maxFps > 0) {
     cinst.maxFramerate = codecInfo->mEncodingConstraints.maxFps;
   } else {
     cinst.maxFramerate = DEFAULT_VIDEO_MAX_FRAMERATE;
   }
 
-  cinst.minBitrate = mMinBitrate;
-  cinst.startBitrate = mStartBitrate;
-  cinst.maxBitrate = mMaxBitrate;
+  // Defaults if rates aren't forced by pref.  Typically defaults are
+  // overridden on the first video frame.
+  cinst.minBitrate = mMinBitrate ? mMinBitrate : 200;
+  cinst.startBitrate = mStartBitrate ? mStartBitrate : 300;
+  cinst.targetBitrate = cinst.startBitrate;
+  cinst.maxBitrate = mMaxBitrate ? mMaxBitrate : 2000;
 
   if (cinst.codecType == webrtc::kVideoCodecH264)
   {
 #ifdef MOZ_WEBRTC_OMX
     cinst.resolution_divisor = 16;
 #endif
     // cinst.codecSpecific.H264.profile = ?
     cinst.codecSpecific.H264.profile_byte = codecInfo->mProfile;
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.h
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.h
@@ -134,16 +134,27 @@ public:
    * Register Transport for this Conduit. RTP and RTCP frames from the VideoEngine
    * shall be passed to the registered transport for transporting externally.
    */
   virtual MediaConduitErrorCode SetTransmitterTransport(RefPtr<TransportInterface> aTransport) override;
 
   virtual MediaConduitErrorCode SetReceiverTransport(RefPtr<TransportInterface> aTransport) override;
 
   /**
+   * Function to set the encoding bitrate limits based on incoming frame size and rate
+   * @param vie_codec: codec config structure to modify
+   * @param width, height: dimensions of the frame
+   * @param aLastFramerateTenths: holds the current input framerate
+   */
+  void SelectBandwidth(webrtc::VideoCodec& vie_codec,
+                       unsigned short width,
+                       unsigned short height,
+                       mozilla::Atomic<int32_t, mozilla::Relaxed>& aLastFramerateTenths);
+
+  /**
    * Function to select and change the encoding resolution based on incoming frame size
    * and current available bandwidth.
    * @param width, height: dimensions of the frame
    * @param frame: optional frame to submit for encoding after reconfig
    */
   bool SelectSendResolution(unsigned short width,
                             unsigned short height,
                             webrtc::I420VideoFrame *frame);
@@ -386,16 +397,17 @@ private:
   // scaled by *10 because Atomic<double/float> isn't supported
   mozilla::Atomic<int32_t, mozilla::Relaxed> mLastFramerateTenths;
   unsigned short mNumReceivingStreams;
   bool mVideoLatencyTestEnable;
   uint64_t mVideoLatencyAvg;
   uint32_t mMinBitrate;
   uint32_t mStartBitrate;
   uint32_t mMaxBitrate;
+  uint32_t mMinBitrateEstimate;
 
   static const unsigned int sAlphaNum = 7;
   static const unsigned int sAlphaDen = 8;
   static const unsigned int sRoundingPadding = 1024;
 
   RefPtr<WebrtcAudioConduit> mSyncedTo;
 
   nsAutoPtr<VideoCodecConfig> mExternalSendCodec;
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -370,16 +370,34 @@ bool PCUuidGenerator::Generate(std::stri
   }
   char buffer[NSID_LENGTH];
   id.ToProvidedString(buffer);
   idp->assign(buffer);
 
   return true;
 }
 
+bool IsPrivateBrowsing(nsPIDOMWindow* aWindow)
+{
+#if defined(MOZILLA_EXTERNAL_LINKAGE)
+  return false;
+#else
+  if (!aWindow) {
+    return false;
+  }
+
+  nsIDocument *doc = aWindow->GetExtantDoc();
+  if (!doc) {
+    return false;
+  }
+
+  nsILoadContext *loadContext = doc->GetLoadContext();
+  return loadContext && loadContext->UsePrivateBrowsing();
+#endif
+}
 
 PeerConnectionImpl::PeerConnectionImpl(const GlobalObject* aGlobal)
 : mTimeCard(MOZ_LOG_TEST(signalingLogInfo(),LogLevel::Error) ?
             create_timecard() : nullptr)
   , mSignalingState(PCImplSignalingState::SignalingStable)
   , mIceConnectionState(PCImplIceConnectionState::New)
   , mIceGatheringState(PCImplIceGatheringState::New)
   , mDtlsConnected(false)
@@ -398,21 +416,27 @@ PeerConnectionImpl::PeerConnectionImpl(c
   , mUuidGen(MakeUnique<PCUuidGenerator>())
   , mNumAudioStreams(0)
   , mNumVideoStreams(0)
   , mHaveConfiguredCodecs(false)
   , mHaveDataStream(false)
   , mAddCandidateErrorCount(0)
   , mTrickle(true) // TODO(ekr@rtfm.com): Use pref
   , mNegotiationNeeded(false)
+  , mPrivateWindow(false)
 {
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
   MOZ_ASSERT(NS_IsMainThread());
+  auto log = RLogRingBuffer::CreateInstance();
   if (aGlobal) {
     mWindow = do_QueryInterface(aGlobal->GetAsSupports());
+    if (IsPrivateBrowsing(mWindow)) {
+      mPrivateWindow = true;
+      log->EnterPrivateMode();
+    }
   }
 #endif
   CSFLogInfo(logTag, "%s: PeerConnectionImpl constructor for %s",
              __FUNCTION__, mHandle.c_str());
   STAMP_TIMECARD(mTimeCard, "Constructor Completed");
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
   mAllowIceLoopback = Preferences::GetBool(
     "media.peerconnection.ice.loopback", false);
@@ -428,16 +452,25 @@ PeerConnectionImpl::~PeerConnectionImpl(
   if (mTimeCard) {
     STAMP_TIMECARD(mTimeCard, "Destructor Invoked");
     print_timecard(mTimeCard);
     destroy_timecard(mTimeCard);
     mTimeCard = nullptr;
   }
   // This aborts if not on main thread (in Debug builds)
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
+#if !defined(MOZILLA_EXTERNAL_LINKAGE)
+  if (mPrivateWindow) {
+    auto * log = RLogRingBuffer::GetInstance();
+    if (log) {
+      log->ExitPrivateMode();
+    }
+    mPrivateWindow = false;
+  }
+#endif
   if (PeerConnectionCtx::isActive()) {
     PeerConnectionCtx::GetInstance()->mPeerConnections.erase(mHandle);
   } else {
     CSFLogError(logTag, "PeerConnectionCtx is already gone. Ignoring...");
   }
 
   CSFLogInfo(logTag, "%s: PeerConnectionImpl destructor invoked for %s",
              __FUNCTION__, mHandle.c_str());
@@ -2662,17 +2695,19 @@ nsresult
 PeerConnectionImpl::CloseInt()
 {
   PC_AUTO_ENTER_API_CALL_NO_CHECK();
 
   // We do this at the end of the call because we want to make sure we've waited
   // for all trickle ICE candidates to come in; this can happen well after we've
   // transitioned to connected. As a bonus, this allows us to detect race
   // conditions where a stats dispatch happens right as the PC closes.
-  RecordLongtermICEStatistics();
+  if (!mPrivateWindow) {
+    RecordLongtermICEStatistics();
+  }
   RecordEndOfCallTelemetry();
   CSFLogInfo(logTag, "%s: Closing PeerConnectionImpl %s; "
              "ending call", __FUNCTION__, mHandle.c_str());
   if (mJsepSession) {
     mJsepSession->Close();
   }
 #if !defined(MOZILLA_EXTERNAL_LINKAGE)
   if (mDataConnection) {
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.h
@@ -828,16 +828,18 @@ private:
   bool mHaveDataStream;
 
   unsigned int mAddCandidateErrorCount;
 
   bool mTrickle;
 
   bool mNegotiationNeeded;
 
+  bool mPrivateWindow;
+
   // storage for Telemetry data
   uint16_t mMaxReceiving[SdpMediaSection::kMediaTypes];
   uint16_t mMaxSending[SdpMediaSection::kMediaTypes];
 
 public:
   //these are temporary until the DataChannel Listen/Connect API is removed
   unsigned short listenPort;
   unsigned short connectPort;
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -221,17 +221,17 @@ class GeckoLayerClient implements LayerV
     boolean setViewportSize(int width, int height, PointF scrollChange) {
         if (mViewportMetrics.viewportRectWidth == width &&
             mViewportMetrics.viewportRectHeight == height &&
             (scrollChange == null || (scrollChange.x == 0 && scrollChange.y == 0))) {
             return false;
         }
         mViewportMetrics = mViewportMetrics.setViewportSize(width, height);
         if (scrollChange != null) {
-            mViewportMetrics = mViewportMetrics.offsetViewportByAndClamp(scrollChange.x, scrollChange.y);
+            mViewportMetrics = mPanZoomController.adjustScrollForSurfaceShift(mViewportMetrics, scrollChange);
         }
 
         if (mGeckoIsReady) {
             // here we send gecko a resize message. The code in browser.js is responsible for
             // picking up on that resize event, modifying the viewport as necessary, and informing
             // us of the new viewport.
             sendResizeEventIfNecessary(true, scrollChange);
 
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
@@ -1462,9 +1462,14 @@ class JavaPanZoomController
     public int getOverScrollMode() {
         return mX.getOverScrollMode();
     }
 
     @Override
     public void setOverscrollHandler(final Overscroll handler) {
         mOverscroll = handler;
     }
+
+    @Override
+    public ImmutableViewportMetrics adjustScrollForSurfaceShift(ImmutableViewportMetrics aMetrics, PointF aShift) {
+        return aMetrics.offsetViewportByAndClamp(aShift.x, aShift.y);
+    }
 }
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/NativePanZoomController.java
@@ -179,16 +179,25 @@ class NativePanZoomController extends JN
 
     @Override // PanZoomController
     public void setIsLongpressEnabled(boolean isLongpressEnabled) {
         if (!mDestroyed) {
             nativeSetIsLongpressEnabled(isLongpressEnabled);
         }
     }
 
+    @WrapForJNI(stubName = "AdjustScrollForSurfaceShift")
+    private native void adjustScrollForSurfaceShift(float aX, float aY);
+
+    @Override // PanZoomController
+    public ImmutableViewportMetrics adjustScrollForSurfaceShift(ImmutableViewportMetrics aMetrics, PointF aShift) {
+        adjustScrollForSurfaceShift(aShift.x, aShift.y);
+        return aMetrics;
+    }
+
     @WrapForJNI(allowMultithread = true)
     private void updateOverscrollVelocity(final float x, final float y) {
         if (mOverscroll != null) {
             if (ThreadUtils.isOnUiThread() == true) {
                 mOverscroll.setVelocity(x * 1000.0f, Overscroll.Axis.X);
                 mOverscroll.setVelocity(y * 1000.0f, Overscroll.Axis.Y);
             } else {
                 ThreadUtils.postToUiThread(new Runnable() {
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/PanZoomController.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/PanZoomController.java
@@ -46,9 +46,11 @@ public interface PanZoomController {
     public void abortAnimation();
 
     public void setOverScrollMode(int overscrollMode);
     public int getOverScrollMode();
 
     public void setOverscrollHandler(final Overscroll controller);
 
     public void setIsLongpressEnabled(boolean isLongpressEnabled);
+
+    public ImmutableViewportMetrics adjustScrollForSurfaceShift(ImmutableViewportMetrics aMetrics, PointF aShift);
 }
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -6039,18 +6039,20 @@ var ViewportHandler = {
       default:
         return;
     }
 
     if (aData) {
       let scrollChange = JSON.parse(aData);
       let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils);
       windowUtils.setNextPaintSyncId(scrollChange.id);
-      let win = BrowserApp.selectedTab.browser.contentWindow;
-      win.scrollBy(scrollChange.x, scrollChange.y);
+      if (!AppConstants.MOZ_ANDROID_APZ) {
+        let win = BrowserApp.selectedTab.browser.contentWindow;
+        win.scrollBy(scrollChange.x, scrollChange.y);
+      }
     }
   },
 
   /**
    * Returns true if a viewport tag was specified
    */
   isViewportSpecified: function isViewportSpecified(aWindow) {
     let tab = BrowserApp.getTabForWindow(aWindow);
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -43,17 +43,17 @@ static NS_DEFINE_CID(kZipReaderCID, NS_Z
 // own LOG macro below.)
 #ifdef LOG
 #undef LOG
 #endif
 
 //
 // set NSPR_