Merge m-c to f-t
authorPhil Ringnalda <philringnalda@gmail.com>
Thu, 10 Sep 2015 15:34:04 -0700
changeset 294283 0426cdc486e797acec62d875cdb32bfa99c5817d
parent 294282 f22ddc3428181c3d133f34bdf021f72250c5fe08 (current diff)
parent 294269 c0abc2a6e11f52761366e029eb1bae4c9864a8a3 (diff)
child 294284 77c477ee1b8ab376b976db7e184cf4b4e2818b9c
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone43.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 m-c to f-t CLOSED TREE
build/win32/vmwarerecordinghelper/moz.build
build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp
build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def
--- a/accessible/windows/msaa/Platform.cpp
+++ b/accessible/windows/msaa/Platform.cpp
@@ -71,13 +71,18 @@ a11y::ProxyCaretMoveEvent(ProxyAccessibl
 {
 }
 
 void
 a11y::ProxyTextChangeEvent(ProxyAccessible* aText, const nsString& aStr,
                            int32_t aStart, uint32_t aLen, bool aInsert, bool)
 {
   AccessibleWrap* wrapper = WrapperFor(aText);
+  MOZ_ASSERT(wrapper);
+  if (!wrapper) {
+    return;
+  }
+
   auto text = static_cast<HyperTextAccessibleWrap*>(wrapper->AsHyperText());
   if (text) {
     ia2AccessibleText::UpdateTextChangeData(text, aInsert, aStr, aStart, aLen);
   }
 }
--- a/b2g/config/aries/sources.xml
+++ b/b2g/config/aries/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
--- a/b2g/config/emulator-ics/releng-emulator-ics.tt
+++ b/b2g/config/emulator-ics/releng-emulator-ics.tt
@@ -1,16 +1,16 @@
 [
 {
 "size": 80458572,
 "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
 "algorithm": "sha512",
 "filename": "gcc.tar.xz",
-"unpack": "True"
+"unpack": true
 },
 {
 "size": 12057960,
-"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
+"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "unpack": true
 }
 ]
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="067c08fb3e5744b42b68d1f861245f7d507109bc"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/emulator-jb/releng-emulator-jb.tt
+++ b/b2g/config/emulator-jb/releng-emulator-jb.tt
@@ -1,16 +1,16 @@
 [
 {
 "size": 80458572,
 "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
 "algorithm": "sha512",
 "filename": "gcc.tar.xz",
-"unpack": "True"
+"unpack": true
 },
 {
 "size": 12057960,
-"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
+"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "unpack": true
 }
 ]
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- 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="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- 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"/>
--- a/b2g/config/emulator-kk/releng-emulator-kk.tt
+++ b/b2g/config/emulator-kk/releng-emulator-kk.tt
@@ -1,16 +1,16 @@
 [
 {
 "size": 80458572,
 "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
 "algorithm": "sha512",
 "filename": "gcc.tar.xz",
-"unpack": "True"
+"unpack": true
 },
 {
 "size": 12057960,
-"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
+"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "unpack": true
 }
 ]
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
--- a/b2g/config/emulator-l/releng-emulator-l.tt
+++ b/b2g/config/emulator-l/releng-emulator-l.tt
@@ -1,16 +1,16 @@
 [
 {
 "size": 80458572,
 "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
 "algorithm": "sha512",
 "filename": "gcc.tar.xz",
-"unpack": "True"
+"unpack": true
 },
 {
 "size": 12057960,
-"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
+"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "unpack": true
 }
 ]
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
--- a/b2g/config/emulator-x86-kk/releng-emulator-kk.tt
+++ b/b2g/config/emulator-x86-kk/releng-emulator-kk.tt
@@ -1,16 +1,16 @@
 [
 {
 "size": 80458572,
 "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
 "algorithm": "sha512",
 "filename": "gcc.tar.xz",
-"unpack": "True"
+"unpack": true
 },
 {
 "size": 12057960,
-"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
+"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "unpack": true
 }
 ]
--- a/b2g/config/emulator-x86-l/releng-emulator-l.tt
+++ b/b2g/config/emulator-x86-l/releng-emulator-l.tt
@@ -1,16 +1,16 @@
 [
 {
 "size": 80458572,
 "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
 "algorithm": "sha512",
 "filename": "gcc.tar.xz",
-"unpack": "True"
+"unpack": true
 },
 {
 "size": 12057960,
-"digest": 6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
+"digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "unpack": true
 }
 ]
--- a/b2g/config/emulator/releng-emulator.tt
+++ b/b2g/config/emulator/releng-emulator.tt
@@ -1,15 +1,15 @@
 [
 {
 "size": 80458572,
 "digest": "e5101f9dee1e462f6cbd3897ea57eede41d23981825c7b20d91d23ab461875d54d3dfc24999aa58a31e8b01f49fb3140e05ffe5af2957ef1d1afb89fd0dfe1ad",
 "algorithm": "sha512",
 "filename": "gcc.tar.xz",
-"unpack": "True"
+"unpack": true
 },
 {
 "size": 12057960,
 "digest": "6105d6432943141cffb40020dc5ba3a793650bdeb3af9bd5e56d3796c5f03df9962a73e521646cd71fbfb5e266c1e74716ad722fb6055589dfb7d35175bca89e",
 "algorithm": "sha512",
 "filename": "gtk3.tar.xz",
 "unpack": true
 }
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,17 +14,17 @@
   <!--original fetch url was git://github.com/apitrace/-->
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="refs/tags/android-4.0.4_r2.1" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="1b0db93fb6b870b03467aff50d6419771ba0d88c">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
-  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="067c08fb3e5744b42b68d1f861245f7d507109bc"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="34ea6163f9f0e0122fb0bb03607eccdca31ced7a"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="e935894ef5f27e2f04b9e929a45a958e6288a223">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "47459eead04385e22f967012b824f5abdddcfb7c", 
+        "git_revision": "6280500a6cb8d1b178cdd163450e36d22846fbed", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "a28498a478babbaf0aa08c7ff84159330920961b", 
+    "revision": "dc781340a4ceea99ea5f3e1be005befeff2be31b", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,17 +12,17 @@
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- 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="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <!-- 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"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -10,17 +10,17 @@
   <!--original fetch url was git://codeaurora.org/-->
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <!--original fetch url was https://git.mozilla.org/releases-->
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="47459eead04385e22f967012b824f5abdddcfb7c"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="6280500a6cb8d1b178cdd163450e36d22846fbed"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9e2923fd6cab93cf88b4b9ada82225e44fe6635"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="f5d65f5b17d9766d7925aefd0486a1e526ae9bf0"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="daa61633c32b9606f58799a3186395fd2bbb8d8c"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="47f031c320888fe9f3e656602588565b52d43010"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="c6cace53426b5be7e56c0fd202118009689bc707"/>
--- a/build/win32/moz.build
+++ b/build/win32/moz.build
@@ -1,17 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if CONFIG['_MSC_VER'] and CONFIG['OS_TEST'] != 'x86_64':
-    TEST_DIRS += ['vmwarerecordinghelper']
-
 TEST_DIRS += ['crashinjectdll']
 
 if CONFIG['ENABLE_TESTS']:
     Program('crashinject')
     SOURCES += [
         'crashinject.cpp',
     ]
     USE_STATIC_LIBS = True
deleted file mode 100644
--- a/build/win32/vmwarerecordinghelper/moz.build
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
-    'vmwarerecordinghelper.cpp',
-]
-
-SharedLibrary('vmwarerecordinghelper')
-
-DEFFILE = '%s/%s.def' % (SRCDIR, LIBRARY_NAME)
-
-USE_STATIC_LIBS = True
deleted file mode 100644
--- a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-/* 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/. */
-
-/**
- * The following code comes from "Starting and Stopping Recording of Virtual
- * Machine Activity from Within the Guest":
- *
- *   http://kb.vmware.com/selfservice/documentLink.do?externalID=1001401
- */
-
-void __cdecl
-StartRecording()
-{
-  __asm {
-    mov eax, 564d5868h
-    mov ebx, 1
-    mov cx, 47
-    mov dx, 5658h
-    in eax, dx
-  }
-}
-
-void __cdecl
-StopRecording()
-{
-  __asm {
-    mov eax, 564d5868h
-    mov ebx, 2
-    mov cx, 47
-    mov dx, 5658h
-    in eax, dx 
-  }
-}
deleted file mode 100644
--- a/build/win32/vmwarerecordinghelper/vmwarerecordinghelper.def
+++ /dev/null
@@ -1,8 +0,0 @@
-;+# 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/.
-
-LIBRARY vmwarerecordinghelper
-EXPORTS
-     StartRecording
-     StopRecording
--- a/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothDaemonHelpers.cpp
@@ -20,96 +20,108 @@ using mozilla::ipc::DaemonSocketPDUHelpe
 
 nsresult
 Convert(bool aIn, BluetoothScanMode& aOut)
 {
   static const BluetoothScanMode sScanMode[] = {
     [false] = SCAN_MODE_CONNECTABLE,
     [true] = SCAN_MODE_CONNECTABLE_DISCOVERABLE
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sScanMode))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sScanMode), bool, BluetoothScanMode)) {
     aOut = SCAN_MODE_NONE; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sScanMode[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(int32_t aIn, BluetoothTypeOfDevice& aOut)
 {
   static const BluetoothTypeOfDevice sTypeOfDevice[] = {
     [0x00] = static_cast<BluetoothTypeOfDevice>(0), // invalid, required by gcc
     [0x01] = TYPE_OF_DEVICE_BREDR,
     [0x02] = TYPE_OF_DEVICE_BLE,
     [0x03] = TYPE_OF_DEVICE_DUAL
   };
-  if (NS_WARN_IF(!aIn) ||
-      NS_WARN_IF(static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sTypeOfDevice))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        !aIn, int32_t, BluetoothTypeOfDevice) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sTypeOfDevice), int32_t,
+        BluetoothTypeOfDevice)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sTypeOfDevice[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(int32_t aIn, BluetoothScanMode& aOut)
 {
   static const BluetoothScanMode sScanMode[] = {
     [0x00] = SCAN_MODE_NONE,
     [0x01] = SCAN_MODE_CONNECTABLE,
     [0x02] = SCAN_MODE_CONNECTABLE_DISCOVERABLE
   };
-  if (NS_WARN_IF(aIn < 0) ||
-      NS_WARN_IF(static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sScanMode))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn < 0, int32_t, BluetoothScanMode) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        static_cast<size_t>(aIn) >= MOZ_ARRAY_LENGTH(sScanMode), int32_t,
+        BluetoothScanMode)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sScanMode[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothA2dpAudioState& aOut)
 {
   static const BluetoothA2dpAudioState sAudioState[] = {
     [0x00] = A2DP_AUDIO_STATE_REMOTE_SUSPEND,
     [0x01] = A2DP_AUDIO_STATE_STOPPED,
     [0x02] = A2DP_AUDIO_STATE_STARTED
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAudioState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAudioState), uint8_t,
+        BluetoothA2dpAudioState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAudioState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothA2dpConnectionState& aOut)
 {
   static const BluetoothA2dpConnectionState sConnectionState[] = {
     [0x00] = A2DP_CONNECTION_STATE_DISCONNECTED,
     [0x01] = A2DP_CONNECTION_STATE_CONNECTING,
     [0x02] = A2DP_CONNECTION_STATE_CONNECTED,
     [0x03] = A2DP_CONNECTION_STATE_DISCONNECTING
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sConnectionState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sConnectionState), uint8_t,
+        BluetoothA2dpConnectionState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sConnectionState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothAclState& aOut)
 {
   static const BluetoothAclState sAclState[] = {
     [0x00] = ACL_STATE_CONNECTED,
     [0x01] = ACL_STATE_DISCONNECTED
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAclState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAclState), uint8_t, BluetoothAclState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAclState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothAvrcpEvent& aOut)
@@ -120,20 +132,24 @@ Convert(uint8_t aIn, BluetoothAvrcpEvent
     [0x02] = AVRCP_EVENT_TRACK_CHANGE,
     [0x03] = AVRCP_EVENT_TRACK_REACHED_END,
     [0x04] = AVRCP_EVENT_TRACK_REACHED_START,
     [0x05] = AVRCP_EVENT_PLAY_POS_CHANGED,
     [0x06] = static_cast<BluetoothAvrcpEvent>(0),
     [0x07] = static_cast<BluetoothAvrcpEvent>(0),
     [0x08] = AVRCP_EVENT_APP_SETTINGS_CHANGED
   };
-  if (NS_WARN_IF(!aIn) ||
-      NS_WARN_IF(aIn == 0x06) ||
-      NS_WARN_IF(aIn == 0x07) ||
-      NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpEvent))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        !aIn, uint8_t, BluetoothAvrcpEvent) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn == 0x06, uint8_t, BluetoothAvrcpEvent) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn == 0x07, uint8_t, BluetoothAvrcpEvent) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAvrcpEvent), uint8_t, BluetoothAvrcpEvent)) {
     aOut = static_cast<BluetoothAvrcpEvent>(0); // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAvrcpEvent[aIn];
   return NS_OK;
 }
 
 nsresult
@@ -144,18 +160,21 @@ Convert(uint8_t aIn, BluetoothAvrcpMedia
     [0x01] = AVRCP_MEDIA_ATTRIBUTE_TITLE,
     [0x02] = AVRCP_MEDIA_ATTRIBUTE_ARTIST,
     [0x03] = AVRCP_MEDIA_ATTRIBUTE_ALBUM,
     [0x04] = AVRCP_MEDIA_ATTRIBUTE_TRACK_NUM,
     [0x05] = AVRCP_MEDIA_ATTRIBUTE_NUM_TRACKS,
     [0x06] = AVRCP_MEDIA_ATTRIBUTE_GENRE,
     [0x07] = AVRCP_MEDIA_ATTRIBUTE_PLAYING_TIME
   };
-  if (NS_WARN_IF(!aIn) ||
-      NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpMediaAttribute))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        !aIn, uint8_t, BluetoothAvrcpMediaAttrbiute) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAvrcpMediaAttribute), uint8_t,
+        BluetoothAvrcpMediaAttribute)) {
     // silences compiler warning
     aOut = static_cast<BluetoothAvrcpMediaAttribute>(0);
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAvrcpMediaAttribute[aIn];
   return NS_OK;
 }
 
@@ -164,18 +183,21 @@ Convert(uint8_t aIn, BluetoothAvrcpPlaye
 {
   static const BluetoothAvrcpPlayerAttribute sAvrcpPlayerAttribute[] = {
     [0x00] = static_cast<BluetoothAvrcpPlayerAttribute>(0),
     [0x01] = AVRCP_PLAYER_ATTRIBUTE_EQUALIZER,
     [0x02] = AVRCP_PLAYER_ATTRIBUTE_REPEAT,
     [0x03] = AVRCP_PLAYER_ATTRIBUTE_SHUFFLE,
     [0x04] = AVRCP_PLAYER_ATTRIBUTE_SCAN
   };
-  if (NS_WARN_IF(!aIn) ||
-      NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpPlayerAttribute))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        !aIn, uint8_t, BluetoothAvrcpPlayerAttrbiute) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAvrcpPlayerAttribute), uint8_t,
+        BluetoothAvrcpPlayerAttribute)) {
     // silences compiler warning
     aOut = static_cast<BluetoothAvrcpPlayerAttribute>(0);
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAvrcpPlayerAttribute[aIn];
   return NS_OK;
 }
 
@@ -183,141 +205,159 @@ nsresult
 Convert(uint8_t aIn, BluetoothAvrcpRemoteFeature& aOut)
 {
   static const BluetoothAvrcpRemoteFeature sAvrcpRemoteFeature[] = {
     [0x00] = AVRCP_REMOTE_FEATURE_NONE,
     [0x01] = AVRCP_REMOTE_FEATURE_METADATA,
     [0x02] = AVRCP_REMOTE_FEATURE_ABSOLUTE_VOLUME,
     [0x03] = AVRCP_REMOTE_FEATURE_BROWSE
   };
-  if (NS_WARN_IF(!aIn) ||
-      NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAvrcpRemoteFeature))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        !aIn, uint8_t, BluetoothAvrcpRemoteFeature) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAvrcpRemoteFeature), uint8_t,
+        BluetoothAvrcpRemoteFeature)) {
     // silences compiler warning
     aOut = static_cast<BluetoothAvrcpRemoteFeature>(0);
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAvrcpRemoteFeature[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothBondState& aOut)
 {
   static const BluetoothBondState sBondState[] = {
     [0x00] = BOND_STATE_NONE,
     [0x01] = BOND_STATE_BONDING,
     [0x02] = BOND_STATE_BONDED
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sBondState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sBondState), uint8_t, BluetoothBondState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sBondState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothHandsfreeAudioState& aOut)
 {
   static const BluetoothHandsfreeAudioState sAudioState[] = {
     [0x00] = HFP_AUDIO_STATE_DISCONNECTED,
     [0x01] = HFP_AUDIO_STATE_CONNECTING,
     [0x02] = HFP_AUDIO_STATE_CONNECTED,
     [0x03] = HFP_AUDIO_STATE_DISCONNECTING
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAudioState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAudioState), uint8_t,
+        BluetoothHandsfreeAudioState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAudioState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothHandsfreeCallHoldType& aOut)
 {
   static const BluetoothHandsfreeCallHoldType sCallHoldType[] = {
     [0x00] = HFP_CALL_HOLD_RELEASEHELD,
     [0x01] = HFP_CALL_HOLD_RELEASEACTIVE_ACCEPTHELD,
     [0x02] = HFP_CALL_HOLD_HOLDACTIVE_ACCEPTHELD,
     [0x03] = HFP_CALL_HOLD_ADDHELDTOCONF
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallHoldType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sCallHoldType), uint8_t,
+        BluetoothHandsfreeCallHoldType)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sCallHoldType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothHandsfreeConnectionState& aOut)
 {
   static const BluetoothHandsfreeConnectionState sConnectionState[] = {
     [0x00] = HFP_CONNECTION_STATE_DISCONNECTED,
     [0x01] = HFP_CONNECTION_STATE_CONNECTING,
     [0x02] = HFP_CONNECTION_STATE_CONNECTED,
     [0x03] = HFP_CONNECTION_STATE_SLC_CONNECTED,
     [0x04] = HFP_CONNECTION_STATE_DISCONNECTING
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sConnectionState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sConnectionState), uint8_t,
+        BluetoothHandsfreeConnectionState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sConnectionState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothHandsfreeNRECState& aOut)
 {
   static const BluetoothHandsfreeNRECState sNRECState[] = {
     [0x00] = HFP_NREC_STOPPED,
     [0x01] = HFP_NREC_STARTED
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sNRECState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sNRECState), uint8_t,
+        BluetoothHandsfreeNRECState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sNRECState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothHandsfreeVoiceRecognitionState& aOut)
 {
   static const BluetoothHandsfreeVoiceRecognitionState sState[] = {
     [0x00] = HFP_VOICE_RECOGNITION_STOPPED,
     [0x01] = HFP_VOICE_RECOGNITION_STARTED
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sState), uint8_t,
+        BluetoothHandsfreeVoiceRecognitionState)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothHandsfreeVolumeType& aOut)
 {
   static const BluetoothHandsfreeVolumeType sVolumeType[] = {
     [0x00] = HFP_VOLUME_TYPE_SPEAKER,
     [0x01] = HFP_VOLUME_TYPE_MICROPHONE
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sVolumeType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sVolumeType), uint8_t,
+        BluetoothHandsfreeVolumeType)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sVolumeType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothHandsfreeWbsConfig& aOut)
 {
   static const BluetoothHandsfreeWbsConfig sWbsConfig[] = {
     [0x00] = HFP_WBS_NONE,
     [0x01] = HFP_WBS_NO,
     [0x02] = HFP_WBS_YES
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sWbsConfig))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sWbsConfig), uint8_t,
+        BluetoothHandsfreeWbsConfig)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sWbsConfig[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothTypeOfDevice& aOut)
@@ -344,54 +384,61 @@ Convert(uint8_t aIn, BluetoothPropertyTy
     [0x0c] = PROPERTY_REMOTE_VERSION_INFO
   };
   if (aIn == 0xff) {
     /* This case is handled separately to not populate
      * |sPropertyType| with empty entries. */
     aOut = PROPERTY_REMOTE_DEVICE_TIMESTAMP;
     return NS_OK;
   }
-  if (NS_WARN_IF(!aIn) ||
-      NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sPropertyType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        !aIn, uint8_t, BluetoothPropertyType) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sPropertyType), uint8_t,
+        BluetoothPropertyType)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sPropertyType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothSocketType aIn, uint8_t& aOut)
 {
   static const uint8_t sSocketType[] = {
     [0] = 0, // silences compiler warning
     [BluetoothSocketType::RFCOMM] = 0x01,
     [BluetoothSocketType::SCO] = 0x02,
     [BluetoothSocketType::L2CAP] = 0x03
     // EL2CAP not supported
   };
-  if (NS_WARN_IF(aIn == BluetoothSocketType::EL2CAP) ||
-      NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSocketType)) ||
-      NS_WARN_IF(!sSocketType[aIn])) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn == BluetoothSocketType::EL2CAP, BluetoothSocketType, uint8_t) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sSocketType), BluetoothSocketType, uint8_t) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        !sSocketType[aIn], BluetoothSocketType, uint8_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sSocketType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothSspVariant& aOut)
 {
   static const BluetoothSspVariant sSspVariant[] = {
     [0x00] = SSP_VARIANT_PASSKEY_CONFIRMATION,
     [0x01] = SSP_VARIANT_PASSKEY_ENTRY,
     [0x02] = SSP_VARIANT_CONSENT,
     [0x03] = SSP_VARIANT_PASSKEY_NOTIFICATION
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sSspVariant))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sSspVariant), uint8_t, BluetoothSspVariant)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sSspVariant[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, BluetoothStatus& aOut)
@@ -404,17 +451,18 @@ Convert(uint8_t aIn, BluetoothStatus& aO
     [0x04] = STATUS_BUSY,
     [0x05] = STATUS_DONE,
     [0x06] = STATUS_UNSUPPORTED,
     [0x07] = STATUS_PARM_INVALID,
     [0x08] = STATUS_UNHANDLED,
     [0x09] = STATUS_AUTH_FAILURE,
     [0x0a] = STATUS_RMT_DEV_DOWN
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sStatus))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sStatus), uint8_t, BluetoothStatus)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sStatus[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(int32_t aIn, BluetoothGattStatus& aOut)
@@ -435,18 +483,21 @@ Convert(int32_t aIn, BluetoothGattStatus
     [0x000b] = GATT_STATUS_ATTRIBUTE_NOT_LONG,
     [0x000c] = GATT_STATUS_INSUFFICIENT_ENCRYPTION_KEY_SIZE,
     [0x000d] = GATT_STATUS_INVALID_ATTRIBUTE_LENGTH,
     [0x000e] = GATT_STATUS_UNLIKELY_ERROR,
     [0x000f] = GATT_STATUS_INSUFFICIENT_ENCRYPTION,
     [0x0010] = GATT_STATUS_UNSUPPORTED_GROUP_TYPE,
     [0x0011] = GATT_STATUS_INSUFFICIENT_RESOURCES
   };
-  if (NS_WARN_IF(aIn < 0) ||
-      NS_WARN_IF(aIn >= static_cast<ssize_t>(MOZ_ARRAY_LENGTH(sGattStatus)))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn < 0, int32_t, BluetoothGattStatus) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= static_cast<ssize_t>(MOZ_ARRAY_LENGTH(sGattStatus)), int32_t,
+        BluetoothGattStatus)) {
     aOut = GATT_STATUS_UNKNOWN_ERROR;
   } else {
     aOut = sGattStatus[aIn];
   }
   return NS_OK;
 }
 
 nsresult
@@ -461,17 +512,19 @@ Convert(const nsAString& aIn, BluetoothA
   }
 
   return NS_OK;
 }
 
 nsresult
 Convert(const nsAString& aIn, BluetoothPinCode& aOut)
 {
-  if (NS_WARN_IF(aIn.Length() > MOZ_ARRAY_LENGTH(aOut.mPinCode))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn.Length() > MOZ_ARRAY_LENGTH(aOut.mPinCode), nsAString,
+        BluetoothPinCode)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   NS_ConvertUTF16toUTF8 pinCodeUTF8(aIn);
   const char* str = pinCodeUTF8.get();
 
   nsAString::size_type i;
 
@@ -494,32 +547,34 @@ nsresult
 Convert(const nsAString& aIn, BluetoothPropertyType& aOut)
 {
   if (aIn.EqualsLiteral("Name")) {
     aOut = PROPERTY_BDNAME;
   } else if (aIn.EqualsLiteral("Discoverable")) {
     aOut = PROPERTY_ADAPTER_SCAN_MODE;
   } else if (aIn.EqualsLiteral("DiscoverableTimeout")) {
     aOut = PROPERTY_ADAPTER_DISCOVERY_TIMEOUT;
-  } else {
+  } else if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        false, nsAString, BluetoothPropertyType)) {
     BT_LOGR("Invalid property name: %s", NS_ConvertUTF16toUTF8(aIn).get());
     aOut = static_cast<BluetoothPropertyType>(0); // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   return NS_OK;
 }
 
 nsresult
 Convert(const nsAString& aIn, BluetoothServiceName& aOut)
 {
   NS_ConvertUTF16toUTF8 serviceNameUTF8(aIn);
   const char* str = serviceNameUTF8.get();
   size_t len = strlen(str);
 
-  if (NS_WARN_IF(len > sizeof(aOut.mName))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        len > sizeof(aOut.mName), nsAString, BluetoothServiceName)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   memcpy(aOut.mName, str, len);
   memset(aOut.mName + len, 0, sizeof(aOut.mName) - len);
 
   return NS_OK;
 }
@@ -539,17 +594,18 @@ Convert(nsresult aIn, BluetoothStatus& a
 
 nsresult
 Convert(BluetoothAclState aIn, bool& aOut)
 {
   static const bool sBool[] = {
     [ACL_STATE_CONNECTED] = true,
     [ACL_STATE_DISCONNECTED] = false
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sBool))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sBool), BluetoothAclState, bool)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sBool[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(const BluetoothAddress& aIn, nsAString& aOut)
@@ -558,19 +614,21 @@ Convert(const BluetoothAddress& aIn, nsA
 
   int res = snprintf(str, sizeof(str), "%02x:%02x:%02x:%02x:%02x:%02x",
                      static_cast<int>(aIn.mAddr[0]),
                      static_cast<int>(aIn.mAddr[1]),
                      static_cast<int>(aIn.mAddr[2]),
                      static_cast<int>(aIn.mAddr[3]),
                      static_cast<int>(aIn.mAddr[4]),
                      static_cast<int>(aIn.mAddr[5]));
-  if (NS_WARN_IF(res < 0)) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        res < 0, BluetoothAddress, nsAString)) {
     return NS_ERROR_ILLEGAL_VALUE;
-  } else if (NS_WARN_IF((size_t)res >= sizeof(str))) {
+  } else if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        (size_t)res >= sizeof(str), BluetoothAddress, nsAString)) {
     return NS_ERROR_OUT_OF_MEMORY; /* string buffer too small */
   }
 
   aOut = NS_ConvertUTF8toUTF16(str);
 
   return NS_OK;
 }
 
@@ -580,58 +638,66 @@ Convert(BluetoothAvrcpEvent aIn, uint8_t
   static const uint8_t sValue[] = {
     [AVRCP_EVENT_PLAY_STATUS_CHANGED] = 0x01,
     [AVRCP_EVENT_TRACK_CHANGE] = 0x02,
     [AVRCP_EVENT_TRACK_REACHED_END] = 0x03,
     [AVRCP_EVENT_TRACK_REACHED_START] = 0x04,
     [AVRCP_EVENT_PLAY_POS_CHANGED] = 0x05,
     [AVRCP_EVENT_APP_SETTINGS_CHANGED] = 0x08
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpEvent, uint8_t)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothAvrcpNotification aIn, uint8_t& aOut)
 {
   static const bool sValue[] = {
     [AVRCP_NTF_INTERIM] = 0x00,
     [AVRCP_NTF_CHANGED] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpNotification,
+        uint8_t)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothAvrcpPlayerAttribute aIn, uint8_t& aOut)
 {
   static const uint8_t sValue[] = {
     [AVRCP_PLAYER_ATTRIBUTE_EQUALIZER] = 0x01,
     [AVRCP_PLAYER_ATTRIBUTE_REPEAT] = 0x02,
     [AVRCP_PLAYER_ATTRIBUTE_SHUFFLE] = 0x03,
     [AVRCP_PLAYER_ATTRIBUTE_SCAN] = 0x04
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpPlayerAttribute, uint8_t)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothAvrcpRemoteFeature aIn, unsigned long& aOut)
 {
-  if (NS_WARN_IF(aIn < std::numeric_limits<unsigned long>::min()) ||
-      NS_WARN_IF(aIn > std::numeric_limits<unsigned long>::max())) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn < std::numeric_limits<unsigned long>::min(),
+        BluetoothAvrcpRemoteFeature, unsigned long) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn > std::numeric_limits<unsigned long>::max(),
+        BluetoothAvrcpRemoteFeature, unsigned long)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = static_cast<unsigned long>(aIn);
   return NS_OK;
 }
 
 nsresult
@@ -639,61 +705,68 @@ Convert(BluetoothAvrcpStatus aIn, uint8_
 {
   static const uint8_t sValue[] = {
     [AVRCP_STATUS_BAD_COMMAND] = 0x00,
     [AVRCP_STATUS_BAD_PARAMETER] = 0x01,
     [AVRCP_STATUS_NOT_FOUND] = 0x02,
     [AVRCP_STATUS_INTERNAL_ERROR] = 0x03,
     [AVRCP_STATUS_SUCCESS] = 0x04
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothAvrcpStatus, uint8_t)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeAtResponse aIn, uint8_t& aOut)
 {
   static const uint8_t sAtResponse[] = {
     [HFP_AT_RESPONSE_ERROR] = 0x00,
     [HFP_AT_RESPONSE_OK] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sAtResponse))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sAtResponse), BluetoothHandsfreeAtResponse,
+        uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sAtResponse[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeCallAddressType aIn, uint8_t& aOut)
 {
   static const uint8_t sCallAddressType[] = {
     [HFP_CALL_ADDRESS_TYPE_UNKNOWN] = 0x81,
     [HFP_CALL_ADDRESS_TYPE_INTERNATIONAL] = 0x91
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallAddressType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sCallAddressType),
+        BluetoothHandsfreeCallAddressType, uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sCallAddressType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeCallDirection aIn, uint8_t& aOut)
 {
   static const uint8_t sCallDirection[] = {
     [HFP_CALL_DIRECTION_OUTGOING] = 0x00,
     [HFP_CALL_DIRECTION_INCOMING] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallDirection))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sCallDirection),
+        BluetoothHandsfreeCallDirection, uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sCallDirection[aIn];
   return NS_OK;
 }
 
 nsresult
@@ -703,109 +776,122 @@ Convert(BluetoothHandsfreeCallState aIn,
     [HFP_CALL_STATE_ACTIVE] = 0x00,
     [HFP_CALL_STATE_HELD] = 0x01,
     [HFP_CALL_STATE_DIALING] = 0x02,
     [HFP_CALL_STATE_ALERTING] = 0x03,
     [HFP_CALL_STATE_INCOMING] = 0x04,
     [HFP_CALL_STATE_WAITING] = 0x05,
     [HFP_CALL_STATE_IDLE] = 0x06
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sCallState), BluetoothHandsfreeCallState,
+        uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sCallState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeCallMode aIn, uint8_t& aOut)
 {
   static const uint8_t sCallMode[] = {
     [HFP_CALL_MODE_VOICE] = 0x00,
     [HFP_CALL_MODE_DATA] = 0x01,
     [HFP_CALL_MODE_FAX] = 0x02
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallMode))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sCallMode), BluetoothHandsfreeCallMode, uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sCallMode[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeCallMptyType aIn, uint8_t& aOut)
 {
   static const uint8_t sCallMptyType[] = {
     [HFP_CALL_MPTY_TYPE_SINGLE] = 0x00,
     [HFP_CALL_MPTY_TYPE_MULTI] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sCallMptyType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sCallMptyType),
+        BluetoothHandsfreeCallMptyType, uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sCallMptyType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeNetworkState aIn, uint8_t& aOut)
 {
   static const uint8_t sNetworkState[] = {
     [HFP_NETWORK_STATE_NOT_AVAILABLE] = 0x00,
     [HFP_NETWORK_STATE_AVAILABLE] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sNetworkState))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sNetworkState), BluetoothHandsfreeNetworkState,
+        uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sNetworkState[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeServiceType aIn, uint8_t& aOut)
 {
   static const uint8_t sServiceType[] = {
     [HFP_SERVICE_TYPE_HOME] = 0x00,
     [HFP_SERVICE_TYPE_ROAMING] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sServiceType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sServiceType), BluetoothHandsfreeServiceType,
+        uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sServiceType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeVolumeType aIn, uint8_t& aOut)
 {
   static const uint8_t sVolumeType[] = {
     [HFP_VOLUME_TYPE_SPEAKER] = 0x00,
     [HFP_VOLUME_TYPE_MICROPHONE] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sVolumeType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sVolumeType), BluetoothHandsfreeVolumeType,
+        uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sVolumeType[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothHandsfreeWbsConfig aIn, uint8_t& aOut)
 {
   static const uint8_t sWbsConfig[] = {
     [HFP_WBS_NONE] = 0x00,
     [HFP_WBS_NO] = 0x01,
     [HFP_WBS_YES] = 0x02
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sWbsConfig))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sWbsConfig), BluetoothHandsfreeWbsConfig,
+        uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sWbsConfig[aIn];
   return NS_OK;
 }
 
 nsresult
@@ -822,17 +908,19 @@ Convert(BluetoothPropertyType aIn, uint8
     [PROPERTY_ADAPTER_SCAN_MODE] = 0x07,
     [PROPERTY_ADAPTER_BONDED_DEVICES] = 0x08,
     [PROPERTY_ADAPTER_DISCOVERY_TIMEOUT] = 0x09,
     [PROPERTY_REMOTE_FRIENDLY_NAME] = 0x0a,
     [PROPERTY_REMOTE_RSSI] = 0x0b,
     [PROPERTY_REMOTE_VERSION_INFO] = 0x0c,
     [PROPERTY_REMOTE_DEVICE_TIMESTAMP] = 0xff
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sPropertyType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sPropertyType), BluetoothPropertyType,
+        uint8_t)) {
     aOut = 0x00; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sPropertyType[aIn];
   return NS_OK;
 }
 
 nsresult
@@ -850,34 +938,36 @@ Convert(const BluetoothRemoteName& aIn, 
 nsresult
 Convert(BluetoothScanMode aIn, int32_t& aOut)
 {
   static const int32_t sScanMode[] = {
     [SCAN_MODE_NONE] = 0x00,
     [SCAN_MODE_CONNECTABLE] = 0x01,
     [SCAN_MODE_CONNECTABLE_DISCOVERABLE] = 0x02
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sScanMode))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sScanMode), BluetoothScanMode, int32_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sScanMode[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothSspVariant aIn, uint8_t& aOut)
 {
   static const uint8_t sValue[] = {
     [SSP_VARIANT_PASSKEY_CONFIRMATION] = 0x00,
     [SSP_VARIANT_PASSKEY_ENTRY] = 0x01,
     [SSP_VARIANT_CONSENT] = 0x02,
     [SSP_VARIANT_PASSKEY_NOTIFICATION] = 0x03
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sValue), BluetoothSspVariant, uint8_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
@@ -891,17 +981,18 @@ Convert(ControlPlayStatus aIn, uint8_t& 
     [PLAYSTATUS_REV_SEEK] = 0x04
   };
   if (aIn == PLAYSTATUS_ERROR) {
     /* This case is handled separately to not populate
      * |sValue| with empty entries. */
     aOut = 0xff;
     return NS_OK;
   }
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sValue), ControlPlayStatus, uint8_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
@@ -909,34 +1000,38 @@ Convert(BluetoothGattAuthReq aIn, int32_
 {
   static const int32_t sGattAuthReq[] = {
     [GATT_AUTH_REQ_NONE] = 0x00,
     [GATT_AUTH_REQ_NO_MITM] = 0x01,
     [GATT_AUTH_REQ_MITM] = 0x02,
     [GATT_AUTH_REQ_SIGNED_NO_MITM] = 0x03,
     [GATT_AUTH_REQ_SIGNED_MITM] = 0x04
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sGattAuthReq))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sGattAuthReq), BluetoothGattAuthReq,
+        int32_t)) {
     aOut = GATT_AUTH_REQ_NONE; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sGattAuthReq[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(BluetoothGattWriteType aIn, int32_t& aOut)
 {
   static const int32_t sGattWriteType[] = {
     [GATT_WRITE_TYPE_NO_RESPONSE] = 0x01,
     [GATT_WRITE_TYPE_NORMAL] = 0x02,
     [GATT_WRITE_TYPE_PREPARE] = 0x03,
     [GATT_WRITE_TYPE_SIGNED] = 0x04
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sGattWriteType))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sGattWriteType), BluetoothGattWriteType,
+        int32_t)) {
     aOut = GATT_WRITE_TYPE_NORMAL; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sGattWriteType[aIn];
   return NS_OK;
 }
 
 /* |ConvertArray| is a helper for converting arrays. Pass an
@@ -1043,17 +1138,18 @@ PackPDU(const BluetoothAvrcpElementAttri
 {
   nsresult rv = PackPDU(PackConversion<uint32_t, uint8_t>(aIn.mId), aPDU);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   const NS_ConvertUTF16toUTF8 cstr(aIn.mValue);
 
-  if (NS_WARN_IF(cstr.Length() == PR_UINT32_MAX)) {
+  if (MOZ_HAL_IPC_PACK_WARN_IF(
+        cstr.Length() == PR_UINT32_MAX, BluetoothAvrcpElementAttribute)) {
     return NS_ERROR_ILLEGAL_VALUE; /* integer overflow detected */
   }
 
   uint32_t clen = cstr.Length() + 1; /* include \0 character */
 
   rv = PackPDU(PackConversion<uint32_t, uint8_t>(clen), aPDU);
   if (NS_FAILED(rv)) {
     return rv;
@@ -1233,17 +1329,17 @@ PackPDU(const BluetoothNamedValue& aIn, 
                    value.Length()),
                  aPDU);
   } else if (aIn.value().type() == BluetoothValue::Tbool) {
     // Set scan mode
     bool value = aIn.value().get_bool();
 
     rv = PackPDU(static_cast<uint16_t>(sizeof(int32_t)),
                  PackConversion<bool, BluetoothScanMode>(value), aPDU);
-  } else {
+  } else if (MOZ_HAL_IPC_PACK_WARN_IF(true, BluetoothNamedValue)) {
     BT_LOGR("Invalid property value type");
     rv = NS_ERROR_ILLEGAL_VALUE;
   }
   return rv;
 }
 
 nsresult
 PackPDU(const BluetoothPinCode& aIn, DaemonSocketPDU& aPDU)
@@ -1485,17 +1581,17 @@ UnpackPDU(DaemonSocketPDU& aPDU, Bluetoo
     return rv;
   }
 
   switch (aOut.mType) {
     case PROPERTY_BDNAME:
       /* fall through */
     case PROPERTY_REMOTE_FRIENDLY_NAME: {
         const uint8_t* data = aPDU.Consume(len);
-        if (NS_WARN_IF(!data)) {
+        if (MOZ_HAL_IPC_UNPACK_WARN_IF(!data, BluetoothProperty)) {
           return NS_ERROR_ILLEGAL_VALUE;
         }
         // We construct an nsCString here because the string
         // returned from the PDU is not 0-terminated.
         aOut.mString = NS_ConvertUTF8toUTF16(
           nsCString(reinterpret_cast<const char*>(data), len));
       }
       break;
--- a/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
+++ b/dom/bluetooth/bluedroid/BluetoothServiceBluedroid.cpp
@@ -314,17 +314,18 @@ BluetoothServiceBluedroid::StopInternal(
     if (NS_WARN_IF(!sProfiles[i])) {
       BT_LOGR("Profile manager [%s] is null", profileName.get());
       return NS_ERROR_FAILURE;
     }
 
     if (sProfiles[i]->IsConnected()) {
       sProfiles[i]->Disconnect(nullptr);
     } else if (!profileName.EqualsLiteral("OPP") &&
-               !profileName.EqualsLiteral("PBAP")) {
+               !profileName.EqualsLiteral("PBAP") &&
+               !profileName.EqualsLiteral("MapSms")) {
       sProfiles[i]->Reset();
     }
   }
 
   // aRunnable will be a nullptr during starup and shutdown
   if (aRunnable) {
     mChangeAdapterStateRunnables.AppendElement(aRunnable);
   }
--- a/dom/bluetooth/common/BluetoothService.cpp
+++ b/dom/bluetooth/common/BluetoothService.cpp
@@ -527,18 +527,16 @@ nsresult
 BluetoothService::HandleShutdown()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   // This is a two phase shutdown. First we notify all child processes that
   // bluetooth is going away, and then we wait for them to acknowledge. Then we
   // close down all the bluetooth machinery.
 
-  sInShutdown = true;
-
   Cleanup();
 
   AutoInfallibleTArray<BluetoothParent*, 10> childActors;
   GetAllBluetoothActors(childActors);
 
   if (!childActors.IsEmpty()) {
     // Notify child processes that they should stop using bluetooth now.
     for (uint32_t index = 0; index < childActors.Length(); index++) {
@@ -628,16 +626,23 @@ BluetoothService::Observe(nsISupports* a
     return HandleStartup();
   }
 
   if (!strcmp(aTopic, MOZSETTINGS_CHANGED_ID)) {
     return HandleSettingsChanged(aSubject);
   }
 
   if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
+    /**
+     * |sInShutdown| flag should be set for instances created in content
+     * processes or parent processes. Please see bug 1199653 for detailed
+     * information.
+     */
+    sInShutdown = true;
+
     return HandleShutdown();
   }
 
   MOZ_ASSERT(false, "BluetoothService got unexpected topic!");
   return NS_ERROR_UNEXPECTED;
 }
 
 /**
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -4912,19 +4912,20 @@ HTMLInputElement::GetFilesAndDirectories
 #endif
       nsAutoString path;
       filesAndDirs[i]->GetMozFullPathInternal(path, aRv);
       if (aRv.Failed()) {
         return nullptr;
       }
       int32_t leafSeparatorIndex = path.RFind(FILE_PATH_SEPARATOR);
       nsDependentSubstring dirname = Substring(path, 0, leafSeparatorIndex);
-      nsDependentSubstring basename = Substring(path, leafSeparatorIndex);
       fs = MakeOrReuseFileSystem(dirname, fs, window);
-      filesAndDirsSeq[i].SetAsDirectory() = new Directory(fs, basename);
+      nsAutoString dompath(NS_LITERAL_STRING(FILESYSTEM_DOM_PATH_SEPARATOR));
+      dompath.Append(Substring(path, leafSeparatorIndex + 1));
+      filesAndDirsSeq[i].SetAsDirectory() = new Directory(fs, dompath);
     } else {
       filesAndDirsSeq[i].SetAsFile() = filesAndDirs[i];
     }
   }
 
   p->MaybeResolve(filesAndDirsSeq);
 
   return p.forget();
--- a/dom/html/HTMLVideoElement.cpp
+++ b/dom/html/HTMLVideoElement.cpp
@@ -37,16 +37,17 @@ namespace mozilla {
 namespace dom {
 
 static bool sVideoStatsEnabled;
 
 NS_IMPL_ELEMENT_CLONE(HTMLVideoElement)
 
 HTMLVideoElement::HTMLVideoElement(already_AddRefed<NodeInfo>& aNodeInfo)
   : HTMLMediaElement(aNodeInfo)
+  , mUseScreenWakeLock(true)
 {
 }
 
 HTMLVideoElement::~HTMLVideoElement()
 {
 }
 
 nsresult HTMLVideoElement::GetVideoSize(nsIntSize* size)
@@ -181,16 +182,29 @@ double HTMLVideoElement::MozFrameDelay()
 }
 
 bool HTMLVideoElement::MozHasAudio() const
 {
   MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
   return HasAudio();
 }
 
+bool HTMLVideoElement::MozUseScreenWakeLock() const
+{
+  MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
+  return mUseScreenWakeLock;
+}
+
+void HTMLVideoElement::SetMozUseScreenWakeLock(bool aValue)
+{
+  MOZ_ASSERT(NS_IsMainThread(), "Should be on main thread.");
+  mUseScreenWakeLock = aValue;
+  UpdateScreenWakeLock();
+}
+
 JSObject*
 HTMLVideoElement::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   return HTMLVideoElementBinding::Wrap(aCx, this, aGivenProto);
 }
 
 bool
 HTMLVideoElement::NotifyOwnerDocumentActivityChangedInternal()
@@ -245,24 +259,25 @@ HTMLVideoElement::WakeLockRelease()
   HTMLMediaElement::WakeLockRelease();
 }
 
 void
 HTMLVideoElement::UpdateScreenWakeLock()
 {
   bool hidden = OwnerDoc()->Hidden();
 
-  if (mScreenWakeLock && (mPaused || hidden)) {
+  if (mScreenWakeLock && (mPaused || hidden || !mUseScreenWakeLock)) {
     ErrorResult rv;
     mScreenWakeLock->Unlock(rv);
     mScreenWakeLock = nullptr;
     return;
   }
 
-  if (!mScreenWakeLock && !mPaused && !hidden && HasVideo()) {
+  if (!mScreenWakeLock && !mPaused && !hidden &&
+      mUseScreenWakeLock && HasVideo()) {
     nsRefPtr<power::PowerManagerService> pmService =
       power::PowerManagerService::GetInstance();
     NS_ENSURE_TRUE_VOID(pmService);
 
     ErrorResult rv;
     mScreenWakeLock = pmService->NewWakeLock(NS_LITERAL_STRING("screen"),
                                              OwnerDoc()->GetInnerWindow(),
                                              rv);
--- a/dom/html/HTMLVideoElement.h
+++ b/dom/html/HTMLVideoElement.h
@@ -100,29 +100,34 @@ public:
   uint32_t MozPresentedFrames() const;
 
   uint32_t MozPaintedFrames();
 
   double MozFrameDelay();
 
   bool MozHasAudio() const;
 
+  bool MozUseScreenWakeLock() const;
+
+  void SetMozUseScreenWakeLock(bool aValue);
+
   bool NotifyOwnerDocumentActivityChangedInternal() override;
 
   already_AddRefed<VideoPlaybackQuality> GetVideoPlaybackQuality();
 
 protected:
   virtual ~HTMLVideoElement();
 
   virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
 
   virtual void WakeLockCreate() override;
   virtual void WakeLockRelease() override;
   void UpdateScreenWakeLock();
 
+  bool mUseScreenWakeLock;
   nsRefPtr<WakeLock> mScreenWakeLock;
 
 private:
   static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
                                     nsRuleData* aData);
 };
 
 } // namespace dom
--- a/dom/html/test/test_video_wakelock.html
+++ b/dom/html/test/test_video_wakelock.html
@@ -26,16 +26,17 @@ function testVideoPlayPause() {
   var lockState_cpu = true;
   var lockState_screen = true;
   var count_cpu = 0;
   var count_screen = 0;
 
   var content = document.getElementById('content');
 
   var video = document.createElement('video');
+  ok(video.mozUseScreenWakeLock, "#1 Video element uses screen wake lock by default");
   video.src = "wakelock.ogv";
   content.appendChild(video);
 
   var startDate;
   function testVideoPlayPauseListener(topic, state) {
     info("#1 topic=" + topic + ", state=" + state);
 
     var locked = state == "locked-foreground" ||
@@ -78,16 +79,17 @@ function testVideoPlay() {
   var lockState_cpu = true;
   var lockState_screen = true;
   var count_cpu = 0;
   var count_screen = 0;
 
   var content = document.getElementById('content');
 
   var video = document.createElement('video');
+  ok(video.mozUseScreenWakeLock, "#2 Video element uses screen wake lock by default");
   video.src = "wakelock.ogv";
   content.appendChild(video);
 
   var startDate;
   video.addEventListener('progress', function() {
     startDate = new Date();
   });
 
@@ -119,31 +121,82 @@ function testVideoPlay() {
       runTests();
     }
   }
 
   navigator.mozPower.addWakeLockListener(testVideoPlayListener);
   video.play();
 }
 
-var tests = [ testVideoPlayPause, testVideoPlay ];
+function testVideoNoScreenWakeLock() {
+  info("#3 testVideoNoScreenWakeLock");
+
+  var lockState_cpu = true;
+  var lockState_screen = false;
+  var count_cpu = 0;
+
+  var content = document.getElementById('content');
+
+  var video = document.createElement('video');
+  video.mozUseScreenWakeLock = false;
+  video.src = "wakelock.ogv";
+  content.appendChild(video);
+
+  var startDate;
+  function testVideoNoScreenWakeLockListener(topic, state) {
+    info("#3 topic=" + topic + ", state=" + state);
+
+    var locked = state == "locked-foreground" ||
+                 state == "locked-background";
+
+    if (topic == "cpu") {
+      is(locked, lockState_cpu, "#3 Video element locked the cpu");
+      count_cpu++;
+    } else if (topic == "screen") {
+      is(locked, lockState_screen, "#3 Video element locked the screen");
+    }
+
+    if (count_cpu == 1) {
+      info("#3 Cpu is locked");
+      // The next step is to unlock the resource.
+      lockState_cpu = false;
+      video.pause();
+      startDate = new Date();
+    }
+
+    if (count_cpu == 2) {
+      var diffDate = (new Date() - startDate);
+      ok(diffDate > 200, "#3 There was at least 200 milliseconds between the stop and the wakelock release");
+
+      content.removeChild(video);
+      navigator.mozPower.removeWakeLockListener(testVideoNoScreenWakeLockListener);
+      runTests();
+    }
+  }
+
+  navigator.mozPower.addWakeLockListener(testVideoNoScreenWakeLockListener);
+  video.play();
+}
+
+var tests = [ testVideoPlayPause, testVideoPlay, testVideoNoScreenWakeLock ];
 function runTests() {
   if (!tests.length) {
     SimpleTest.finish();
     return;
   }
 
   var test =  tests.pop();
   test();
 };
 
 SpecialPowers.pushPermissions(
   [{'type': 'power', 'allow': true, 'context': document}],
   function() {
-    SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500]]}, runTests);
+    SpecialPowers.pushPrefEnv({"set": [["media.wakelock_timeout", 500],
+                                       ["dom.wakelock.enabled", true]]}, runTests);
   });
 
 SimpleTest.waitForExplicitFinish();
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -137,16 +137,17 @@
 #include "nsISupportsPrimitives.h"
 #include "nsISystemMessagesInternal.h"
 #include "nsITimer.h"
 #include "nsIURIFixup.h"
 #include "nsIWindowWatcher.h"
 #include "nsIXULRuntime.h"
 #include "gfxDrawable.h"
 #include "ImageOps.h"
+#include "mozilla/dom/nsMixedContentBlocker.h"
 #include "nsMemoryInfoDumper.h"
 #include "nsMemoryReporterManager.h"
 #include "nsServiceManagerUtils.h"
 #include "nsStyleSheetService.h"
 #include "nsThreadUtils.h"
 #include "nsToolkitCompsCID.h"
 #include "nsWidgetsCID.h"
 #include "PreallocatedProcessManager.h"
@@ -4171,16 +4172,27 @@ ContentParent::RecvIsSecureURI(const uin
     if (!ourURI) {
         return false;
     }
     nsresult rv = sss->IsSecureURI(type, ourURI, flags, isSecureURI);
     return NS_SUCCEEDED(rv);
 }
 
 bool
+ContentParent::RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive)
+{
+    nsCOMPtr<nsIURI> ourURI = DeserializeURI(aURI);
+    if (!ourURI) {
+        return false;
+    }
+    nsMixedContentBlocker::AccumulateMixedContentHSTS(ourURI, aActive);
+    return true;
+}
+
+bool
 ContentParent::RecvLoadURIExternal(const URIParams& uri)
 {
     nsCOMPtr<nsIExternalProtocolService> extProtService(do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID));
     if (!extProtService) {
         return true;
     }
     nsCOMPtr<nsIURI> ourURI = DeserializeURI(uri);
     if (!ourURI) {
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -621,16 +621,18 @@ private:
     virtual bool DeallocPCrashReporterParent(PCrashReporterParent* crashreporter) override;
 
     virtual bool RecvGetRandomValues(const uint32_t& length,
                                      InfallibleTArray<uint8_t>* randomValues) override;
 
     virtual bool RecvIsSecureURI(const uint32_t& aType, const URIParams& aURI,
                                  const uint32_t& aFlags, bool* aIsSecureURI) override;
 
+    virtual bool RecvAccumulateMixedContentHSTS(const URIParams& aURI, const bool& aActive) override;
+
     virtual bool DeallocPHalParent(PHalParent*) override;
 
     virtual PIccParent* AllocPIccParent(const uint32_t& aServiceId) override;
     virtual bool DeallocPIccParent(PIccParent* aActor) override;
 
     virtual PMemoryReportRequestParent*
     AllocPMemoryReportRequestParent(const uint32_t& aGeneration,
                                     const bool &aAnonymize,
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -746,16 +746,18 @@ parent:
     prio(urgent) sync GetRandomValues(uint32_t length)
         returns (uint8_t[] randomValues);
 
     async GetSystemMemory(uint64_t getterId);
 
     sync IsSecureURI(uint32_t type, URIParams uri, uint32_t flags)
         returns (bool isSecureURI);
 
+    async AccumulateMixedContentHSTS(URIParams uri, bool active);
+
     sync GetLookAndFeelCache()
         returns (LookAndFeelInt[] lookAndFeelIntCache);
 
     prio(urgent) async PHal();
 
     PIcc(uint32_t serviceId);
 
     PMobileConnection(uint32_t clientId);
@@ -783,17 +785,17 @@ parent:
 
     PMedia();
 
     PBluetooth();
 
     PFMRadio();
 
     PWebrtcGlobal();
-    
+
     PPresentation();
 
     // Services remoting
 
     async StartVisitedQuery(URIParams uri);
     async VisitURI(URIParams uri, OptionalURIParams referrer, uint32_t flags);
     async SetURITitle(URIParams uri, nsString title);
 
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -129,16 +129,17 @@ LOCAL_INCLUDES += [
     '/dom/bluetooth/common',
     '/dom/bluetooth/ipc',
     '/dom/devicestorage',
     '/dom/filesystem',
     '/dom/fmradio/ipc',
     '/dom/geolocation',
     '/dom/media/webspeech/synth/ipc',
     '/dom/mobilemessage/ipc',
+    '/dom/security',
     '/dom/storage',
     '/dom/workers',
     '/editor/libeditor',
     '/embedding/components/printingui/ipc',
     '/extensions/cookie',
     '/extensions/spellcheck/src',
     '/gfx/2d',
     '/hal/sandbox',
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -79,17 +79,17 @@ using namespace mozilla::plugins::parent
 
 using namespace CrashReporter;
 #endif
 
 static const char kContentTimeoutPref[] = "dom.ipc.plugins.contentTimeoutSecs";
 static const char kChildTimeoutPref[] = "dom.ipc.plugins.timeoutSecs";
 static const char kParentTimeoutPref[] = "dom.ipc.plugins.parentTimeoutSecs";
 static const char kLaunchTimeoutPref[] = "dom.ipc.plugins.processLaunchTimeoutSecs";
-static const char kAsyncInitPref[] = "dom.ipc.plugins.asyncInit";
+static const char kAsyncInitPref[] = "dom.ipc.plugins.asyncInit.enabled";
 #ifdef XP_WIN
 static const char kHangUITimeoutPref[] = "dom.ipc.plugins.hangUITimeoutSecs";
 static const char kHangUIMinDisplayPref[] = "dom.ipc.plugins.hangUIMinDisplaySecs";
 #define CHILD_TIMEOUT_PREF kHangUITimeoutPref
 #else
 #define CHILD_TIMEOUT_PREF kChildTimeoutPref
 #endif
 
--- a/dom/security/moz.build
+++ b/dom/security/moz.build
@@ -28,17 +28,19 @@ UNIFIED_SOURCES += [
     'nsCSPParser.cpp',
     'nsCSPService.cpp',
     'nsCSPUtils.cpp',
     'nsMixedContentBlocker.cpp',
     'SRICheck.cpp',
     'SRIMetadata.cpp',
 ]
 
+include('/ipc/chromium/chromium-config.mozbuild')
+
 FINAL_LIBRARY = 'xul'
 LOCAL_INCLUDES += [
     '/caps',
     '/netwerk/base',
 ]
 
 if CONFIG['GNU_CC']:
-    CFLAGS += ['-Wshadow', '-Wformat-security']
-    CXXFLAGS += ['-Wshadow', '-Wformat-security']
+    CFLAGS += ['-Wformat-security']
+    CXXFLAGS += ['-Wformat-security']
--- a/dom/security/nsMixedContentBlocker.cpp
+++ b/dom/security/nsMixedContentBlocker.cpp
@@ -27,18 +27,23 @@
 #include "nsIDocumentLoader.h"
 #include "nsIWebNavigation.h"
 #include "nsLoadGroup.h"
 #include "nsIScriptError.h"
 #include "nsIURI.h"
 #include "nsIChannelEventSink.h"
 #include "nsAsyncRedirectVerifyHelper.h"
 #include "mozilla/LoadInfo.h"
+#include "nsISiteSecurityService.h"
 
 #include "mozilla/Logging.h"
+#include "mozilla/Telemetry.h"
+#include "mozilla/dom/ContentChild.h"
+#include "mozilla/ipc/URIUtils.h"
+
 
 using namespace mozilla;
 
 enum nsMixedContentBlockerMessageType {
   eBlocked = 0x00,
   eUserOverride = 0x01
 };
 
@@ -337,17 +342,17 @@ nsMixedContentBlocker::ShouldLoad(uint32
                                   nsISupports* aExtra,
                                   nsIPrincipal* aRequestPrincipal,
                                   int16_t* aDecision)
 {
   // We pass in false as the first parameter to ShouldLoad(), because the
   // callers of this method don't know whether the load went through cached
   // image redirects.  This is handled by direct callers of the static
   // ShouldLoad.
-  nsresult rv = ShouldLoad(false,   //aHadInsecureImageRedirect
+  nsresult rv = ShouldLoad(false,   // aHadInsecureImageRedirect
                            aContentType,
                            aContentLocation,
                            aRequestingLocation,
                            aRequestingContext,
                            aMimeGuess,
                            aExtra,
                            aRequestPrincipal,
                            aDecision);
@@ -376,17 +381,16 @@ nsMixedContentBlocker::ShouldLoad(bool a
   MOZ_ASSERT(aContentType == nsContentUtils::InternalContentPolicyTypeToExternal(aContentType),
              "We should only see external content policy types here.");
 
   // Assume active (high risk) content and blocked by default
   MixedContentTypes classification = eMixedScript;
   // Make decision to block/reject by default
   *aDecision = REJECT_REQUEST;
 
-
   // Notes on non-obvious decisions:
   //
   // TYPE_DTD: A DTD can contain entity definitions that expand to scripts.
   //
   // TYPE_FONT: The TrueType hinting mechanism is basically a scripting
   // language that gets interpreted by the operating system's font rasterizer.
   // Mixed content web fonts are relatively uncommon, and we can can fall back
   // to built-in fonts with minimal disruption in almost all cases.
@@ -713,16 +717,43 @@ nsMixedContentBlocker::ShouldLoad(bool a
   // If there is no securityUI, document doesn't have a security state.
   // Allow load and return early.
   if (!securityUI) {
     *aDecision = nsIContentPolicy::ACCEPT;
     return NS_OK;
   }
   nsresult stateRV = securityUI->GetState(&state);
 
+  // At this point we know that the request is mixed content, and the only
+  // question is whether we block it.  Record telemetry at this point as to
+  // whether HSTS would have fixed things by making the content location
+  // into an HTTPS URL.
+  //
+  // Note that we count this for redirects as well as primary requests. This
+  // will cause some degree of double-counting, especially when mixed content
+  // is not blocked (e.g., for images).  For more detail, see:
+  //   https://bugzilla.mozilla.org/show_bug.cgi?id=1198572#c19
+  //
+  // We do not count requests aHadInsecureImageRedirect=true, since these are
+  // just an artifact of the image caching system.
+  bool active = (classification == eMixedScript);
+  if (!aHadInsecureImageRedirect) {
+    if (XRE_IsParentProcess()) {
+      AccumulateMixedContentHSTS(aContentLocation, active);
+    } else {
+      // Ask the parent process to do the same call
+      mozilla::dom::ContentChild* cc = mozilla::dom::ContentChild::GetSingleton();
+      if (cc) {
+        mozilla::ipc::URIParams uri;
+        SerializeURI(aContentLocation, uri);
+        cc->SendAccumulateMixedContentHSTS(uri, active);
+      }
+    }
+  }
+
   // If the content is display content, and the pref says display content should be blocked, block it.
   if (sBlockMixedDisplay && classification == eMixedDisplay) {
     if (allowMixedContent) {
       LogMixedContentMessage(classification, aContentLocation, rootDoc, eUserOverride);
       *aDecision = nsIContentPolicy::ACCEPT;
       // See if mixed display content has already loaded on the page or if the state needs to be updated here.
       // If mixed display hasn't loaded previously, then we need to call OnSecurityChange() to update the UI.
       if (rootDoc->GetHasMixedDisplayContentLoaded()) {
@@ -852,8 +883,59 @@ nsMixedContentBlocker::ShouldProcess(uin
        return NS_ERROR_FAILURE;
     }
   }
 
   return ShouldLoad(aContentType, aContentLocation, aRequestingLocation,
                     aRequestingContext, aMimeGuess, aExtra, aRequestPrincipal,
                     aDecision);
 }
+
+enum MixedContentHSTSState {
+  MCB_HSTS_PASSIVE_NO_HSTS   = 0,
+  MCB_HSTS_PASSIVE_WITH_HSTS = 1,
+  MCB_HSTS_ACTIVE_NO_HSTS    = 2,
+  MCB_HSTS_ACTIVE_WITH_HSTS  = 3
+};
+
+// Record information on when HSTS would have made mixed content not mixed
+// content (regardless of whether it was actually blocked)
+void
+nsMixedContentBlocker::AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive)
+{
+  // This method must only be called in the parent, because
+  // nsSiteSecurityService is only available in the parent
+  if (!XRE_IsParentProcess()) {
+    MOZ_ASSERT(false);
+    return;
+  }
+
+  bool hsts;
+  nsresult rv;
+  nsCOMPtr<nsISiteSecurityService> sss = do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
+  if (NS_FAILED(rv)) {
+    return;
+  }
+  rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HSTS, aURI, 0, &hsts);
+  if (NS_FAILED(rv)) {
+    return;
+  }
+
+  if (!aActive) {
+    if (!hsts) {
+      Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
+                            MCB_HSTS_PASSIVE_NO_HSTS);
+    }
+    else {
+      Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
+                            MCB_HSTS_PASSIVE_WITH_HSTS);
+    }
+  } else {
+    if (!hsts) {
+      Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
+                            MCB_HSTS_ACTIVE_NO_HSTS);
+    }
+    else {
+      Telemetry::Accumulate(Telemetry::MIXED_CONTENT_HSTS,
+                            MCB_HSTS_ACTIVE_WITH_HSTS);
+    }
+  }
+}
--- a/dom/security/nsMixedContentBlocker.h
+++ b/dom/security/nsMixedContentBlocker.h
@@ -54,13 +54,14 @@ public:
                              uint32_t aContentType,
                              nsIURI* aContentLocation,
                              nsIURI* aRequestingLocation,
                              nsISupports* aRequestingContext,
                              const nsACString& aMimeGuess,
                              nsISupports* aExtra,
                              nsIPrincipal* aRequestPrincipal,
                              int16_t* aDecision);
+  static void AccumulateMixedContentHSTS(nsIURI* aURI, bool aActive);
   static bool sBlockMixedScript;
   static bool sBlockMixedDisplay;
 };
 
 #endif /* nsMixedContentBlocker_h___ */
--- a/dom/system/gonk/NetworkManager.js
+++ b/dom/system/gonk/NetworkManager.js
@@ -481,16 +481,28 @@ NetworkManager.prototype = {
   },
 
   _manageOfflineStatus: true,
 
   networkInterfaces: null,
 
   networkInterfaceLinks: null,
 
+  get allNetworkInfo() {
+    let allNetworkInfo = {};
+
+    for (let networkId in this.networkInterfaces) {
+      if (this.networkInterfaces.hasOwnProperty(networkId)) {
+        allNetworkInfo[networkId] = this.networkInterfaces[networkId].info;
+      }
+    }
+
+    return allNetworkInfo;
+  },
+
   _preferredNetworkType: DEFAULT_PREFERRED_NETWORK_TYPE,
   get preferredNetworkType() {
     return this._preferredNetworkType;
   },
   set preferredNetworkType(val) {
     if ([Ci.nsINetworkInfo.NETWORK_TYPE_WIFI,
          Ci.nsINetworkInfo.NETWORK_TYPE_MOBILE].indexOf(val) == -1) {
       throw "Invalid network type";
--- a/dom/system/gonk/tests/marionette/head.js
+++ b/dom/system/gonk/tests/marionette/head.js
@@ -1,15 +1,16 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_CONTEXT = "chrome";
 
 const SETTINGS_KEY_DATA_ENABLED = "ril.data.enabled";
 const SETTINGS_KEY_DATA_APN_SETTINGS  = "ril.data.apnSettings";
+const SETTINGS_KEY_WIFI_ENABLED = "wifi.enabled";
 
 const TOPIC_CONNECTION_STATE_CHANGED = "network-connection-state-changed";
 const TOPIC_NETWORK_ACTIVE_CHANGED = "network-active-changed";
 
 const NETWORK_STATE_UNKNOWN = Ci.nsINetworkInfo.NETWORK_STATE_UNKNOWN;
 const NETWORK_STATE_CONNECTING = Ci.nsINetworkInfo.NETWORK_STATE_CONNECTING;
 const NETWORK_STATE_CONNECTED = Ci.nsINetworkInfo.NETWORK_STATE_CONNECTED;
 const NETWORK_STATE_DISCONNECTING = Ci.nsINetworkInfo.NETWORK_STATE_DISCONNECTING;
@@ -125,16 +126,44 @@ function waitForObserverEvent(aTopic) {
       deferred.resolve(subject);
     }
   }, aTopic, false);
 
   return deferred.promise;
 }
 
 /**
+ * Wait for one named event.
+ *
+ * Resolve if that named event occurs.  Never reject.
+ *
+ * Fulfill params: the DOMEvent passed.
+ *
+ * @param aEventTarget
+ *        An EventTarget object.
+ * @param aEventName
+ *        A string event name.
+ * @param aMatchFun [optional]
+ *        A matching function returns true or false to filter the event.
+ *
+ * @return A deferred promise.
+ */
+function waitForTargetEvent(aEventTarget, aEventName, aMatchFun) {
+  return new Promise(function(aResolve, aReject) {
+    aEventTarget.addEventListener(aEventName, function onevent(aEvent) {
+      if (!aMatchFun || aMatchFun(aEvent)) {
+        aEventTarget.removeEventListener(aEventName, onevent);
+        ok(true, "Event '" + aEventName + "' got.");
+        aResolve(aEvent);
+      }
+    });
+  });
+}
+
+/**
  * Set the default data connection enabling state, wait for
  * "network-connection-state-changed" event and verify state.
  *
  * Fulfill params: (none)
  *
  * @param aEnabled
  *        A boolean state.
  *
--- a/dom/system/gonk/tests/marionette/manifest.ini
+++ b/dom/system/gonk/tests/marionette/manifest.ini
@@ -9,8 +9,9 @@ disabled = Bug 808783
 [test_ril_code_quality.py]
 [test_screen_state.js]
 [test_dsds_numRadioInterfaces.js]
 [test_data_connection.js]
 [test_network_active_changed.js]
 [test_multiple_data_connection.js]
 [test_data_connection_proxy.js]
 [test_network_interface_list_service.js]
+[test_all_network_info.js]
new file mode 100644
--- /dev/null
+++ b/dom/system/gonk/tests/marionette/test_all_network_info.js
@@ -0,0 +1,106 @@
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
+MARIONETTE_TIMEOUT = 60000;
+MARIONETTE_HEAD_JS = "head.js";
+
+let networkManager =
+  Cc["@mozilla.org/network/manager;1"].getService(Ci.nsINetworkManager);
+ok(networkManager,
+   "networkManager.constructor is " + networkManager.constructor);
+
+let wifiManager = window.navigator.mozWifiManager;
+ok(wifiManager, "wifiManager.constructor is " + wifiManager.constructor);
+
+function setEmulatorAPN() {
+  let apn = [
+    [{"carrier":"T-Mobile US",
+      "apn":"epc.tmobile.com",
+      "mmsc":"http://mms.msg.eng.t-mobile.com/mms/wapenc",
+      "types":["default","supl","mms","ims","dun", "fota"]}]
+  ];
+
+  return setSettings(SETTINGS_KEY_DATA_APN_SETTINGS, apn);
+}
+
+function ensureWifiEnabled(aEnabled) {
+  if (wifiManager.enabled === aEnabled) {
+    log('Already ' + (aEnabled ? 'enabled' : 'disabled'));
+    return Promise.resolve();
+  }
+  return requestWifiEnabled(aEnabled);
+}
+
+function requestWifiEnabled(aEnabled) {
+  let promises = [];
+
+  promises.push(waitForTargetEvent(wifiManager, aEnabled ? 'enabled' : 'disabled',
+    function() {
+      return wifiManager.enabled === aEnabled ? true : false;
+  }));
+  promises.push(setSettings(SETTINGS_KEY_WIFI_ENABLED, aEnabled));
+
+  return Promise.all(promises);
+}
+
+// Test initial State
+function verifyInitialState() {
+  log("= verifyInitialState =");
+
+  // Data and wifi should be off before starting any test.
+  return getSettings(SETTINGS_KEY_DATA_ENABLED)
+    .then(value => {
+      is(value, false, "Data must be off");
+    })
+    .then(() => ensureWifiEnabled(false));
+}
+
+function testAllNetworkInfo(aAnyConnected) {
+  log("= testAllNetworkInfo = " + aAnyConnected);
+
+  let allNetworkInfo = networkManager.allNetworkInfo;
+  ok(allNetworkInfo, "NetworkManager.allNetworkInfo");
+
+  let count = Object.keys(allNetworkInfo).length;
+  ok(count > 0, "NetworkManager.allNetworkInfo count");
+
+  let connected = false;
+  for (let networkId in allNetworkInfo) {
+    if (allNetworkInfo.hasOwnProperty(networkId)) {
+      let networkInfo = allNetworkInfo[networkId];
+      if (networkInfo.state == Ci.nsINetworkInfo.NETWORK_STATE_CONNECTED) {
+        connected = true;
+        break;
+      }
+    }
+  }
+
+  is(aAnyConnected, connected, "NetworkManager.allNetworkInfo any connected");
+}
+
+// Start test
+startTestBase(function() {
+
+  let origApnSettings, origWifiEnabled;
+  return Promise.resolve()
+    .then(() => {
+      origWifiEnabled = wifiManager.enabled;
+    })
+    .then(() => verifyInitialState())
+    .then(() => getSettings(SETTINGS_KEY_DATA_APN_SETTINGS))
+    .then(value => {
+      origApnSettings = value;
+    })
+    .then(() => setEmulatorAPN())
+    .then(() => setDataEnabledAndWait(true))
+    .then(() => testAllNetworkInfo(true))
+    .then(() => setDataEnabledAndWait(false))
+    .then(() => testAllNetworkInfo(false))
+    // Restore original apn settings and wifi state.
+    .then(() => {
+      if (origApnSettings) {
+        return setSettings(SETTINGS_KEY_DATA_APN_SETTINGS, origApnSettings);
+      }
+    })
+    .then(() => ensureWifiEnabled(origWifiEnabled));
+});
--- a/dom/webidl/HTMLVideoElement.webidl
+++ b/dom/webidl/HTMLVideoElement.webidl
@@ -39,15 +39,19 @@ partial interface HTMLVideoElement {
   // Number of presented frames which were painted on screen.
   readonly attribute unsigned long mozPaintedFrames;
 
   // Time which the last painted video frame was late by, in seconds.
   readonly attribute double mozFrameDelay;
 
   // True if the video has an audio track available.
   readonly attribute boolean mozHasAudio;
+
+  // True if the video should use a screen wake lock.
+  [Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
+  attribute boolean mozUseScreenWakeLock;
 };
 
 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
 partial interface HTMLVideoElement {
   [Func="mozilla::dom::MediaSource::Enabled", NewObject]
   VideoPlaybackQuality getVideoPlaybackQuality();
 };
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -646,17 +646,17 @@ nsXBLService::BindingReady(nsIContent* a
 }
 
 nsresult
 nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
                          bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
                          bool* aIsReady, nsXBLBinding** aResult)
 {
   // More than 6 binding URIs are rare, see bug 55070 comment 18.
-  nsAutoTArray<nsIURI*, 6> uris;
+  nsAutoTArray<nsCOMPtr<nsIURI>, 6> uris;
   return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady,
                     aResult, uris);
 }
 
 static bool
 MayBindToContent(nsXBLPrototypeBinding* aProtoBinding, nsIContent* aBoundElement,
                  nsIURI* aURI)
 {
@@ -703,17 +703,17 @@ MayBindToContent(nsXBLPrototypeBinding* 
   // Disallow.
   return false;
 }
 
 nsresult
 nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
                          bool aPeekOnly, nsIPrincipal* aOriginPrincipal,
                          bool* aIsReady, nsXBLBinding** aResult,
-                         nsTArray<nsIURI*>& aDontExtendURIs)
+                         nsTArray<nsCOMPtr<nsIURI>>& aDontExtendURIs)
 {
   NS_ASSERTION(aPeekOnly || aResult,
                "Must have non-null out param if not just peeking to see "
                "whether the binding is ready");
 
   if (aResult)
     *aResult = nullptr;
 
@@ -779,17 +779,17 @@ nsXBLService::GetBinding(nsIContent* aBo
     // be notified when the stylesheets and scripts finish loading.
     protoBinding->AddResourceListener(aBoundElement);
     return NS_ERROR_FAILURE; // The binding isn't ready yet.
   }
 
   rv = protoBinding->ResolveBaseBinding();
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsIURI* baseBindingURI;
+  nsCOMPtr<nsIURI> baseBindingURI;
   nsXBLPrototypeBinding* baseProto = protoBinding->GetBasePrototype();
   if (baseProto) {
     baseBindingURI = baseProto->BindingURI();
   }
   else {
     baseBindingURI = protoBinding->GetBaseBindingURI();
     if (baseBindingURI) {
       uint32_t count = aDontExtendURIs.Length();
@@ -813,28 +813,30 @@ nsXBLService::GetBinding(nsIContent* aBo
           return NS_ERROR_ILLEGAL_VALUE;
         }
       }
     }
   }
 
   nsRefPtr<nsXBLBinding> baseBinding;
   if (baseBindingURI) {
-    nsIContent* child = protoBinding->GetBindingElement();
+    nsCOMPtr<nsIContent> child = protoBinding->GetBindingElement();
     rv = GetBinding(aBoundElement, baseBindingURI, aPeekOnly,
                     child->NodePrincipal(), aIsReady,
                     getter_AddRefs(baseBinding), aDontExtendURIs);
     if (NS_FAILED(rv))
       return rv; // We aren't ready yet.
   }
 
   *aIsReady = true;
 
   if (!aPeekOnly) {
     // Make a new binding
+    protoBinding = docInfo->GetPrototypeBinding(ref);
+    NS_ENSURE_STATE(protoBinding);
     nsXBLBinding *newBinding = new nsXBLBinding(protoBinding);
 
     if (baseBinding) {
       if (!baseProto) {
         protoBinding->SetBasePrototype(baseBinding->PrototypeBinding());
       }
        newBinding->SetBaseBinding(baseBinding);
     }
--- a/dom/xbl/nsXBLService.h
+++ b/dom/xbl/nsXBLService.h
@@ -104,17 +104,17 @@ protected:
    *        and NS_ERROR_ILLEGAL_VALUE is returned.
    *
    * @note This method always calls LoadBindingDocumentInfo(), so it's
    *       enough to funnel all security checks through that function.
    */
   nsresult GetBinding(nsIContent* aBoundElement, nsIURI* aURI,
                       bool aPeekFlag, nsIPrincipal* aOriginPrincipal,
                       bool* aIsReady, nsXBLBinding** aResult,
-                      nsTArray<nsIURI*>& aDontExtendURIs);
+                      nsTArray<nsCOMPtr<nsIURI>>& aDontExtendURIs);
 
 // MEMBER VARIABLES
 public:
   static bool gDisableChromeCache;
   static bool     gAllowDataURIs;            // Whether we should allow data
                                              // urls in -moz-binding. Needed for
                                              // testing.
 };
--- a/ipc/hal/DaemonSocketPDUHelpers.cpp
+++ b/ipc/hal/DaemonSocketPDUHelpers.cpp
@@ -2,45 +2,83 @@
 /* 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 "DaemonSocketPDUHelpers.h"
 #include <limits>
 
+// Enable this constant to abort Gecko on IPC errors. This is helpful
+// for debugging, but should *never* be enabled by default.
+#define MOZ_HAL_ABORT_ON_IPC_ERRORS (0)
+
 #ifdef CHROMIUM_LOG
 #undef CHROMIUM_LOG
 #endif
 
 #if defined(MOZ_WIDGET_GONK)
+
 #include <android/log.h>
-#define CHROMIUM_LOG(args...)  __android_log_print(ANDROID_LOG_INFO, "I/O", args);
+
+#define CHROMIUM_LOG(args...) \
+  __android_log_print(ANDROID_LOG_INFO, "HAL-IPC", args);
+
+#define CHROMIUM_LOG_VA(fmt, ap) \
+  __android_log_vprint(ANDROID_LOG_INFO, "HAL-IPC", fmt, ap);
+
 #else
+
 #include <stdio.h>
+
 #define IODEBUG true
-#define CHROMIUM_LOG(args...) if (IODEBUG) printf(args);
+#define CHROMIUM_LOG(args...) if (IODEBUG) { printf(args); }
+#define CHROMIUM_LOG_VA(fmt, ap) if (IODEBUG) { vprintf(fmt, ap); }
+
 #endif
 
 namespace mozilla {
 namespace ipc {
 namespace DaemonSocketPDUHelpers {
 
 //
+// Logging
+//
+
+namespace detail {
+
+void
+LogProtocolError(const char* aFmt, ...)
+{
+  va_list ap;
+
+  va_start(ap, aFmt);
+  CHROMIUM_LOG_VA(aFmt, ap);
+  va_end(ap);
+
+  if (MOZ_HAL_ABORT_ON_IPC_ERRORS) {
+    MOZ_CRASH("HAL IPC protocol error");
+  }
+}
+
+} // namespace detail
+
+//
 // Conversion
 //
 
 nsresult
 Convert(bool aIn, uint8_t& aOut)
 {
   static const uint8_t sValue[] = {
     [false] = 0x00,
     [true] = 0x01
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sValue))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sValue), bool, uint8_t)) {
     aOut = 0;
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sValue[aIn];
   return NS_OK;
 }
 
 nsresult
@@ -54,57 +92,64 @@ Convert(bool aIn, int32_t& aOut)
   }
   aOut = static_cast<int32_t>(out);
   return NS_OK;
 }
 
 nsresult
 Convert(int aIn, uint8_t& aOut)
 {
-  if (NS_WARN_IF(aIn < std::numeric_limits<uint8_t>::min()) ||
-      NS_WARN_IF(aIn > std::numeric_limits<uint8_t>::max())) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn < std::numeric_limits<uint8_t>::min(), int, uint8_t) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn > std::numeric_limits<uint8_t>::max(), int, uint8_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = static_cast<uint8_t>(aIn);
   return NS_OK;
 }
 
 nsresult
 Convert(int aIn, int16_t& aOut)
 {
-  if (NS_WARN_IF(aIn < std::numeric_limits<int16_t>::min()) ||
-      NS_WARN_IF(aIn > std::numeric_limits<int16_t>::max())) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn < std::numeric_limits<int16_t>::min(), int, int16_t) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn > std::numeric_limits<int16_t>::max(), int, int16_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = static_cast<int16_t>(aIn);
   return NS_OK;
 }
 
 nsresult
 Convert(int aIn, int32_t& aOut)
 {
-  if (NS_WARN_IF(aIn < std::numeric_limits<int32_t>::min()) ||
-      NS_WARN_IF(aIn > std::numeric_limits<int32_t>::max())) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn < std::numeric_limits<int32_t>::min(), int, int32_t) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn > std::numeric_limits<int32_t>::max(), int, int32_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = static_cast<int32_t>(aIn);
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, bool& aOut)
 {
   static const bool sBool[] = {
     [0x00] = false,
     [0x01] = true
   };
-  if (NS_WARN_IF(aIn >= MOZ_ARRAY_LENGTH(sBool))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn >= MOZ_ARRAY_LENGTH(sBool), uint8_t, bool)) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = sBool[aIn];
   return NS_OK;
 }
 
 nsresult
 Convert(uint8_t aIn, char& aOut)
@@ -132,29 +177,31 @@ Convert(uint32_t aIn, int& aOut)
 {
   aOut = static_cast<int>(aIn);
   return NS_OK;
 }
 
 nsresult
 Convert(uint32_t aIn, uint8_t& aOut)
 {
-  if (NS_WARN_IF(aIn < std::numeric_limits<uint8_t>::min()) ||
-      NS_WARN_IF(aIn > std::numeric_limits<uint8_t>::max())) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn < std::numeric_limits<uint8_t>::min(), uint32_t, uint8_t) ||
+      MOZ_HAL_IPC_CONVERT_WARN_IF(
+        aIn > std::numeric_limits<uint8_t>::max(), uint32_t, uint8_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = static_cast<uint8_t>(aIn);
   return NS_OK;
 }
 
 nsresult
 Convert(size_t aIn, uint16_t& aOut)
 {
-  if (NS_WARN_IF(aIn >= (1ul << 16))) {
+  if (MOZ_HAL_IPC_CONVERT_WARN_IF(aIn >= (1ul << 16), size_t, uint16_t)) {
     aOut = 0; // silences compiler warning
     return NS_ERROR_ILLEGAL_VALUE;
   }
   aOut = static_cast<uint16_t>(aIn);
   return NS_OK;
 }
 
 //
@@ -204,29 +251,29 @@ UnpackPDU(DaemonSocketPDU& aPDU, char& a
 nsresult
 UnpackPDU(DaemonSocketPDU& aPDU, nsDependentCString& aOut)
 {
   // We get a pointer to the first character in the PDU, a length
   // of 1 ensures we consume the \0 byte. With 'str' pointing to
   // the string in the PDU, we can copy the actual bytes.
 
   const char* str = reinterpret_cast<const char*>(aPDU.Consume(1));
-  if (NS_WARN_IF(!str)) {
+  if (MOZ_HAL_IPC_UNPACK_WARN_IF(!str, nsDependentCString)) {
     return NS_ERROR_ILLEGAL_VALUE; // end of PDU
   }
 
   const char* end = static_cast<char*>(memchr(str, '\0', aPDU.GetSize() + 1));
-  if (NS_WARN_IF(!end)) {
+  if (MOZ_HAL_IPC_UNPACK_WARN_IF(!end, nsDependentCString)) {
     return NS_ERROR_ILLEGAL_VALUE; // no string terminator
   }
 
   ptrdiff_t len = end - str;
 
   const uint8_t* rest = aPDU.Consume(len);
-  if (NS_WARN_IF(!rest)) {
+  if (MOZ_HAL_IPC_UNPACK_WARN_IF(!rest, nsDependentCString)) {
     // We couldn't consume bytes that should have been there.
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   aOut.Rebind(str, len);
 
   return NS_OK;
 }
@@ -273,16 +320,16 @@ PDUInitOp::WarnAboutTrailingData() const
   if (MOZ_LIKELY(!size)) {
     return;
   }
 
   uint8_t service, opcode;
   uint16_t payloadSize;
   mPDU->GetHeader(service, opcode, payloadSize);
 
-  CHROMIUM_LOG(
+  detail::LogProtocolError(
     "Unpacked PDU of type (%x,%x) still contains %zu Bytes of data.",
     service, opcode, size);
 }
 
 } // namespace DaemonSocketPDUHelpers
 } // namespace ipc
 } // namespace mozilla
--- a/ipc/hal/DaemonSocketPDUHelpers.h
+++ b/ipc/hal/DaemonSocketPDUHelpers.h
@@ -30,16 +30,88 @@ struct DaemonSocketPDUHeader {
   uint8_t mService;
   uint8_t mOpcode;
   uint16_t mLength;
 };
 
 namespace DaemonSocketPDUHelpers {
 
 //
+// Logging
+//
+// The HAL IPC logging macros below print clear error messages for
+// failed IPC operations. Use |MOZ_HAL_IPC_CONVERT_WARN_IF|,
+// |MOZ_HAL_IPC_PACK_WARN_IF| and |MOZ_HAL_IPC_UNPACK_WARN_IF| to
+// test for failures when processing PDUs.
+//
+// All macros accept the test condition as their first argument, and
+// additional type information: the convert macro takes the input and
+// output types, the pack macro takes the input type, and the unpack
+// macro takes output type. All macros return the result of the test
+// condition. If the test fails (i.e., the condition is true), they
+// output a warning to the log.
+//
+// Don't call the functions in the detail namespace. They are helpers
+// and not for general use.
+//
+
+namespace detail {
+
+void
+LogProtocolError(const char*, ...);
+
+inline bool
+ConvertWarnIfImpl(const char* aFile, unsigned long aLine,
+                  bool aCondition, const char* aExpr, const char* aIn,
+                  const char* aOut)
+{
+  if (MOZ_UNLIKELY(aCondition)) {
+    LogProtocolError("%s:%d: Convert('%s' to '%s') failed: %s",
+                     aFile, aLine, aIn, aOut, aExpr);
+  }
+  return aCondition;
+}
+
+inline bool
+PackWarnIfImpl(const char* aFile, unsigned long aLine,
+               bool aCondition, const char* aExpr, const char* aIn)
+{
+  if (MOZ_UNLIKELY(aCondition)) {
+    LogProtocolError("%s:%d: Pack('%s') failed: %s",
+                     aFile, aLine, aIn, aExpr);
+  }
+  return aCondition;
+}
+
+inline bool
+UnpackWarnIfImpl(const char* aFile, unsigned long aLine,
+                 bool aCondition, const char* aExpr, const char* aOut)
+{
+  if (MOZ_UNLIKELY(aCondition)) {
+    LogProtocolError("%s:%d: Unpack('%s') failed: %s",
+                     aFile, aLine, aOut, aExpr);
+  }
+  return aCondition;
+}
+
+} // namespace detail
+
+#define MOZ_HAL_IPC_CONVERT_WARN_IF(condition, in, out) \
+  ::mozilla::ipc::DaemonSocketPDUHelpers::detail:: \
+    ConvertWarnIfImpl(__FILE__, __LINE__, condition, #condition, #in, #out)
+
+#define MOZ_HAL_IPC_PACK_WARN_IF(condition, in) \
+  ::mozilla::ipc::DaemonSocketPDUHelpers::detail:: \
+    PackWarnIfImpl(__FILE__, __LINE__, condition, #condition, #in)
+
+#define MOZ_HAL_IPC_UNPACK_WARN_IF(condition, out) \
+  ::mozilla::ipc::DaemonSocketPDUHelpers::detail:: \
+    UnpackWarnIfImpl(__FILE__, __LINE__, condition, #condition, #out)
+
+//
 // Conversion
 //
 // PDUs can only store primitive data types, such as integers or
 // byte arrays. Gecko often uses more complex data types, such as
 // enumators or stuctures. Conversion functions convert between
 // primitive data and internal Gecko's data types during a PDU's
 // packing and unpacking.
 //
--- a/js/src/jit/arm/CodeGenerator-arm.cpp
+++ b/js/src/jit/arm/CodeGenerator-arm.cpp
@@ -542,22 +542,24 @@ CodeGeneratorARM::visitDivI(LDivI* ins)
     MDiv* mir = ins->mir();
 
     Label done;
     divICommon(mir, lhs, rhs, output, ins->snapshot(), done);
 
     if (mir->canTruncateRemainder()) {
         masm.ma_sdiv(lhs, rhs, output);
     } else {
-        ScratchRegisterScope scratch(masm);
-        masm.ma_sdiv(lhs, rhs, scratch);
-        masm.ma_mul(scratch, rhs, temp);
-        masm.ma_cmp(lhs, temp);
+        {
+            ScratchRegisterScope scratch(masm);
+            masm.ma_sdiv(lhs, rhs, temp);
+            masm.ma_mul(temp, rhs, scratch);
+            masm.ma_cmp(lhs, scratch);
+        }
         bailoutIf(Assembler::NotEqual, ins->snapshot());
-        masm.ma_mov(scratch, output);
+        masm.ma_mov(temp, output);
     }
 
     masm.bind(&done);
 }
 
 extern "C" {
     extern MOZ_EXPORT int64_t __aeabi_idivmod(int,int);
     extern MOZ_EXPORT int64_t __aeabi_uidivmod(int,int);
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -3665,17 +3665,17 @@ GetScrollClipIntersection(nsDisplayListB
       return DisplayItemClip();
     }
 
     nsIScrollableFrame* scrollFrame = nsLayoutUtils::GetScrollableFrameFor(f);
     if (!scrollFrame) {
       continue;
     }
 
-    const DisplayItemClip* clip = scrollFrame->ComputeScrollClip(aIsCaret);
+    Maybe<DisplayItemClip> clip = scrollFrame->ComputeScrollClip(aIsCaret);
     if (clip) {
       resultClip.IntersectWith(*clip);
     }
   }
   return resultClip;
 }
 
 /*
@@ -4537,17 +4537,17 @@ ContainerState::SetupScrollingMetadata(N
 
     Maybe<FrameMetricsAndClip> info =
       scrollFrame->ComputeFrameMetrics(aEntry->mLayer, mContainerReferenceFrame, mParameters, aEntry->mIsCaret);
     if (!info) {
       continue;
     }
 
     FrameMetrics& metrics = info->metrics;
-    const DisplayItemClip* clip = info->clip;
+    Maybe<DisplayItemClip> clip = info->clip;
 
     if (clip &&
         clip->HasClip() &&
         clip->GetRoundedRectCount() > 0)
     {
       // The clip in between this scrollframe and its ancestor scrollframe
       // requires a mask layer. Since this mask layer should not move with
       // the APZC associated with this FrameMetrics, we attach the mask
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1801,18 +1801,16 @@ ScrollFrameHelper::ScrollFrameHelper(nsC
   , mScrollGeneration(++sScrollGenerationCounter)
   , mDestination(0, 0)
   , mScrollPosAtLastPaint(0, 0)
   , mRestorePos(-1, -1)
   , mLastPos(-1, -1)
   , mResolution(1.0)
   , mScrollPosForLayerPixelAlignment(-1, -1)
   , mLastUpdateImagesPos(-1, -1)
-  , mAncestorClip(nullptr)
-  , mAncestorClipForCaret(nullptr)
   , mNeverHasVerticalScrollbar(false)
   , mNeverHasHorizontalScrollbar(false)
   , mHasVerticalScrollbar(false)
   , mHasHorizontalScrollbar(false)
   , mFrameIsUpdatingScrollbar(false)
   , mDidHistoryRestore(false)
   , mIsRoot(aIsRoot)
   , mClipAllDescendants(aIsRoot)
@@ -2781,18 +2779,18 @@ ScrollFrameHelper::BuildDisplayList(nsDi
         mScrollPosForLayerPixelAlignment = mScrollPosAtLastPaint;
       }
     } else {
       mScrollPosForLayerPixelAlignment = nsPoint(-1,-1);
     }
   }
 
   // Clear the scroll port clip that was set during the last paint.
-  mAncestorClip = nullptr;
-  mAncestorClipForCaret = nullptr;
+  mAncestorClip = Nothing();
+  mAncestorClipForCaret = Nothing();
 
   // We put non-overlay scrollbars in their own layers when this is the root
   // scroll frame and we are a toplevel content document. In this situation,
   // the scrollbar(s) would normally be assigned their own layer anyway, since
   // they're not scrolled with the rest of the document. But when both
   // scrollbars are visible, the layer's visible rectangle would be the size
   // of the viewport, so most layer implementations would create a layer buffer
   // that's much larger than necessary. Creating independent layers for each
@@ -3023,30 +3021,30 @@ ScrollFrameHelper::BuildDisplayList(nsDi
       }
     }
 
     Maybe<DisplayListClipState::AutoSaveRestore> clipStateNonCaret;
     if (usingDisplayport) {
       // Capture the clip state of the parent scroll frame. This will be saved
       // on FrameMetrics for layers with this frame as their animated geoemetry
       // root.
-      mAncestorClipForCaret = aBuilder->ClipState().GetCurrentCombinedClip(aBuilder);
+      mAncestorClipForCaret = ToMaybe(aBuilder->ClipState().GetCurrentCombinedClip(aBuilder));
 
       // Add the non-caret content box clip here so that it gets picked up by
       // mAncestorClip.
       if (contentBoxClipForNonCaretContent) {
         clipStateNonCaret.emplace(aBuilder);
         clipStatePtr = &*clipStateNonCaret;
         if (mClipAllDescendants) {
           clipStateNonCaret->ClipContentDescendants(*contentBoxClipForNonCaretContent);
         } else {
           clipStateNonCaret->ClipContainingBlockDescendants(*contentBoxClipForNonCaretContent);
         }
       }
-      mAncestorClip = aBuilder->ClipState().GetCurrentCombinedClip(aBuilder);
+      mAncestorClip = ToMaybe(aBuilder->ClipState().GetCurrentCombinedClip(aBuilder));
 
       // If we are using a display port, then ignore any pre-existing clip
       // passed down from our parents. The pre-existing clip would just defeat
       // the purpose of a display port which is to paint regions that are not
       // currently visible so that they can be brought into view asynchronously.
       // Notes:
       //   - The pre-existing clip state will be restored when the
       //     AutoSaveRestore goes out of scope, so there is no permanent change
@@ -3116,22 +3114,22 @@ ScrollFrameHelper::BuildDisplayList(nsDi
     }
   }
   // Now display overlay scrollbars and the resizer, if we have one.
   AppendScrollPartsTo(aBuilder, aDirtyRect, scrolledContent, usingDisplayport,
                       createLayersForScrollbars, true);
   scrolledContent.MoveTo(aLists);
 }
 
-const DisplayItemClip*
+Maybe<DisplayItemClip>
 ScrollFrameHelper::ComputeScrollClip(bool aIsForCaret) const
 {
-  const DisplayItemClip* ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
+  const Maybe<DisplayItemClip>& ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
   if (!mShouldBuildScrollableLayer || mIsScrollableLayerInRootContainer) {
-    return nullptr;
+    return Nothing();
   }
 
   return ancestorClip;
 }
 
 Maybe<FrameMetricsAndClip>
 ScrollFrameHelper::ComputeFrameMetrics(Layer* aLayer,
                                        nsIFrame* aContainerReferenceFrame,
@@ -3143,17 +3141,17 @@ ScrollFrameHelper::ComputeFrameMetrics(L
   }
 
   bool needsParentLayerClip = true;
   if (gfxPrefs::LayoutUseContainersForRootFrames() && !mAddClipRectToLayer) {
     // For containerful frames, the clip is on the container frame.
     needsParentLayerClip = false;
   }
 
-  const DisplayItemClip* ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
+  const Maybe<DisplayItemClip>& ancestorClip = aIsForCaret ? mAncestorClipForCaret : mAncestorClip;
 
   nsPoint toReferenceFrame = mOuter->GetOffsetToCrossDoc(aContainerReferenceFrame);
   bool isRootContent = mIsRoot && mOuter->PresContext()->IsRootContentDocument();
 
   Maybe<nsRect> parentLayerClip;
   if (needsParentLayerClip) {
     nsRect clip = nsRect(mScrollPort.TopLeft() + toReferenceFrame,
                          nsLayoutUtils::CalculateCompositionSizeForFrame(mOuter));
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -377,17 +377,17 @@ public:
       mLastSmoothScrollOrigin = nullptr;
     }
   }
   bool WantAsyncScroll() const;
   Maybe<FrameMetricsAndClip> ComputeFrameMetrics(
     Layer* aLayer, nsIFrame* aContainerReferenceFrame,
     const ContainerLayerParameters& aParameters,
     bool aIsForCaret) const;
-  virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const;
+  virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const;
 
   // nsIScrollbarMediator
   void ScrollByPage(nsScrollbarFrame* aScrollbar, int32_t aDirection,
                     nsIScrollbarMediator::ScrollSnapMode aSnap
                       = nsIScrollbarMediator::DISABLE_SNAP);
   void ScrollByWhole(nsScrollbarFrame* aScrollbar, int32_t aDirection,
                      nsIScrollbarMediator::ScrollSnapMode aSnap
                        = nsIScrollbarMediator::DISABLE_SNAP);
@@ -456,19 +456,19 @@ public:
 
   // The scroll position where we last updated image visibility.
   nsPoint mLastUpdateImagesPos;
 
   nsRect mPrevScrolledRect;
 
   FrameMetrics::ViewID mScrollParentID;
 
-  // The scroll port clip. Only valid during painting.
-  const DisplayItemClip* mAncestorClip;
-  const DisplayItemClip* mAncestorClipForCaret;
+  // The scroll port clip.
+  Maybe<DisplayItemClip> mAncestorClip;
+  Maybe<DisplayItemClip> mAncestorClipForCaret;
 
   bool mNeverHasVerticalScrollbar:1;
   bool mNeverHasHorizontalScrollbar:1;
   bool mHasVerticalScrollbar:1;
   bool mHasHorizontalScrollbar:1;
   bool mFrameIsUpdatingScrollbar:1;
   bool mDidHistoryRestore:1;
   // Is this the scrollframe for the document's viewport?
@@ -840,17 +840,17 @@ public:
   }
   virtual mozilla::Maybe<mozilla::FrameMetricsAndClip> ComputeFrameMetrics(
     Layer* aLayer, nsIFrame* aContainerReferenceFrame,
     const ContainerLayerParameters& aParameters,
     bool aIsForCaret) const override
   {
     return mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, aParameters, aIsForCaret);
   }
-  virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const override
+  virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const override
   {
     return mHelper.ComputeScrollClip(aIsForCaret);
   }
   virtual bool IsIgnoringViewportClipping() const override {
     return mHelper.IsIgnoringViewportClipping();
   }
   virtual void MarkScrollbarsDirtyForReflow() const override {
     mHelper.MarkScrollbarsDirtyForReflow();
@@ -1240,17 +1240,17 @@ public:
   }
   virtual mozilla::Maybe<mozilla::FrameMetricsAndClip> ComputeFrameMetrics(
     Layer* aLayer, nsIFrame* aContainerReferenceFrame,
     const ContainerLayerParameters& aParameters,
     bool aIsForCaret) const override
   {
     return mHelper.ComputeFrameMetrics(aLayer, aContainerReferenceFrame, aParameters, aIsForCaret);
   }
-  virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const override
+  virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const override
   {
     return mHelper.ComputeScrollClip(aIsForCaret);
   }
   virtual bool IsIgnoringViewportClipping() const override {
     return mHelper.IsIgnoringViewportClipping();
   }
   virtual void MarkScrollbarsDirtyForReflow() const override {
     mHelper.MarkScrollbarsDirtyForReflow();
--- a/layout/generic/nsIScrollableFrame.h
+++ b/layout/generic/nsIScrollableFrame.h
@@ -6,16 +6,17 @@
 /*
  * interface that provides scroll APIs implemented by scrollable frames
  */
 
 #ifndef nsIScrollFrame_h___
 #define nsIScrollFrame_h___
 
 #include "nsCoord.h"
+#include "DisplayItemClip.h"
 #include "ScrollbarStyles.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/gfx/Point.h"
 #include "nsIScrollbarMediator.h"
 #include "Units.h"
 #include "FrameMetrics.h"
 
 #define NS_DEFAULT_VERTICAL_SCROLL_DISTANCE   3
@@ -27,25 +28,24 @@ class nsIFrame;
 class nsPresContext;
 class nsIContent;
 class nsRenderingContext;
 class nsIAtom;
 class nsDisplayListBuilder;
 
 namespace mozilla {
 struct ContainerLayerParameters;
-class DisplayItemClip;
 namespace layers {
 class Layer;
 } // namespace layers
 
 struct FrameMetricsAndClip
 {
   layers::FrameMetrics metrics;
-  const DisplayItemClip* clip;
+  mozilla::Maybe<DisplayItemClip> clip;
 };
 
 } // namespace mozilla
 
 /**
  * Interface for frames that are scrollable. This interface exposes
  * APIs for examining scroll state, observing changes to scroll state,
  * and triggering scrolling.
@@ -444,12 +444,12 @@ public:
   virtual void SetTransformingByAPZ(bool aTransforming) = 0;
   virtual bool IsTransformingByAPZ() const = 0;
 
   /**
    * Whether or not this frame uses containerful scrolling.
    */
   virtual bool UsesContainerScrolling() const = 0;
 
-  virtual const mozilla::DisplayItemClip* ComputeScrollClip(bool aIsForCaret) const = 0;
+  virtual mozilla::Maybe<mozilla::DisplayItemClip> ComputeScrollClip(bool aIsForCaret) const = 0;
 };
 
 #endif
--- a/media/libstagefright/binding/H264.cpp
+++ b/media/libstagefright/binding/H264.cpp
@@ -21,17 +21,16 @@ class BitReader
 public:
   explicit BitReader(const mozilla::MediaByteBuffer* aBuffer)
     : mBitReader(aBuffer->Elements(), aBuffer->Length())
   {
   }
 
   uint32_t ReadBits(size_t aNum)
   {
-    MOZ_ASSERT(mBitReader.numBitsLeft());
     MOZ_ASSERT(aNum <= 32);
     if (mBitReader.numBitsLeft() < aNum) {
       return 0;
     }
     return mBitReader.getBits(aNum);
   }
 
   uint32_t ReadBit()
@@ -43,17 +42,20 @@ public:
   uint32_t ReadUE()
   {
     uint32_t i = 0;
 
     while (ReadBit() == 0 && i < 32) {
       i++;
     }
     if (i == 32) {
-      MOZ_ASSERT(false);
+      // This can happen if the data is invalid, or if it's
+      // short, since ReadBit() will return 0 when it runs
+      // off the end of the buffer.
+      NS_WARNING("Invalid H.264 data");
       return 0;
     }
     uint32_t r = ReadBits(i);
     r += (1 << i) - 1;
     return r;
   }
 
   // Read signed integer Exp-Golomb-coded.
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -2538,19 +2538,19 @@ pref("dom.ipc.plugins.reportCrashURL", t
 
 // How long we wait before unloading an idle plugin process.
 // Defaults to 30 seconds.
 pref("dom.ipc.plugins.unloadTimeoutSecs", 30);
 
 // Asynchronous plugin initialization should only be enabled on non-e10s
 // channels until some remaining bugs are resolved.
 #ifdef E10S_TESTING_ONLY
-pref("dom.ipc.plugins.asyncInit", false);
+pref("dom.ipc.plugins.asyncInit.enabled", false);
 #else
-pref("dom.ipc.plugins.asyncInit", true);
+pref("dom.ipc.plugins.asyncInit.enabled", true);
 #endif
 
 pref("dom.ipc.processCount", 1);
 
 // Enable caching of Moz2D Path objects for SVG geometry elements
 pref("svg.path-caching.enabled", true);
 
 // Enable the use of display-lists for SVG hit-testing and painting.
--- a/testing/marionette/dispatcher.js
+++ b/testing/marionette/dispatcher.js
@@ -42,17 +42,17 @@ this.Dispatcher = function(connId, trans
 
   // callback for when connection is closed
   this.onclose = null;
 
   // transport hooks are Dispatcher.prototype.onPacket
   // and Dispatcher.prototype.onClosed
   this.conn.hooks = this;
 
-  this.emulator = new Emulator(msg => this.sendResponse(msg, -1));
+  this.emulator = new Emulator(msg => this.send(msg, -1));
   this.driver = driverFactory(this.emulator);
   this.commandProcessor = new CommandProcessor(this.driver);
 
   this.stopSignal_ = stopSignal;
 };
 
 /**
  * Debugger transport callback that dispatches the request.
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -27,17 +27,16 @@ TEST_HARNESS_BINS := \
   GenerateOCSPResponse$(BIN_SUFFIX) \
   fix_stack_using_bpsyms.py \
   $(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 TEST_HARNESS_BINS += \
   crashinject$(BIN_SUFFIX) \
   crashinjectdll$(DLL_SUFFIX) \
-  vmwarerecordinghelper$(DLL_SUFFIX) \
   $(NULL)
 endif
 
 ifeq ($(OS_ARCH),Darwin)
 TEST_HARNESS_BINS += fix_macosx_stack.py
 endif
 
 ifeq ($(OS_ARCH),Linux)
--- a/testing/mochitest/mochitest_options.py
+++ b/testing/mochitest/mochitest_options.py
@@ -25,19 +25,16 @@ try:
         MachCommandConditions as conditions,
     )
     build_obj = MozbuildObject.from_environment(cwd=here)
 except ImportError:
     build_obj = None
     conditions = None
 
 
-VMWARE_RECORDING_HELPER_BASENAME = "vmwarerecordinghelper"
-
-
 class ArgumentContainer():
     __metaclass__ = ABCMeta
 
     @abstractproperty
     def args(self):
         pass
 
     @abstractproperty
@@ -285,24 +282,16 @@ class MochitestArguments(ArgumentContain
           "suppress": True,
           }],
         [["--testing-modules-dir"],
          {"dest": "testingModulesDir",
           "default": None,
           "help": "Directory where testing-only JS modules are located.",
           "suppress": True,
           }],
-        [["--use-vmware-recording"],
-         {"action": "store_true",
-          "dest": "vmwareRecording",
-          "default": False,
-          "help": "Enables recording while the application is running inside a VMware "
-                  "Workstation 7.0 or later VM.",
-          "suppress": True,
-          }],
         [["--repeat"],
          {"type": int,
           "default": 0,
           "help": "Repeat the tests the given number of times.",
           }],
         [["--run-until-failure"],
          {"action": "store_true",
           "dest": "runUntilFailure",
@@ -622,26 +611,16 @@ class MochitestArguments(ArgumentContain
         elif build_obj:
             options.certPath = os.path.join(build_obj.topsrcdir, 'build', 'pgo', 'certs')
 
         if options.symbolsPath and len(urlparse(options.symbolsPath).scheme) < 2:
             options.symbolsPath = self.get_full_path(options.symbolsPath, parser.oldcwd)
         elif not options.symbolsPath and build_obj:
             options.symbolsPath = os.path.join(build_obj.distdir, 'crashreporter-symbols')
 
-        if options.vmwareRecording:
-            if not mozinfo.isWin:
-                parser.error(
-                    "use-vmware-recording is only supported on Windows.")
-            options.vmwareHelperPath = os.path.join(
-                options.utilityPath, VMWARE_RECORDING_HELPER_BASENAME + ".dll")
-            if not os.path.exists(options.vmwareHelperPath):
-                parser.error("%s not found, cannot automate VMware recording." %
-                             options.vmwareHelperPath)
-
         if options.webapprtContent and options.webapprtChrome:
             parser.error(
                 "Only one of --webapprt-content and --webapprt-chrome may be given.")
 
         if options.jsdebugger:
             options.extraPrefs += [
                 "devtools.debugger.remote-enabled=true",
                 "devtools.chrome.enabled=true",
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1212,17 +1212,16 @@ def parseKeyValue(strings, separator='='
             (context, ','.join(missing)), errors=missing)
     return [string.split(separator, 1) for string in strings]
 
 
 class Mochitest(MochitestUtilsMixin):
     _active_tests = None
     certdbNew = False
     sslTunnel = None
-    vmwareHelper = None
     DEFAULT_TIMEOUT = 60.0
     mediaDevices = None
 
     # XXX use automation.py for test name to avoid breaking legacy
     # TODO: replace this with 'runtests.py' or 'mochitest' or the like
     test_name = 'automation.py'
 
     def __init__(self, logger_options):
@@ -1619,47 +1618,16 @@ class Mochitest(MochitestUtilsMixin):
                 self.killAndGetStack(
                     processPID,
                     utilityPath,
                     debuggerInfo,
                     dump_screen=not debuggerInfo)
 
         return foundZombie
 
-    def startVMwareRecording(self, options):
-        """ starts recording inside VMware VM using the recording helper dll """
-        assert mozinfo.isWin
-        from ctypes import cdll
-        self.vmwareHelper = cdll.LoadLibrary(self.vmwareHelperPath)
-        if self.vmwareHelper is None:
-            self.log.warning("runtests.py | Failed to load "
-                             "VMware recording helper")
-            return
-        self.log.info("runtests.py | Starting VMware recording.")
-        try:
-            self.vmwareHelper.StartRecording()
-        except Exception as e:
-            self.log.warning("runtests.py | Failed to start "
-                             "VMware recording: (%s)" % str(e))
-            self.vmwareHelper = None
-
-    def stopVMwareRecording(self):
-        """ stops recording inside VMware VM using the recording helper dll """
-        try:
-            assert mozinfo.isWin
-            if self.vmwareHelper is not None:
-                self.log.info("runtests.py | Stopping VMware recording.")
-                self.vmwareHelper.StopRecording()
-        except Exception as e:
-            self.log.warning("runtests.py | Failed to stop "
-                             "VMware recording: (%s)" % str(e))
-            self.log.exception('Error stopping VMWare recording')
-
-        self.vmwareHelper = None
-
     def runApp(self,
                testUrl,
                env,
                app,
                profile,
                extraArgs,
                utilityPath,
                debuggerInfo=None,
@@ -2237,19 +2205,16 @@ class Mochitest(MochitestUtilsMixin):
             # then again to actually run mochitest
             if options.timeout:
                 timeout = options.timeout + 30
             elif options.debugger or not options.autorun:
                 timeout = None
             else:
                 timeout = 330.0  # default JS harness timeout is 300 seconds
 
-            if options.vmwareRecording:
-                self.startVMwareRecording(options)
-
             # detect shutdown leaks for m-bc runs
             detectShutdownLeaks = mozinfo.info[
                 "debug"] and options.browserChrome and not options.webapprtChrome
 
             self.log.info("runtests.py | Running tests: start.\n")
             try:
                 status = self.runApp(testURL,
                                      self.browserEnv,
@@ -2271,18 +2236,16 @@ class Mochitest(MochitestUtilsMixin):
                 status = -1
             except:
                 traceback.print_exc()
                 self.log.error(
                     "Automation Error: Received unexpected exception while running application\n")
                 status = 1
 
         finally:
-            if options.vmwareRecording:
-                self.stopVMwareRecording()
             self.stopServers()
 
         mozleak.process_leak_log(
             self.leak_report_file,
             leak_thresholds=options.leakThresholds,
             ignore_missing_leaks=options.ignoreMissingLeaks,
             log=self.log,
         )
--- a/testing/mozharness/scripts/b2g_build.py
+++ b/testing/mozharness/scripts/b2g_build.py
@@ -109,16 +109,20 @@ class B2GBuild(LocalesMixin, PurgeMixin,
         [["--complete-mar-url"], {
             "dest": "complete_mar_url",
             "help": "the URL where the complete MAR was uploaded. Required if submit-to-balrog is requested and upload isn't.",
         }],
         [["--platform"], {
             "dest": "platform",
             "help": "the platform used by balrog submmiter.",
         }],
+        [["--gecko-objdir"], {
+            "dest": "gecko_objdir",
+            "help": "Specifies the gecko object directory.",
+        }],
     ]
 
     def __init__(self, require_config_file=False, config={},
                  all_actions=all_actions,
                  default_actions=default_actions):
         # Default configuration
         default_config = {
             'default_vcs': 'hgtool',
@@ -152,17 +156,18 @@ class B2GBuild(LocalesMixin, PurgeMixin,
             config_options=self.config_options,
             require_config_file=require_config_file,
             config=default_config,
             all_actions=all_actions,
             default_actions=default_actions,
         )
 
         dirs = self.query_abs_dirs()
-        self.objdir = os.path.join(dirs['work_dir'], 'objdir-gecko')
+        self.objdir = self.config.get("gecko_objdir",
+                os.path.join(dirs['work_dir'], 'objdir-gecko'))
         self.abs_dirs['abs_obj_dir'] = self.objdir
         if self.config.get("update_type", "ota") == "fota":
             self.make_updates_cmd = ['./build.sh', 'gecko-update-fota']
             self.extra_update_attrs = 'isOsUpdate="true"'
             self.isOSUpdate = True
         else:
             self.make_updates_cmd = ['./build.sh', 'gecko-update-full']
             self.extra_update_attrs = None
@@ -552,16 +557,19 @@ class B2GBuild(LocalesMixin, PurgeMixin,
             env['L10NBASEDIR'] = dirs['abs_l10n_dir']
             env['MOZ_CHROME_MULTILOCALE'] = " ".join(self.query_locales())
             if 'PATH' not in env:
                 env['PATH'] = os.environ.get('PATH')
             env['PATH'] += ':%s' % os.path.join(dirs['compare_locales_dir'], 'scripts')
             env['PYTHONPATH'] = os.environ.get('PYTHONPATH', '')
             env['PYTHONPATH'] += ':%s' % os.path.join(dirs['compare_locales_dir'], 'lib')
 
+        with open(os.path.join(dirs['work_dir'], '.userconfig'), 'w') as cfg:
+            cfg.write('GECKO_OBJDIR={0}'.format(self.objdir))
+
         self.enable_mock()
         if self.config['ccache']:
             self.run_command('ccache -z', cwd=dirs['work_dir'], env=env)
         for cmd in cmds:
             retval = self.run_command(cmd, cwd=dirs['work_dir'], env=env, error_list=B2GMakefileErrorList)
             if retval != 0:
                 break
         if self.config['ccache']:
--- a/testing/taskcluster/scripts/builder/build-emulator-x86.sh
+++ b/testing/taskcluster/scripts/builder/build-emulator-x86.sh
@@ -20,42 +20,48 @@ test $TARGET
 MANIFEST=${MANIFEST:="$WORKSPACE/gecko/b2g/config/$TARGET/sources.xml"}
 
 tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
 
 # Ensure symlink has been created to gecko...
 rm -f $WORKSPACE/B2G/gecko
 ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
 
+### Install package dependencies
+install-packages.sh $WORKSPACE/gecko
+
 debug_flag=""
 if [ 0$B2G_DEBUG -ne 0 ]; then
   debug_flag='--debug'
 fi
 
 rm -rf $WORKSPACE/B2G/out/target/product/generic_x86/tests/
 
+gecko_objdir=/home/worker/objdir-gecko/objdir
+
 $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
   --config b2g/taskcluster-emulator.py \
   "$debug_flag" \
   --disable-mock \
   --work-dir=$WORKSPACE/B2G \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
-  --repo=$WORKSPACE/gecko
+  --repo=$WORKSPACE/gecko \
+  --gecko-objdir=$gecko_objdir
 
 # Move files into artifact locations!
 mkdir -p $HOME/artifacts
 
 ls -lah $WORKSPACE/B2G/out
-ls -lah $WORKSPACE/B2G/objdir-gecko/dist/
+ls -lah $gecko_objdir/dist/
 
 mv $WORKSPACE/B2G/sources.xml $HOME/artifacts/sources.xml
 mv $WORKSPACE/B2G/out/target/product/generic_x86/tests/gaia-tests.zip $HOME/artifacts/gaia-tests.zip
 for name in common cppunittest reftest mochitest xpcshell web-platform; do
-    mv $WORKSPACE/B2G/objdir-gecko/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
+    mv $gecko_objdir/dist/*.$name.tests.zip $HOME/artifacts/target.$name.tests.zip ;
 done
-mv $WORKSPACE/B2G/objdir-gecko/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
+mv $gecko_objdir/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
 mv $WORKSPACE/B2G/out/emulator.tar.gz $HOME/artifacts/emulator.tar.gz
-mv $WORKSPACE/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
+mv $gecko_objdir/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
 
 ccache -s
--- a/testing/taskcluster/scripts/builder/build-emulator.sh
+++ b/testing/taskcluster/scripts/builder/build-emulator.sh
@@ -22,42 +22,48 @@ if [ -z "$MANIFEST" ]; then
 fi
 
 tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
 
 # Ensure symlink has been created to gecko...
 rm -f $WORKSPACE/B2G/gecko
 ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
 
+### Install package dependencies
+install-packages.sh $WORKSPACE/gecko
+
 debug_flag=""
 if [ 0$B2G_DEBUG -ne 0 ]; then
   debug_flag='--debug'
 fi
 
 rm -rf $WORKSPACE/B2G/out/target/product/generic/tests/
 
+gecko_objdir=/home/worker/objdir-gecko/objdir
+
 $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
   --config b2g/taskcluster-emulator.py \
   "$debug_flag" \
   --disable-mock \
   --work-dir=$WORKSPACE/B2G \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
-  --repo=$WORKSPACE/gecko
+  --repo=$WORKSPACE/gecko \
+  --gecko-objdir=$gecko_objdir
 
 # Move files into artifact locations!
 mkdir -p $HOME/artifacts
 
 ls -lah $WORKSPACE/B2G/out
-ls -lah $WORKSPACE/B2G/objdir-gecko/dist/
+ls -lah $gecko_objdir/dist/
 
 mv $WORKSPACE/B2G/sources.xml $HOME/artifacts/sources.xml
 mv $WORKSPACE/B2G/out/target/product/generic/tests/gaia-tests.zip $HOME/artifacts/gaia-tests.zip
 for name in common cppunittest reftest mochitest xpcshell web-platform; do
-    mv $WORKSPACE/B2G/objdir-gecko/dist/*.$name.tests.zip  $HOME/artifacts/target.$name.tests.zip ;
+    mv $gecko_objdir/dist/*.$name.tests.zip  $HOME/artifacts/target.$name.tests.zip ;
 done
-mv $WORKSPACE/B2G/objdir-gecko/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
+mv $gecko_objdir/dist/test_packages_tc.json $HOME/artifacts/test_packages.json
 mv $WORKSPACE/B2G/out/emulator.tar.gz $HOME/artifacts/emulator.tar.gz
-mv $WORKSPACE/B2G/objdir-gecko/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
+mv $gecko_objdir/dist/b2g-*.crashreporter-symbols.zip $HOME/artifacts/b2g-crashreporter-symbols.zip
 
 ccache -s
--- a/testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
+++ b/testing/taskcluster/scripts/phone-builder/build-phone-ota.sh
@@ -1,15 +1,15 @@
 #! /bin/bash -vex
 
 . pre-build.sh
 
 if [ $TARGET == "aries" -o $TARGET == "shinano" ]; then
   # caching objects might be dangerous for some devices (aka aries)
-  rm -rf $WORKSPACE/B2G/objdir*
+  rm -rf $gecko_objdir
   rm -rf $WORKSPACE/B2G/out
 fi
 
 PLATFORM=${TARGET%%-*}
 
 aws s3 cp s3://b2g-nightly-credentials/balrog_credentials .
 mar_file=b2g-$PLATFORM-gecko-update.mar
 
@@ -35,11 +35,12 @@ rm -rf $WORKSPACE/B2G/upload/
   --work-dir=$WORKSPACE/B2G \
   --gaia-languages-file locales/languages_all.json \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
   --repo=$WORKSPACE/gecko \
   --platform $PLATFORM \
+  --gecko-objdir=$gecko_objdir \
   --complete-mar-url https://queue.taskcluster.net/v1/task/$TASK_ID/runs/$RUN_ID/artifacts/public/build/$mar_file
 
 . post-build.sh
--- a/testing/taskcluster/scripts/phone-builder/build-phone.sh
+++ b/testing/taskcluster/scripts/phone-builder/build-phone.sh
@@ -1,15 +1,15 @@
 #! /bin/bash -vex
 
 . pre-build.sh
 
 if [ $TARGET == "aries" -o $TARGET == "shinano" ]; then
   # caching objects might be dangerous for some devices (aka aries)
-  rm -rf $WORKSPACE/B2G/objdir*
+  rm -rf $gecko_objdir
   rm -rf $WORKSPACE/B2G/out
 fi
 
 MOZHARNESS_CONFIG=${MOZHARNESS_CONFIG:=b2g/taskcluster-phone.py}
 
 rm -rf $WORKSPACE/B2G/upload/
 
 $WORKSPACE/gecko/testing/mozharness/scripts/b2g_build.py \
@@ -18,11 +18,12 @@ rm -rf $WORKSPACE/B2G/upload/
   --disable-mock \
   --variant=$VARIANT \
   --work-dir=$WORKSPACE/B2G \
   --gaia-languages-file locales/languages_all.json \
   --log-level=debug \
   --target=$TARGET \
   --b2g-config-dir=$TARGET \
   --checkout-revision=$GECKO_HEAD_REV \
-  --repo=$WORKSPACE/gecko
+  --repo=$WORKSPACE/gecko \
+  --gecko-objdir=$gecko_objdir
 
 . post-build.sh
--- a/testing/taskcluster/scripts/phone-builder/pre-build.sh
+++ b/testing/taskcluster/scripts/phone-builder/pre-build.sh
@@ -1,16 +1,18 @@
 #!/bin/bash -vex
 
 # Ensure all the scripts in this dir are on the path....
 DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
 PATH=$DIRNAME:$PATH
 
 WORKSPACE=$1
 
+gecko_objdir=/home/worker/objdir-gecko/objdir
+
 ### Check that require variables are defined
 test -d $WORKSPACE
 test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
 test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
 test $GECKO_HEAD_REV # Should be an hg revision to pull down
 test $TARGET
 test $VARIANT
 
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_debug.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'aries'
     build_type: 'debug'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-aries-debug'
+    - 'docker-worker:cache:build-aries-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Aries Debug'
 
   payload:
     cache:
       build-aries-debug: /home/worker/workspace
+      build-aries-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'aries'
       DEBUG: 0
       VARIANT: userdebug
       GAIA_OPTIMIZE: '1'
       B2G_SYSTEM_APPS: '1'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
     command:
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_dogfood.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_dogfood.yml
@@ -3,19 +3,21 @@
   variables:
     build_name: 'aries-dogfood'
     build_type: 'debug'
 task:
   metadata:
     name: '[TC] B2G Aries Dogfood'
   scopes:
     - 'docker-worker:cache:build-aries-spark-dogfood'
+    - 'docker-worker:cache:build-aries-spark-dogfood-objdir-gecko-{{project}}'
   payload:
     cache:
       build-aries-spark-dogfood: /home/worker/workspace
+      build-aries-spark-dogfood-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: userdebug
       DOGFOOD: 1
       HARDWARE_COMPOSER: 0
       MOZHARNESS_CONFIG: b2g/taskcluster-spark-dogfood.py
   extra:
     treeherderEnv:
       - production
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_eng.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_eng.yml
@@ -1,22 +1,24 @@
 $inherits:
   from: 'tasks/builds/b2g_phone_eng_base.yml'
   variables:
     build_name: 'aries-eng'
     build_type: 'opt'
 task:
   scopes:
     - 'docker-worker:cache:build-aries-eng'
+    - 'docker-worker:cache:build-aries-eng-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Aries Eng'
 
   payload:
     cache:
       build-aries-eng: /home/worker/workspace
+      build-aries-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'aries'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_opt.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'aries'
     build_type: 'opt'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-aries-opt'
+    - 'docker-worker:cache:build-aries-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Aries Opt'
 
   payload:
     cache:
       build-aries-opt: /home/worker/workspace
+      build-aries-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'aries'
       DEBUG: 0
       VARIANT: user
       GAIA_OPTIMIZE: '1'
       B2G_SYSTEM_APPS: '1'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
     command:
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_debug.yml
@@ -3,15 +3,17 @@
   variables:
     build_name: 'aries-ota'
     build_type: 'debug'
 task:
   metadata:
     name: '[TC] B2G Aries OTA (userdebug)'
   scopes:
     - 'docker-worker:cache:build-aries-spark-ota-debug'
+    - 'docker-worker:cache:build-aries-spark-ota-debug-objdir-gecko-{{project}}'
   payload:
     cache:
       build-aries-spark-ota-debug: /home/worker/workspace
+      build-aries-spark-ota-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: userdebug
       B2G_DEBUG: 0
 
--- a/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_aries_spark_ota_opt.yml
@@ -3,14 +3,16 @@
   variables:
     build_name: 'aries-ota'
     build_type: 'opt'
 task:
   metadata:
     name: '[TC] B2G Aries OTA (user)'
   scopes:
     - 'docker-worker:cache:build-aries-spark-ota-user'
+    - 'docker-worker:cache:build-aries-spark-ota-user-objdir-gecko-{{project}}'
   payload:
     cache:
       build-aries-spark-ota-user: /home/worker/workspace
+      build-aries-spark-ota-user-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: user
 
--- a/testing/taskcluster/tasks/builds/b2g_emulator_base.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_base.yml
@@ -1,15 +1,21 @@
 $inherits:
   from: 'tasks/builds/b2g_base.yml'
 task:
+  scopes:
+    - 'docker-worker:cache:tooltool-cache'
+
   metadata:
     description: |
       Android emulators + b2g environment used in full stack testing.
   payload:
+    cache:
+      tooltool-cache: '/home/worker/tooltool-cache'
+
     env:
       TARGET: 'emulator'
       B2G_DEBUG: 0
       REPO_TRACE: 1
 
     # Emulators can take a very long time to build!
     maxRunTime: 14400
 
--- a/testing/taskcluster/tasks/builds/b2g_emulator_ics_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_ics_debug.yml
@@ -2,24 +2,27 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-ics'
     build_type: 'debug'
 task:
   workerType: emulator-ics-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-ics-debug'
+    - 'docker-worker:cache:workspace-emulator-ics-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator ICS Debug'
   extra:
     treeherder:
       collection:
         debug: true
       machine:
         platform: b2g-emu-ics
 
 
   payload:
     cache:
       workspace-emulator-ics-debug: /home/worker/workspace
+      workspace-emulator-ics-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator'
       B2G_DEBUG: 1
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-ics/releng-emulator-ics.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_ics_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_ics_opt.yml
@@ -5,22 +5,25 @@
     build_name: 'emulator-ics'
 task:
   workerType: emulator-ics
   routes:
     - 'index.buildbot.branches.{{project}}.emulator-ics'
     - 'index.buildbot.revisions.{{head_rev}}.{{project}}.emulator-ics'
   scopes:
     - 'docker-worker:cache:workspace-emulator-ics-opt'
+    - 'docker-worker:cache:workspace-emulator-ics-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator ICS Opt'
 
   extra:
     treeherder:
       machine:
         platform: b2g-emu-ics
 
   payload:
     cache:
       workspace-emulator-ics-opt: /home/worker/workspace
+      workspace-emulator-ics-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
 
     env:
       TARGET: 'emulator'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-ics/releng-emulator-ics.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_jb_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_jb_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-jb'
     build_type: 'debug'
 task:
   workerType: emulator-jb-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-jb-debug'
+    - 'docker-worker:cache:workspace-emulator-jb-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator JB (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,11 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-jb
 
   payload:
     cache:
       workspace-emulator-jb-debug: /home/worker/workspace
+      workspace-emulator-jb-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-jb'
       B2G_DEBUG: 1
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-jb/releng-emulator-jb.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_jb_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_jb_opt.yml
@@ -2,26 +2,29 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-jb'
     build_type: 'opt'
 task:
   workerType: emulator-jb
   scopes:
     - 'docker-worker:cache:workspace-emulator-jb-opt'
+    - 'docker-worker:cache:workspace-emulator-jb-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G JB Emulator: (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     # Disable "TC" prefix...
     treeherder:
       groupSymbol: "?"
       machine:
         platform: b2g-emu-jb
 
   payload:
     cache:
       workspace-emulator-jb-opt: /home/worker/workspace
+      workspace-emulator-jb-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-jb'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-jb/releng-emulator-jb.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_kk_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_kk_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-kk'
     build_type: 'debug'
 task:
   workerType: emulator-kk-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-debug'
+    - 'docker-worker:cache:workspace-emulator-kk-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator KK (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,11 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-kk
 
   payload:
     cache:
       workspace-emulator-kk-debug: /home/worker/workspace
+      workspace-emulator-kk-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-kk'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-kk/releng-emulator-kk.tt'
       B2G_DEBUG: 1
--- a/testing/taskcluster/tasks/builds/b2g_emulator_kk_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_kk_opt.yml
@@ -5,26 +5,29 @@
     build_type: 'opt'
 task:
   workerType: emulator-kk
   routes:
     - 'index.buildbot.branches.{{project}}.emulator-kk'
     - 'index.buildbot.revisions.{{head_rev}}.{{project}}.emulator-kk'
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-opt'
+    - 'docker-worker:cache:workspace-emulator-kk-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G KK Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       # Disable "TC" prefix...
       groupSymbol: "?"
       machine:
         platform: b2g-emu-kk
 
   payload:
     cache:
       workspace-emulator-kk-opt: /home/worker/workspace
+      workspace-emulator-kk-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-kk'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-kk/releng-emulator-kk.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_l_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_l_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-l'
     build_type: 'debug'
 task:
   workerType: emulator-l-debug
   scopes:
     - 'docker-worker:cache:workspace-emulator-l-debug'
+    - 'docker-worker:cache:workspace-emulator-l-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Emulator L (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,11 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-l
 
   payload:
     cache:
       workspace-emulator-l-debug: /home/worker/workspace
+      workspace-emulator-l-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-l'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-l/releng-emulator-l.tt'
       B2G_DEBUG: 1
--- a/testing/taskcluster/tasks/builds/b2g_emulator_l_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_l_opt.yml
@@ -2,26 +2,29 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-l'
     build_type: 'opt'
 task:
   workerType: emulator-l
   scopes:
     - 'docker-worker:cache:workspace-emulator-l-opt'
+    - 'docker-worker:cache:workspace-emulator-l-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G L Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       # Disable "TC" prefix...
       groupSymbol: "?"
       machine:
         platform: b2g-emu-l
 
   payload:
     cache:
       workspace-emulator-l-opt: /home/worker/workspace
+      workspace-emulator-l-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-l'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-l/releng-emulator-l.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_debug.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_x86_base.yml'
   variables:
     build_name: 'emulator-x86-kk'
     build_type: 'debug'
 task:
   workerType: emulator-x86-kk
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-x86-debug'
+    - 'docker-worker:cache:workspace-emulator-kk-x86-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G KK X86 Emulator (Debug)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
@@ -20,11 +21,13 @@ task:
       collection:
         debug: true
       machine:
         platform: b2g-emu-x86-kk
 
   payload:
     cache:
       workspace-emulator-kk-x86-debug: /home/worker/workspace
+      workspace-emulator-kk-x86-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-x86-kk'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-kk/releng-emulator-kk.tt'
       B2G_DEBUG: 1
--- a/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_x86_kk_opt.yml
@@ -2,26 +2,29 @@
   from: 'tasks/builds/b2g_emulator_x86_base.yml'
   variables:
     build_name: 'emulator-x86-kk'
     build_type: 'opt'
 task:
   workerType: emulator-x86-kk
   scopes:
     - 'docker-worker:cache:workspace-emulator-kk-x86-opt'
+    - 'docker-worker:cache:workspace-emulator-kk-x86-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G KK X86 Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       # Disable "TC" prefix...
       groupSymbol: "?"
       machine:
         platform: b2g-emu-x86-kk
 
   payload:
     cache:
       workspace-emulator-kk-x86-opt: /home/worker/workspace
+      workspace-emulator-kk-x86-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-x86-kk'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-kk/releng-emulator-kk.tt'
--- a/testing/taskcluster/tasks/builds/b2g_emulator_x86_l_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_emulator_x86_l_opt.yml
@@ -2,16 +2,17 @@
   from: 'tasks/builds/b2g_emulator_base.yml'
   variables:
     build_name: 'emulator-x86-l'
     build_type: 'opt'
 task:
   workerType: emulator-l
   scopes:
     - 'docker-worker:cache:workspace-emulator-l-x86-opt'
+    - 'docker-worker:cache:workspace-emulator-l-x86-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G X86 L Emulator (Opt)'
 
   extra:
     treeherderEnv:
       - staging
     treeherder:
       # Disable "TC" prefix...
@@ -25,10 +26,12 @@ task:
       - -c
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/builder &&
         buildbot_step 'Build' ./build-emulator-x86.sh $HOME/workspace
 
     cache:
       workspace-emulator-l-x86-opt: /home/worker/workspace
+      workspace-emulator-l-x86-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'emulator-x86-l'
+      TOOLTOOL_MANIFEST: 'b2g/config/emulator-x86-l/releng-emulator-l.tt'
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_debug.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'flame-kk'
     build_type: 'debug'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-flame-kk-debug'
+    - 'docker-worker:cache:build-flame-kk-debug-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Debug'
 
   payload:
     cache:
       build-flame-kk-debug: /home/worker/workspace
+      build-flame-kk-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
       DEBUG: 0
       VARIANT: userdebug
     command:
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_eng.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_eng.yml
@@ -1,22 +1,24 @@
 $inherits:
   from: 'tasks/builds/b2g_phone_eng_base.yml'
   variables:
     build_name: 'flame-kk-eng'
     build_type: 'opt'
 task:
   scopes:
     - 'docker-worker:cache:build-flame-kk-eng'
+    - 'docker-worker:cache:build-flame-kk-eng-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Eng'
 
   payload:
     cache:
       build-flame-kk-eng: /home/worker/workspace
+      build-flame-kk-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
   extra:
     treeherderEnv:
       - production
       - staging
     treeherder:
       symbol: Be
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_opt.yml
@@ -2,22 +2,24 @@
   from: 'tasks/builds/b2g_phone_base.yml'
   variables:
     build_name: 'flame-kk'
     build_type: 'opt'
 task:
   workerType: flame-kk
   scopes:
     - 'docker-worker:cache:build-flame-kk-opt'
+    - 'docker-worker:cache:build-flame-kk-opt-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Opt'
 
   payload:
     cache:
       build-flame-kk-opt: /home/worker/workspace
+      build-flame-kk-opt-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
       DEBUG: 0
     command:
       - >
         checkout-gecko workspace &&
         cd ./workspace/gecko/testing/taskcluster/scripts/phone-builder &&
         buildbot_step 'Build' ./build-phone.sh $HOME/workspace
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_debug.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_debug.yml
@@ -3,15 +3,17 @@
   variables:
     build_name: 'flame-kk-ota'
     build_type: 'debug'
 task:
   metadata:
     name: '[TC] B2G Flame KK OTA (userdebug)'
   scopes:
     - 'docker-worker:cache:build-flame-kk-ota-debug'
+    - 'docker-worker:cache:build-flame-kk-ota-debug-objdir-gecko-{{project}}'
 
   payload:
     cache:
-        build-flame-kk-ota-debug: /home/worker/workspace
+      build-flame-kk-ota-debug: /home/worker/workspace
+      build-flame-kk-ota-debug-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: userdebug
       B2G_DEBUG: 0
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_opt.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_ota_opt.yml
@@ -3,14 +3,16 @@
   variables:
     build_name: 'flame-kk-ota'
     build_type: 'opt'
 task:
   metadata:
     name: '[TC] B2G Flame KK OTA (user)'
   scopes:
     - 'docker-worker:cache:build-flame-kk-ota-user'
+    - 'docker-worker:cache:build-flame-kk-ota-user-objdir-gecko-{{project}}'
 
   payload:
     cache:
       build-flame-kk-ota-user: /home/worker/workspace
+      build-flame-kk-ota-user-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       VARIANT: user
--- a/testing/taskcluster/tasks/builds/b2g_flame_kk_spark_eng.yml
+++ b/testing/taskcluster/tasks/builds/b2g_flame_kk_spark_eng.yml
@@ -1,22 +1,24 @@
 $inherits:
   from: 'tasks/builds/b2g_phone_eng_base.yml'
   variables:
     build_name: 'flame-kk-spark-eng'
     build_type: 'opt'
 task:
   scopes:
     - 'docker-worker:cache:build-flame-kk-spark-eng'
+    - 'docker-worker:cache:build-flame-kk-spark-eng-objdir-gecko-{{project}}'
   metadata:
     name: '[TC] B2G Flame KK Eng (spark)'
 
   payload:
     cache:
       build-flame-kk-spark-eng: /home/worker/workspace
+      build-flame-kk-spark-eng-objdir-gecko-{{project}}: /home/worker/objdir-gecko
     env:
       TARGET: 'flame-kk'
       MOZHARNESS_CONFIG: b2g/taskcluster-spark.py
   extra:
     treeherderEnv:
       - staging
     treeherder:
       symbol: Be
--- a/toolkit/components/passwordmgr/test/browser/browser.ini
+++ b/toolkit/components/passwordmgr/test/browser/browser.ini
@@ -7,14 +7,15 @@ support-files =
 [browser_DOMFormHasPassword.js]
 [browser_DOMInputPasswordAdded.js]
 [browser_filldoorhanger.js]
 [browser_notifications.js]
 skip-if = true # Intermittent failures: Bug 1182296, bug 1148771
 [browser_passwordmgr_editing.js]
 skip-if = os == "linux"
 [browser_context_menu.js]
+skip-if = os == "linux"
 [browser_passwordmgr_contextmenu.js]
 [browser_passwordmgr_fields.js]
 [browser_passwordmgr_observers.js]
 [browser_passwordmgr_sort.js]
 [browser_passwordmgr_switchtab.js]
 [browser_passwordmgrdlg.js]
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -7329,16 +7329,23 @@
     "description": "Accumulates type of content (mixed, mixed passive, unmixed) per page load"
   },
   "MIXED_CONTENT_UNBLOCK_COUNTER": {
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 3,
     "description": "A simple counter of daily mixed-content unblock operations and top documents loaded"
   },
+  "MIXED_CONTENT_HSTS": {
+    "alert_emails": ["seceng@mozilla.org"],
+    "expires_in_version": "never",
+    "kind": "enumerated",
+    "n_values": 10,
+    "description": "How often would blocked mixed content be allowed if HSTS upgrades were allowed? 0=display/no-HSTS, 1=display/HSTS, 2=active/no-HSTS, 3=active/HSTS"
+  },
   "NTLM_MODULE_USED_2": {
     "expires_in_version": "never",
     "kind": "enumerated",
     "n_values": 8,
     "description": "The module used for the NTLM protocol (Windows_API, Kerberos, Samba_auth or Generic) and whether or not the authentication was used to connect to a proxy server. This data is collected only once per session (at first NTLM authentification) ; fixed version."
   },
   "FX_THUMBNAILS_BG_QUEUE_SIZE_ON_CAPTURE": {
     "expires_in_version": "default",
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -106,17 +106,17 @@ const DEFAULT_ENVIRONMENT_PREFS = new Ma
   ["browser.startup.homepage", {what: RECORD_PREF_STATE}],
   ["browser.startup.page", {what: RECORD_PREF_VALUE}],
   ["browser.urlbar.suggest.searches", {what: RECORD_PREF_VALUE}],
   ["browser.urlbar.unifiedcomplete", {what: RECORD_PREF_VALUE}],
   ["browser.urlbar.userMadeSearchSuggestionsChoice", {what: RECORD_PREF_VALUE}],
   ["devtools.chrome.enabled", {what: RECORD_PREF_VALUE}],
   ["devtools.debugger.enabled", {what: RECORD_PREF_VALUE}],
   ["devtools.debugger.remote-enabled", {what: RECORD_PREF_VALUE}],
-  ["dom.ipc.plugins.asyncInit", {what: RECORD_PREF_VALUE}],
+  ["dom.ipc.plugins.asyncInit.enabled", {what: RECORD_PREF_VALUE}],
   ["dom.ipc.plugins.enabled", {what: RECORD_PREF_VALUE}],
   ["dom.ipc.processCount", {what: RECORD_PREF_VALUE, requiresRestart: true}],
   ["experiments.manifest.uri", {what: RECORD_PREF_VALUE}],
   ["extensions.autoDisableScopes", {what: RECORD_PREF_VALUE}],
   ["extensions.enabledScopes", {what: RECORD_PREF_VALUE}],
   ["extensions.blocklist.enabled", {what: RECORD_PREF_VALUE}],
   ["extensions.blocklist.url", {what: RECORD_PREF_VALUE}],
   ["extensions.strictCompatibility", {what: RECORD_PREF_VALUE}],
--- a/toolkit/components/telemetry/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/TelemetrySession.jsm
@@ -51,17 +51,17 @@ const MIN_SUBSESSION_LENGTH_MS = Prefere
 #expand const HISTOGRAMS_FILE_VERSION = "__HISTOGRAMS_FILE_VERSION__";
 
 const LOGGER_NAME = "Toolkit.Telemetry";
 const LOGGER_PREFIX = "TelemetrySession" + (Utils.isContentProcess ? "#content::" : "::");
 
 const PREF_BRANCH = "toolkit.telemetry.";
 const PREF_PREVIOUS_BUILDID = PREF_BRANCH + "previousBuildID";
 const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-const PREF_ASYNC_PLUGIN_INIT = "dom.ipc.plugins.asyncInit";
+const PREF_ASYNC_PLUGIN_INIT = "dom.ipc.plugins.asyncInit.enabled";
 const PREF_UNIFIED = PREF_BRANCH + "unified";
 
 
 const MESSAGE_TELEMETRY_PAYLOAD = "Telemetry:Payload";
 const MESSAGE_TELEMETRY_GET_CHILD_PAYLOAD = "Telemetry:GetChildPayload";
 
 const DATAREPORTING_DIRECTORY = "datareporting";
 const ABORTED_SESSION_FILE_NAME = "aborted-session-ping";
--- a/widget/cocoa/VibrancyManager.mm
+++ b/widget/cocoa/VibrancyManager.mm
@@ -206,16 +206,22 @@ enum {
   NSVisualEffectStateInactive
 };
 
 enum {
   NSVisualEffectMaterialTitlebar = 3
 };
 #endif
 
+#if !defined(MAC_OS_X_VERSION_10_11) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_11
+enum {
+  NSVisualEffectMaterialMenu = 5
+};
+#endif
+
 static NSUInteger
 VisualEffectStateForVibrancyType(VibrancyType aType)
 {
   switch (aType) {
     case VibrancyType::TOOLTIP:
     case VibrancyType::MENU:
     case VibrancyType::HIGHLIGHTED_MENUITEM:
     case VibrancyType::SHEET:
@@ -258,23 +264,24 @@ VibrancyManager::CreateEffectView(Vibran
   Class EffectViewClass = HasVibrantForeground(aType)
     ? EffectViewClassWithForegroundVibrancy : EffectViewClassWithoutForegroundVibrancy;
   NSView* effectView = [[EffectViewClass alloc] initWithFrame:aRect];
   [effectView performSelector:@selector(setAppearance:)
                    withObject:AppearanceForVibrancyType(aType)];
   [effectView setState:VisualEffectStateForVibrancyType(aType)];
 
   if (aType == VibrancyType::MENU) {
-    // NSVisualEffectMaterialTitlebar doesn't match the native menu look
-    // perfectly but comes pretty close. Ideally we'd use a material with
-    // materialTypeName "MacLight", since that's what menus use, but there's
-    // no entry with that material in the internalMaterialType-to-
-    // CGSWindowBackdropViewSpec table which NSVisualEffectView consults when
-    // setting up the effect.
-    [effectView setMaterial:NSVisualEffectMaterialTitlebar];
+    if (nsCocoaFeatures::OnElCapitanOrLater()) {
+      [effectView setMaterial:NSVisualEffectMaterialMenu];
+    } else {
+      // Before 10.11 there is no material that perfectly matches the menu
+      // look. Of all available material types, NSVisualEffectMaterialTitlebar
+      // is the one that comes closest.
+      [effectView setMaterial:NSVisualEffectMaterialTitlebar];
+    }
   } else if (aType == VibrancyType::HIGHLIGHTED_MENUITEM) {
     [effectView setMaterial:NSVisualEffectMaterialMenuItem];
     if ([effectView respondsToSelector:@selector(setEmphasized:)]) {
       [effectView setEmphasized:YES];
     }
   }
 
   return effectView;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -6560,17 +6560,17 @@ HandleEvent(CGEventTapProxy aProxy, CGEv
   CFRunLoopStop(CFRunLoopGetCurrent());
 }
 
 - (void)shutdownAndReleaseCalledOnAnyThread
 {
   [self performSelector:@selector(shutdownAndReleaseCalledOnEventThread) onThread:mThread withObject:nil waitUntilDone:NO];
 }
 
-static const CGEventField kCGWindowNumberField = 51;
+static const CGEventField kCGWindowNumberField = (const CGEventField) 51;
 
 // Called on scroll thread
 - (void)handleEvent:(CGEventRef)cgEvent type:(CGEventType)type
 {
   if (type != kCGEventScrollWheel) {
     return;
   }
 
--- a/widget/cocoa/nsCocoaFeatures.h
+++ b/widget/cocoa/nsCocoaFeatures.h
@@ -17,16 +17,17 @@ public:
   static int32_t OSXVersion();
   static int32_t OSXVersionMajor();
   static int32_t OSXVersionMinor();
   static int32_t OSXVersionBugFix();
   static bool OnLionOrLater();
   static bool OnMountainLionOrLater();
   static bool OnMavericksOrLater();
   static bool OnYosemiteOrLater();
+  static bool OnElCapitanOrLater();
   static bool AccelerateByDefault();
 
   static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
 
   // These are utilities that do not change or depend on the value of mOSXVersion
   // and instead just encapsulate the encoding algorithm.  Note that GetVersion
   // actually adjusts to the lowest supported OS, so it will always return
   // a "supported" version.  GetSystemVersion does not make any modifications.
--- a/widget/cocoa/nsCocoaFeatures.mm
+++ b/widget/cocoa/nsCocoaFeatures.mm
@@ -13,16 +13,17 @@
 
 #define MAC_OS_X_VERSION_MASK      0x0000FFFF
 #define MAC_OS_X_VERSION_10_0_HEX  0x00001000
 #define MAC_OS_X_VERSION_10_6_HEX  0x00001060
 #define MAC_OS_X_VERSION_10_7_HEX  0x00001070
 #define MAC_OS_X_VERSION_10_8_HEX  0x00001080
 #define MAC_OS_X_VERSION_10_9_HEX  0x00001090
 #define MAC_OS_X_VERSION_10_10_HEX 0x000010A0
+#define MAC_OS_X_VERSION_10_11_HEX 0x000010B0
 
 #include "nsCocoaFeatures.h"
 #include "nsCocoaUtils.h"
 #include "nsDebug.h"
 #include "nsObjCExceptions.h"
 
 #import <Cocoa/Cocoa.h>
 
@@ -168,16 +169,22 @@ nsCocoaFeatures::OnMavericksOrLater()
 
 /* static */ bool
 nsCocoaFeatures::OnYosemiteOrLater()
 {
     return (OSXVersion() >= MAC_OS_X_VERSION_10_10_HEX);
 }
 
 /* static */ bool
+nsCocoaFeatures::OnElCapitanOrLater()
+{
+    return (OSXVersion() >= MAC_OS_X_VERSION_10_11_HEX);
+}
+
+/* static */ bool
 nsCocoaFeatures::AccelerateByDefault()
 {
     return IsAtLeastVersion(10, 6, 3);
 }
 
 /* static */ bool
 nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
 {