Merge mozilla-central to fx-team
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 09 Mar 2015 13:50:49 +0100
changeset 232508 e98ebcdcf9314acd68ed2213dd24910737ab9990
parent 232507 c5fc760d1401e861224b676bb58b2c8f8cef1862 (current diff)
parent 232498 23f1f0369df522227a1218d08137124bd74540e3 (diff)
child 232509 563608e9ff4d7b41ccec3fad021b559bc8b878b7
push id28385
push userkwierso@gmail.com
push dateTue, 10 Mar 2015 00:38:43 +0000
treeherdermozilla-central@d164b59f3b94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to fx-team
browser/app/profile/firefox.js
--- a/b2g/config/dolphin/sources.xml
+++ b/b2g/config/dolphin/sources.xml
@@ -10,25 +10,25 @@
   <!--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="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
   <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="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="83760d213fb3bec7b4117d266fcfbf6fe2ba14ab"/>
   <project name="device/common" path="device/common" revision="6a2995683de147791e516aae2ccb31fdfbe2ad30"/>
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -14,23 +14,23 @@
   <!--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="173b3104bfcbd23fc9dccd4b0035fc49aae3d444">
     <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="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="97c3d9b8b87774ca7a08c89145e95b55652459ef"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
   <project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="425f8b5fadf5889834c5acd27d23c9e0b2129c28"/>
   <project name="device/common" path="device/common" revision="42b808b7e93d0619286ae8e59110b176b7732389"/>
   <project name="device/sample" path="device/sample" revision="237bd668d0f114d801a8d6455ef5e02cc3577587"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
   <project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="52a1a862a8bac319652b8f82d9541ba40bfa45ce"/>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -12,20 +12,20 @@
   <!--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="4efd19d199ae52656604f794c5a77518400220fd">
     <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="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <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"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
--- a/b2g/config/emulator-kk/sources.xml
+++ b/b2g/config/emulator-kk/sources.xml
@@ -10,25 +10,25 @@
   <!--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="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
   <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="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="f92a936f2aa97526d4593386754bdbf02db07a12"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="6e47ff2790f5656b5b074407829ceecf3e6188c4"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="1950e4760fa14688b83cdbb5acaa1af9f82ef434"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="ac6eb97a37035c09fb5ede0852f0881e9aadf9ad"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="737f591c5f95477148d26602c7be56cbea0cdeb9"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="51da9b1981be481b92a59a826d4d78dc73d0989a"/>
   <project name="device/common" path="device/common" revision="798a3664597e6041985feab9aef42e98d458bc3d"/>
--- a/b2g/config/emulator-l/sources.xml
+++ b/b2g/config/emulator-l/sources.xml
@@ -10,25 +10,25 @@
   <!--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="52775e03a2d8532429dff579cb2cd56718e488c3">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
   <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="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <!-- Stock Android things -->
   <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="50d1ca4ab8add54523b7bc692860d57e8ee4c0d1"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="fb3845864573857677f9b500040a8f011eaf5078"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="354496e8eddd28c743d8e02c02eeab02958367e6"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="b37c91354272b7413a0dc058b7445e677921d39e"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="a227c92e0170bcf2296a63386956946b0dd78ca7"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="884626610186b6dbea52cec5194b1c4bcfe1cb98"/>
   <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="29f9b82faa1af9730f52e933dca848546cbea84c"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -14,23 +14,23 @@
   <!--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="173b3104bfcbd23fc9dccd4b0035fc49aae3d444">
     <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="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="93f9ba577f68d772093987c2f1c0a4ae293e1802"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="97c3d9b8b87774ca7a08c89145e95b55652459ef"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
   <project name="platform_bionic" path="bionic" remote="b2g" revision="e2b3733ba3fa5e3f404e983d2e4142b1f6b1b846"/>
   <project name="platform/bootable/recovery" path="bootable/recovery" revision="425f8b5fadf5889834c5acd27d23c9e0b2129c28"/>
   <project name="device/common" path="device/common" revision="42b808b7e93d0619286ae8e59110b176b7732389"/>
   <project name="device/sample" path="device/sample" revision="237bd668d0f114d801a8d6455ef5e02cc3577587"/>
   <project name="platform_external_apriori" path="external/apriori" remote="b2g" revision="11816ad0406744f963537b23d68ed9c2afb412bd"/>
   <project name="platform/external/bluetooth/bluez" path="external/bluetooth/bluez" revision="52a1a862a8bac319652b8f82d9541ba40bfa45ce"/>
--- a/b2g/config/flame-kk/sources.xml
+++ b/b2g/config/flame-kk/sources.xml
@@ -10,25 +10,25 @@
   <!--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="ef937d1aca7c4cf89ecb5cc43ae8c21c2000a9db">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
   <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="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7" revision="a1e239a0bb5cd1d69680bf1075883aa9a7bf2429"/>
   <project groups="linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" path="prebuilts/gcc/linux-x86/x86/i686-linux-android-4.7" revision="c7931763d41be602407ed9d71e2c0292c6597e00"/>
   <project groups="linux,x86" name="platform/prebuilts/python/linux-x86/2.7.5" path="prebuilts/python/linux-x86/2.7.5" revision="a32003194f707f66a2d8cdb913ed1869f1926c5d"/>
   <project name="device/common" path="device/common" revision="96d4d2006c4fcb2f19a3fa47ab10cb409faa017b"/>
--- a/b2g/config/flame/sources.xml
+++ b/b2g/config/flame/sources.xml
@@ -12,20 +12,20 @@
   <!--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="4efd19d199ae52656604f794c5a77518400220fd">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <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="e95b4ce22c825da44d14299e1190ea39a5260bde"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="471afab478649078ad7c75ec6b252481a59e19b8"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="95bb5b66b3ec5769c3de8d3f25d681787418e7d2"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="ebdad82e61c16772f6cd47e9f11936bf6ebe9aa0"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="8b880805d454664b3eed11d0f053cdeafa1ff06e"/>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,9 +1,9 @@
 {
     "git": {
-        "git_revision": "fea83511df9ccba64259346bc02ebf2c417a12c2", 
+        "git_revision": "4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c", 
         "remote": "https://git.mozilla.org/releases/gaia.git", 
         "branch": ""
     }, 
-    "revision": "4b6bb4cbe4e23651f258584586c4185872d1da01", 
+    "revision": "a3dde85ff1c765651baabd8be7e75f905a46674d", 
     "repo_path": "integration/gaia-central"
 }
--- a/b2g/config/nexus-4/sources.xml
+++ b/b2g/config/nexus-4/sources.xml
@@ -12,20 +12,20 @@
   <!--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="4efd19d199ae52656604f794c5a77518400220fd">
     <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="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
-  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <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"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6" revision="9025e50b9d29b3cabbbb21e1dd94d0d13121a17e"/>
   <project groups="linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6" revision="b89fda71fcd0fa0cf969310e75be3ea33e048b44"/>
   <project groups="linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.7" revision="2e7d5348f35575870b3c7e567a9a9f6d66f8d6c5"/>
--- a/b2g/config/nexus-5-l/sources.xml
+++ b/b2g/config/nexus-5-l/sources.xml
@@ -10,25 +10,25 @@
   <!--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="52775e03a2d8532429dff579cb2cd56718e488c3">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="fea83511df9ccba64259346bc02ebf2c417a12c2"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="4ef1fa9b2870499fc9c77cac4a15f62e12a3ad2c"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="2e85143db5d5f6edc4c2b97263c02b558fee757e"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="c42985975f2bbc42859b9136ed348186d989b93d"/>
   <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="86bd499afd662d5320a675f5da97656c742299c4"/>
+  <project name="apitrace" path="external/apitrace" remote="apitrace" revision="fc740d702d3a1369603d08444ec8809d1a109160"/>
   <!-- Stock Android things -->
   <project groups="pdk,linux" name="platform/prebuilts/clang/linux-x86/host/3.5" path="prebuilts/clang/linux-x86/host/3.5" revision="50d1ca4ab8add54523b7bc692860d57e8ee4c0d1"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" path="prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.8" revision="fb3845864573857677f9b500040a8f011eaf5078"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-eabi-4.8" revision="354496e8eddd28c743d8e02c02eeab02958367e6"/>
   <project groups="pdk,linux,arm" name="platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" path="prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8" revision="b37c91354272b7413a0dc058b7445e677921d39e"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.6" revision="a227c92e0170bcf2296a63386956946b0dd78ca7"/>
   <project groups="pdk,linux" name="platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" path="prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.11-4.8" revision="884626610186b6dbea52cec5194b1c4bcfe1cb98"/>
   <project groups="pdk,linux,x86" name="platform/prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" path="prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.8" revision="29f9b82faa1af9730f52e933dca848546cbea84c"/>
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1812,22 +1812,22 @@ pref("identity.fxaccounts.migrateToDevEd
 #endif
 
 // On GTK, we now default to showing the menubar only when alt is pressed:
 #ifdef MOZ_WIDGET_GTK
 pref("ui.key.menuAccessKeyFocuses", true);
 #endif
 
 // Encrypted media extensions.
-#ifdef RELEASE_BUILD
-pref("media.eme.enabled", false);
-pref("media.eme.apiVisible", false);
-#else
 pref("media.eme.enabled", true);
 pref("media.eme.apiVisible", true);
+
+#ifdef XP_WIN
+pref("media.gmp-eme-adobe.enabled", true);
+pref("browser.eme.ui.enabled", true);
 #endif
 
 // Play with different values of the decay time and get telemetry,
 // 0 means to randomize (and persist) the experiment value in users' profiles,
 // -1 means no experiment is run and we use the preferred value for frecency (6h)
 pref("browser.cache.frecency_experiment", 0);
 
 pref("browser.translation.detectLanguage", false);
@@ -1851,23 +1851,16 @@ pref("browser.apps.URL", "https://market
 pref("browser.polaris.enabled", false);
 pref("privacy.trackingprotection.ui.enabled", false);
 #endif
 
 #ifdef NIGHTLY_BUILD
 pref("browser.tabs.remote.autostart.1", true);
 #endif
 
-// Temporary pref to allow printing in e10s windows on some platforms.
-#ifdef UNIX_BUT_NOT_MAC
-pref("print.enable_e10s_testing", false);
-#else
-pref("print.enable_e10s_testing", true);
-#endif
-
 #ifdef NIGHTLY_BUILD
 // Enable e10s add-on interposition by default.
 pref("extensions.interposition.enabled", true);
 pref("extensions.interposition.prefetching", true);
 #endif
 
 pref("browser.defaultbrowser.notificationbar", false);
 
--- a/browser/components/customizableui/moz.build
+++ b/browser/components/customizableui/moz.build
@@ -22,8 +22,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('win
     DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1
 
 EXTRA_PP_JS_MODULES += [
     'CustomizableUI.jsm',
     'CustomizableWidgets.jsm',
     'CustomizeMode.jsm',
     'PanelWideWidgetTracker.jsm',
 ]
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Toolbars and Customization')
--- a/browser/components/downloads/moz.build
+++ b/browser/components/downloads/moz.build
@@ -13,8 +13,11 @@ BROWSER_CHROME_MANIFESTS += ['test/brows
 JAR_MANIFESTS += ['jar.mn']
 
 EXTRA_JS_MODULES += [
     'DownloadsCommon.jsm',
     'DownloadsLogger.jsm',
     'DownloadsTaskbar.jsm',
     'DownloadsViewUI.jsm',
 ]
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Downloads Panel')
--- a/browser/components/feeds/moz.build
+++ b/browser/components/feeds/moz.build
@@ -36,8 +36,11 @@ FINAL_LIBRARY = 'browsercomps'
 for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
     DEFINES[var] = CONFIG[var]
 
 LOCAL_INCLUDES += [
     '../build',
 ]
 
 FAIL_ON_WARNINGS = True
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'RSS Discovery and Preview')
--- a/browser/components/loop/moz.build
+++ b/browser/components/loop/moz.build
@@ -19,8 +19,11 @@ EXTRA_JS_MODULES.loop += [
     'LoopContacts.jsm',
     'LoopRooms.jsm',
     'LoopStorage.jsm',
     'MozLoopAPI.jsm',
     'MozLoopPushHandler.jsm',
     'MozLoopService.jsm',
     'MozLoopWorker.js',
 ]
+
+with Files('**'):
+    BUG_COMPONENT = ('Loop', 'Client')
--- a/browser/components/migration/moz.build
+++ b/browser/components/migration/moz.build
@@ -49,8 +49,11 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
 
 EXTRA_PP_JS_MODULES += [
     'MigrationUtils.jsm',
 ]
 
 FINAL_LIBRARY = 'browsercomps'
 
 FAIL_ON_WARNINGS = True
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Migration')
--- a/browser/components/moz.build
+++ b/browser/components/moz.build
@@ -45,8 +45,11 @@ EXTRA_JS_MODULES += [
 ]
 
 BROWSER_CHROME_MANIFESTS += [
     'test/browser.ini'
 ]
 
 if CONFIG['MOZ_SAFE_BROWSING']:
     BROWSER_CHROME_MANIFESTS += ['safebrowsing/content/test/browser.ini']
+
+with Files('safebrowsing/*'):
+    BUG_COMPONENT = ('Toolkit', 'Phishing Protection')
--- a/browser/components/places/moz.build
+++ b/browser/components/places/moz.build
@@ -8,8 +8,11 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit
 MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
 BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
 
 JAR_MANIFESTS += ['jar.mn']
 
 EXTRA_PP_JS_MODULES += [
     'PlacesUIUtils.jsm',
 ]
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Bookmarks & History')
--- a/browser/components/preferences/moz.build
+++ b/browser/components/preferences/moz.build
@@ -13,8 +13,11 @@ BROWSER_CHROME_MANIFESTS += [
 
 for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
     DEFINES[var] = CONFIG[var]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'):
     DEFINES['HAVE_SHELL_SERVICE'] = 1
 
 JAR_MANIFESTS += ['jar.mn']
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Preferences')
--- a/browser/components/privatebrowsing/moz.build
+++ b/browser/components/privatebrowsing/moz.build
@@ -3,9 +3,12 @@
 # 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/.
 
 BROWSER_CHROME_MANIFESTS += [
     'test/browser/browser.ini',
 ]
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+JAR_MANIFESTS += ['jar.mn']
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Private Browsing')
--- a/browser/components/readinglist/moz.build
+++ b/browser/components/readinglist/moz.build
@@ -15,8 +15,11 @@ TESTING_JS_MODULES += [
 
 BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
 
 XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
 
 EXTRA_JS_MODULES.readinglist += [
     'Scheduler.jsm',
 ]
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Reading List')
--- a/browser/components/search/moz.build
+++ b/browser/components/search/moz.build
@@ -3,9 +3,12 @@
 # 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/.
 
 BROWSER_CHROME_MANIFESTS += [
     'test/browser.ini',
 ]
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+JAR_MANIFESTS += ['jar.mn']
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Search')
--- a/browser/components/sessionstore/moz.build
+++ b/browser/components/sessionstore/moz.build
@@ -45,8 +45,10 @@ EXTRA_JS_MODULES.sessionstore = [
     'Utils.jsm',
 ]
 
 EXTRA_PP_JS_MODULES.sessionstore += [
     'SessionSaver.jsm',
     'SessionStore.jsm',
 ]
 
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Session Restore')
--- a/browser/components/shell/moz.build
+++ b/browser/components/shell/moz.build
@@ -46,8 +46,11 @@ EXTRA_COMPONENTS += [
 ]
 
 for var in ('MOZ_APP_NAME', 'MOZ_APP_VERSION'):
     DEFINES[var] = '"%s"' % CONFIG[var]
 
 CXXFLAGS += CONFIG['TK_CFLAGS']
 
 FAIL_ON_WARNINGS = True
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Shell Integration')
--- a/browser/components/tabview/moz.build
+++ b/browser/components/tabview/moz.build
@@ -4,9 +4,12 @@
 # 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/.
 
 EXTRA_JS_MODULES.tabview = ['modules/utils.jsm']
 BROWSER_CHROME_MANIFESTS += [
     'test/browser.ini',
 ]
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+JAR_MANIFESTS += ['jar.mn']
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Panorama')
--- a/browser/components/uitour/moz.build
+++ b/browser/components/uitour/moz.build
@@ -6,8 +6,11 @@ EXTRA_PP_JS_MODULES += [
     'UITour.jsm',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
 BROWSER_CHROME_MANIFESTS += [
     'test/browser.ini',
 ]
+
+with Files('**'):
+    BUG_COMPONENT = ('Firefox', 'Tours')
--- a/dom/media/AudioStream.h
+++ b/dom/media/AudioStream.h
@@ -17,17 +17,17 @@
 #include "CubebUtils.h"
 
 namespace soundtouch {
 class SoundTouch;
 }
 
 namespace mozilla {
 
-struct DestroyPolicy
+struct CubebDestroyPolicy
 {
   void operator()(cubeb_stream* aStream) const {
     cubeb_stream_destroy(aStream);
   }
 };
 
 class AudioStream;
 class FrameHistory;
@@ -355,17 +355,17 @@ private:
 
   // Temporary audio buffer.  Filled by Write() and consumed by
   // DataCallback().  Once mBuffer is full, Write() blocks until sufficient
   // space becomes available in mBuffer.  mBuffer is sized in bytes, not
   // frames.
   CircularByteBuffer mBuffer;
 
   // Owning reference to a cubeb_stream.
-  UniquePtr<cubeb_stream, DestroyPolicy> mCubebStream;
+  UniquePtr<cubeb_stream, CubebDestroyPolicy> mCubebStream;
 
   uint32_t mBytesPerFrame;
 
   uint32_t BytesToFrames(uint32_t aBytes) {
     NS_ASSERTION(aBytes % mBytesPerFrame == 0,
                  "Byte count not aligned on frames size.");
     return aBytes / mBytesPerFrame;
   }
--- a/dom/media/MediaDecoderReader.h
+++ b/dom/media/MediaDecoderReader.h
@@ -251,16 +251,20 @@ public:
   }
 
   // Returns true if the reader implements RequestAudioData()
   // and RequestVideoData() asynchronously, rather than using the
   // implementation in this class to adapt the old synchronous to
   // the newer async model.
   virtual bool IsAsync() const { return false; }
 
+  // Returns true if this decoder reader uses hardware accelerated video
+  // decoding.
+  virtual bool VideoIsHardwareAccelerated() const { return false; }
+
 protected:
   virtual ~MediaDecoderReader();
 
   // Overrides of this function should decodes an unspecified amount of
   // audio data, enqueuing the audio data in mAudioQueue. Returns true
   // when there's more audio to decode, false if the audio is finished,
   // end of file has been reached, or an un-recoverable read error has
   // occured. This function blocks until the decode is complete.
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -215,17 +215,16 @@ MediaDecoderStateMachine::MediaDecoderSt
   mAudioStartTime(-1),
   mAudioEndTime(-1),
   mDecodedAudioEndTime(-1),
   mVideoFrameEndTime(-1),
   mDecodedVideoEndTime(-1),
   mVolume(1.0),
   mPlaybackRate(1.0),
   mPreservesPitch(true),
-  mAmpleVideoFrames(MIN_VIDEO_QUEUE_SIZE),
   mLowAudioThresholdUsecs(detail::LOW_AUDIO_USECS),
   mAmpleAudioThresholdUsecs(detail::AMPLE_AUDIO_USECS),
   mQuickBufferingLowDataThresholdUsecs(detail::QUICK_BUFFERING_LOW_DATA_USECS),
   mIsAudioPrerolling(false),
   mIsVideoPrerolling(false),
   mAudioCaptured(false),
   mPositionChangeQueued(false),
   mAudioCompleted(false),
@@ -574,17 +573,17 @@ bool MediaDecoderStateMachine::HaveEnoug
 
   return true;
 }
 
 bool MediaDecoderStateMachine::HaveEnoughDecodedVideo()
 {
   AssertCurrentThreadInMonitor();
 
-  if (static_cast<uint32_t>(VideoQueue().GetSize()) < mAmpleVideoFrames * mPlaybackRate) {
+  if (static_cast<uint32_t>(VideoQueue().GetSize()) < GetAmpleVideoFrames() * mPlaybackRate) {
     return false;
   }
 
   DecodedStreamData* stream = mDecoder->GetDecodedStream();
 
   if (stream && stream->mStreamInitialized && !stream->mHaveSentFinishVideo) {
     MOZ_ASSERT(mInfo.HasVideo());
     TrackID videoTrackId = mInfo.mVideo.mTrackInfo.mOutputId;
@@ -831,16 +830,20 @@ MediaDecoderStateMachine::OnNotDecoded(M
   bool isAudio = aType == MediaData::AUDIO_DATA;
   MOZ_ASSERT_IF(!isAudio, aType == MediaData::VIDEO_DATA);
 
   if (isAudio) {
     mAudioDataRequest.Complete();
   } else {
     mVideoDataRequest.Complete();
   }
+  if (IsShutdown()) {
+    // Already shutdown;
+    return;
+  }
 
   // If this is a decode error, delegate to the generic error path.
   if (aReason == MediaDecoderReader::DECODE_ERROR) {
     DecodeError();
     return;
   }
 
   // If the decoder is waiting for data, we tell it to call us back when the
@@ -1922,16 +1925,20 @@ MediaDecoderStateMachine::InitiateSeek()
 }
 
 nsresult
 MediaDecoderStateMachine::DispatchAudioDecodeTaskIfNeeded()
 {
   MOZ_ASSERT(OnStateMachineThread());
   ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
 
+  if (IsShutdown()) {
+    return NS_ERROR_FAILURE;
+  }
+
   if (NeedToDecodeAudio()) {
     return EnsureAudioDecodeTaskQueued();
   }
 
   return NS_OK;
 }
 
 nsresult
@@ -1968,16 +1975,20 @@ MediaDecoderStateMachine::EnsureAudioDec
 }
 
 nsresult
 MediaDecoderStateMachine::DispatchVideoDecodeTaskIfNeeded()
 {
   MOZ_ASSERT(OnStateMachineThread());
   ReentrantMonitorAutoEnter mon(mDecoder->GetReentrantMonitor());
 
+  if (IsShutdown()) {
+    return NS_ERROR_FAILURE;
+  }
+
   if (NeedToDecodeVideo()) {
     return EnsureVideoDecodeTaskQueued();
   }
 
   return NS_OK;
 }
 
 nsresult
@@ -2224,23 +2235,20 @@ nsresult MediaDecoderStateMachine::Decod
 
   if (NS_SUCCEEDED(res)) {
     mDecoder->SetMediaSeekable(mReader->IsMediaSeekable());
   }
 
   mInfo = info;
 
   if (HasVideo()) {
-    mAmpleVideoFrames = (mReader->IsAsync() && mInfo.mVideo.mIsHardwareAccelerated)
-      ? std::max<uint32_t>(sVideoQueueHWAccelSize, MIN_VIDEO_QUEUE_SIZE)
-      : std::max<uint32_t>(sVideoQueueDefaultSize, MIN_VIDEO_QUEUE_SIZE);
     DECODER_LOG("Video decode isAsync=%d HWAccel=%d videoQueueSize=%d",
                 mReader->IsAsync(),
-                mInfo.mVideo.mIsHardwareAccelerated,
-                mAmpleVideoFrames);
+                mReader->VideoIsHardwareAccelerated(),
+                GetAmpleVideoFrames());
   }
 
   mDecoder->StartProgressUpdates();
   mGotDurationFromMetaData = (GetDuration() != -1) || mDurationSet;
 
   if (mGotDurationFromMetaData) {
     // We have all the information required: duration and size
     // Inform the element that we've loaded the metadata.
@@ -3499,15 +3507,23 @@ void MediaDecoderStateMachine::OnAudioSi
     return;
   }
 
   // Otherwise notify media decoder/element about this error for it makes
   // no sense to play an audio-only file without sound output.
   DecodeError();
 }
 
+uint32_t MediaDecoderStateMachine::GetAmpleVideoFrames() const
+{
+  AssertCurrentThreadInMonitor();
+  return (mReader->IsAsync() && mReader->VideoIsHardwareAccelerated())
+    ? std::max<uint32_t>(sVideoQueueHWAccelSize, MIN_VIDEO_QUEUE_SIZE)
+    : std::max<uint32_t>(sVideoQueueDefaultSize, MIN_VIDEO_QUEUE_SIZE);
+}
+
 } // namespace mozilla
 
 // avoid redefined macro in unified build
 #undef DECODER_LOG
 #undef VERBOSE_LOG
 #undef DECODER_WARN
 #undef DECODER_WARN_HELPER
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -914,20 +914,21 @@ protected:
   // Time at which we started decoding. Synchronised via decoder monitor.
   TimeStamp mDecodeStartTime;
 
   // The maximum number of second we spend buffering when we are short on
   // unbuffered data.
   uint32_t mBufferingWait;
   int64_t  mLowDataThresholdUsecs;
 
-  // If we've got more than mAmpleVideoFrames decoded video frames waiting in
+  // If we've got more than this number of decoded video frames waiting in
   // the video queue, we will not decode any more video frames until some have
   // been consumed by the play state machine thread.
-  uint32_t mAmpleVideoFrames;
+  // Must hold monitor.
+  uint32_t GetAmpleVideoFrames() const;
 
   // Low audio threshold. If we've decoded less than this much audio we
   // consider our audio decode "behind", and we may skip video decoding
   // in order to allow our audio decoding to catch up. We favour audio
   // decoding over video. We increase this threshold if we're slow to
   // decode video frames, in order to reduce the chance of audio underruns.
   // Note that we don't ever reset this threshold, it only ever grows as
   // we detect that the decode can't keep up with rendering.
@@ -956,17 +957,21 @@ protected:
     if (mScheduler->IsRealTime()) {
       return 0;
     }
 
     uint32_t result = mLowAudioThresholdUsecs * 2;
     MOZ_ASSERT(result <= mAmpleAudioThresholdUsecs, "Prerolling will never finish");
     return result;
   }
-  uint32_t VideoPrerollFrames() const { return mScheduler->IsRealTime() ? 0 : mAmpleVideoFrames / 2; }
+
+  uint32_t VideoPrerollFrames() const
+  {
+    return mScheduler->IsRealTime() ? 0 : GetAmpleVideoFrames() / 2;
+  }
 
   bool DonePrerollingAudio()
   {
     AssertCurrentThreadInMonitor();
     return !IsAudioDecoding() || GetDecodedAudioDuration() >= AudioPrerollUsecs() * mPlaybackRate;
   }
 
   bool DonePrerollingVideo()
--- a/dom/media/MediaInfo.h
+++ b/dom/media/MediaInfo.h
@@ -41,17 +41,16 @@ struct TrackInfo {
 // Stores info relevant to presenting media frames.
 class VideoInfo {
 private:
   void Init(int32_t aWidth, int32_t aHeight, bool aHasVideo)
   {
     mDisplay = nsIntSize(aWidth, aHeight);
     mStereoMode = StereoMode::MONO;
     mHasVideo = aHasVideo;
-    mIsHardwareAccelerated = false;
 
     // TODO: TrackInfo should be initialized by its specific codec decoder.
     // This following call should be removed once we have that implemented.
     mTrackInfo.Init(NS_LITERAL_STRING("2"), NS_LITERAL_STRING("main"),
                     EmptyString(), EmptyString(), true, 2);
   }
 
 public:
@@ -71,18 +70,16 @@ public:
 
   // Indicates the frame layout for single track stereo videos.
   StereoMode mStereoMode;
 
   // True if we have an active video bitstream.
   bool mHasVideo;
 
   TrackInfo mTrackInfo;
-
-  bool mIsHardwareAccelerated;
 };
 
 class AudioInfo {
 public:
   AudioInfo()
     : mRate(44100)
     , mChannels(2)
     , mHasAudio(false)
--- a/dom/media/VideoFrameContainer.cpp
+++ b/dom/media/VideoFrameContainer.cpp
@@ -28,20 +28,16 @@ VideoFrameContainer::VideoFrameContainer
 
 VideoFrameContainer::~VideoFrameContainer()
 {}
 
 void VideoFrameContainer::SetCurrentFrame(const gfxIntSize& aIntrinsicSize,
                                           Image* aImage,
                                           TimeStamp aTargetTime)
 {
-  if (aImage && !aImage->IsValid()) {
-    return;
-  }
-
   MutexAutoLock lock(mMutex);
 
   if (aIntrinsicSize != mIntrinsicSize) {
     mIntrinsicSize = aIntrinsicSize;
     mIntrinsicSizeChanged = true;
   }
 
   gfx::IntSize oldFrameSize = mImageContainer->GetCurrentSize();
--- a/dom/media/fmp4/AVCCDecoderModule.cpp
+++ b/dom/media/fmp4/AVCCDecoderModule.cpp
@@ -30,16 +30,17 @@ public:
   virtual nsresult Flush() MOZ_OVERRIDE;
   virtual nsresult Drain() MOZ_OVERRIDE;
   virtual nsresult Shutdown() MOZ_OVERRIDE;
   virtual bool IsWaitingMediaResources() MOZ_OVERRIDE;
   virtual bool IsDormantNeeded() MOZ_OVERRIDE;
   virtual void AllocateMediaResources() MOZ_OVERRIDE;
   virtual void ReleaseMediaResources() MOZ_OVERRIDE;
   virtual void ReleaseDecoder() MOZ_OVERRIDE;
+  virtual bool IsHardwareAccelerated() const MOZ_OVERRIDE;
 
 private:
   // Will create the required MediaDataDecoder if we have a AVC SPS.
   // Returns NS_ERROR_FAILURE if error is permanent and can't be recovered and
   // will set mError accordingly.
   nsresult CreateDecoder();
   nsresult CreateDecoderAndInit(mp4_demuxer::MP4Sample* aSample);
 
@@ -206,16 +207,25 @@ AVCCMediaDataDecoder::CreateDecoderAndIn
   }
   mCurrentConfig.extra_data = extra_data;
 
   nsresult rv = CreateDecoder();
   NS_ENSURE_SUCCESS(rv, rv);
   return Init();
 }
 
+bool
+AVCCMediaDataDecoder::IsHardwareAccelerated() const
+{
+  if (mDecoder) {
+    return mDecoder->IsHardwareAccelerated();
+  }
+  return MediaDataDecoder::IsHardwareAccelerated();
+}
+
 // AVCCDecoderModule
 
 AVCCDecoderModule::AVCCDecoderModule(PlatformDecoderModule* aPDM)
 : mPDM(aPDM)
 {
   MOZ_ASSERT(aPDM);
 }
 
--- a/dom/media/fmp4/MP4Reader.cpp
+++ b/dom/media/fmp4/MP4Reader.cpp
@@ -492,17 +492,16 @@ MP4Reader::ReadMetadata(MediaInfo* aInfo
                                                       mLayersBackendType,
                                                       mDecoder->GetImageContainer(),
                                                       mVideo.mTaskQueue,
                                                       mVideo.mCallback);
     }
     NS_ENSURE_TRUE(mVideo.mDecoder != nullptr, NS_ERROR_FAILURE);
     nsresult rv = mVideo.mDecoder->Init();
     NS_ENSURE_SUCCESS(rv, rv);
-    mInfo.mVideo.mIsHardwareAccelerated = mVideo.mDecoder->IsHardwareAccelerated();
 
     // Collect telemetry from h264 AVCC SPS.
     if (!mFoundSPSForTelemetry) {
       mFoundSPSForTelemetry = AccumulateSPSTelemetry(video.extra_data);
     }
   }
 
   // Get the duration, and report it to the decoder if we have it.
@@ -1095,9 +1094,15 @@ MP4Reader::SetIdle()
 void
 MP4Reader::SetSharedDecoderManager(SharedDecoderManager* aManager)
 {
 #if defined(MOZ_GONK_MEDIACODEC) || defined(XP_WIN)
   mSharedDecoderManager = aManager;
 #endif
 }
 
+bool
+MP4Reader::VideoIsHardwareAccelerated() const
+{
+  return mVideo.mDecoder && mVideo.mDecoder->IsHardwareAccelerated();
+}
+
 } // namespace mozilla
--- a/dom/media/fmp4/MP4Reader.h
+++ b/dom/media/fmp4/MP4Reader.h
@@ -77,16 +77,18 @@ public:
     MOZ_OVERRIDE;
 
   virtual nsresult ResetDecode() MOZ_OVERRIDE;
 
   virtual nsRefPtr<ShutdownPromise> Shutdown() MOZ_OVERRIDE;
 
   virtual bool IsAsync() const MOZ_OVERRIDE { return true; }
 
+  virtual bool VideoIsHardwareAccelerated() const MOZ_OVERRIDE;
+
 private:
 
   bool InitDemuxer();
   void ReturnOutput(MediaData* aData, TrackType aTrack);
 
   // Sends input to decoder for aTrack, and output to the state machine,
   // if necessary.
   void Update(TrackType aTrack);
--- a/dom/media/fmp4/apple/AppleVDADecoder.h
+++ b/dom/media/fmp4/apple/AppleVDADecoder.h
@@ -70,16 +70,20 @@ public:
                   MediaDataDecoderCallback* aCallback,
                   layers::ImageContainer* aImageContainer);
   virtual ~AppleVDADecoder();
   virtual nsresult Init() MOZ_OVERRIDE;
   virtual nsresult Input(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE;
   virtual nsresult Flush() MOZ_OVERRIDE;
   virtual nsresult Drain() MOZ_OVERRIDE;
   virtual nsresult Shutdown() MOZ_OVERRIDE;
+  virtual bool IsHardwareAccelerated() const MOZ_OVERRIDE
+  {
+    return true;
+  }
 
   nsresult OutputFrame(CVPixelBufferRef aImage,
                        nsAutoPtr<AppleFrameRef> aFrameRef);
 
  protected:
   AppleFrameRef* CreateAppleFrameRef(const mp4_demuxer::MP4Sample* aSample);
   void DrainReorderedFrames();
   void ClearReorderedFrames();
--- a/dom/media/fmp4/apple/AppleVTDecoder.cpp
+++ b/dom/media/fmp4/apple/AppleVTDecoder.cpp
@@ -36,16 +36,17 @@ namespace mozilla {
 
 AppleVTDecoder::AppleVTDecoder(const mp4_demuxer::VideoDecoderConfig& aConfig,
                                FlushableMediaTaskQueue* aVideoTaskQueue,
                                MediaDataDecoderCallback* aCallback,
                                layers::ImageContainer* aImageContainer)
   : AppleVDADecoder(aConfig, aVideoTaskQueue, aCallback, aImageContainer)
   , mFormat(nullptr)
   , mSession(nullptr)
+  , mIsHardwareAccelerated(false)
 {
   MOZ_COUNT_CTOR(AppleVTDecoder);
   // TODO: Verify aConfig.mime_type.
   LOG("Creating AppleVTDecoder for %dx%d h.264 video",
       mConfig.image_width,
       mConfig.image_height
      );
 }
@@ -309,18 +310,19 @@ AppleVTDecoder::InitializeSession()
     CFBooleanRef isUsingHW = nullptr;
     rv = VTSessionCopyProperty(mSession,
                                AppleVTLinker::skPropUsingHWAccel,
                                kCFAllocatorDefault,
                                &isUsingHW);
     if (rv != noErr) {
       LOG("AppleVTDecoder: system doesn't support hardware acceleration");
     }
+    mIsHardwareAccelerated = rv == noErr && isUsingHW == kCFBooleanTrue;
     LOG("AppleVTDecoder: %s hardware accelerated decoding",
-        (rv == noErr && isUsingHW == kCFBooleanTrue) ? "using" : "not using");
+        mIsHardwareAccelerated ? "using" : "not using");
   } else {
     LOG("AppleVTDecoder: couldn't determine hardware acceleration status.");
   }
   return NS_OK;
 }
 
 CFDictionaryRef
 AppleVTDecoder::CreateDecoderExtensions()
--- a/dom/media/fmp4/apple/AppleVTDecoder.h
+++ b/dom/media/fmp4/apple/AppleVTDecoder.h
@@ -20,25 +20,30 @@ public:
                  MediaDataDecoderCallback* aCallback,
                  layers::ImageContainer* aImageContainer);
   virtual ~AppleVTDecoder();
   virtual nsresult Init() MOZ_OVERRIDE;
   virtual nsresult Input(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE;
   virtual nsresult Flush() MOZ_OVERRIDE;
   virtual nsresult Drain() MOZ_OVERRIDE;
   virtual nsresult Shutdown() MOZ_OVERRIDE;
+  virtual bool IsHardwareAccelerated() const MOZ_OVERRIDE
+  {
+    return mIsHardwareAccelerated;
+  }
 
 private:
   CMVideoFormatDescriptionRef mFormat;
   VTDecompressionSessionRef mSession;
 
   // Method to pass a frame to VideoToolbox for decoding.
   nsresult SubmitFrame(mp4_demuxer::MP4Sample* aSample);
   // Method to set up the decompression session.
   nsresult InitializeSession();
   nsresult WaitForAsynchronousFrames();
   CFDictionaryRef CreateDecoderSpecification();
   CFDictionaryRef CreateDecoderExtensions();
+  bool mIsHardwareAccelerated;
 };
 
 } // namespace mozilla
 
 #endif // mozilla_AppleVTDecoder_h
--- a/dom/media/gtest/moz.build
+++ b/dom/media/gtest/moz.build
@@ -1,32 +1,32 @@
 # -*- 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 += [
+UNIFIED_SOURCES += [
     'MockMediaResource.cpp',
     'TestAudioCompactor.cpp',
     'TestGMPCrossOrigin.cpp',
     'TestMP4Demuxer.cpp',
     'TestMP4Reader.cpp',
     'TestTrackEncoder.cpp',
     'TestVideoSegment.cpp',
     'TestWebMBuffered.cpp',
 ]
 
 if CONFIG['MOZ_EME']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'TestEME.cpp',
     ]
 
 if CONFIG['MOZ_WEBM_ENCODER']:
-    SOURCES += [
+    UNIFIED_SOURCES += [
         'TestVideoTrackEncoder.cpp',
         'TestVorbisTrackEncoder.cpp',
         'TestWebMWriter.cpp',
     ]
 
 TEST_HARNESS_FILES.gtest += [
     '../test/gizmo-frag.mp4',
     '../test/gizmo.mp4',
--- a/dom/media/mediasource/MediaSource.cpp
+++ b/dom/media/mediasource/MediaSource.cpp
@@ -329,18 +329,18 @@ MediaSource::Enabled(JSContext* cx, JSOb
   // analysis thinks can GC.
   JS::Rooted<JSObject*> global(cx, aGlobal);
 
   bool enabled = Preferences::GetBool("media.mediasource.enabled");
   if (!enabled) {
     return false;
   }
 
-  // Check whether it's enabled everywhere or just YouTube.
-  bool restrict = Preferences::GetBool("media.mediasource.youtubeonly", false);
+  // Check whether it's enabled everywhere or just whitelisted sites.
+  bool restrict = Preferences::GetBool("media.mediasource.whitelist", false);
   if (!restrict) {
     return true;
   }
 
   // We want to restrict to YouTube only.
   // We define that as the origin being *.youtube.com.
   // We also support *.youtube-nocookie.com
   nsIPrincipal* principal = nsContentUtils::ObjectPrincipal(global);
@@ -354,17 +354,18 @@ MediaSource::Enabled(JSContext* cx, JSOb
   NS_ENSURE_TRUE(tldServ, false);
 
   nsAutoCString eTLDplusOne;
    if (NS_FAILED(tldServ->GetBaseDomain(uri, 0, eTLDplusOne))) {
      return false;
    }
 
    return eTLDplusOne.EqualsLiteral("youtube.com") ||
-          eTLDplusOne.EqualsLiteral("youtube-nocookie.com");
+          eTLDplusOne.EqualsLiteral("youtube-nocookie.com") ||
+          eTLDplusOne.EqualsLiteral("netflix.com");
 }
 
 bool
 MediaSource::Attach(MediaSourceDecoder* aDecoder)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MSE_DEBUG("Attach(aDecoder=%p) owner=%p", aDecoder, aDecoder->GetOwner());
   MOZ_ASSERT(aDecoder);
--- a/dom/media/mediasource/MediaSourceReader.cpp
+++ b/dom/media/mediasource/MediaSourceReader.cpp
@@ -413,16 +413,24 @@ MediaSourceReader::CheckForWaitOrEndOfSt
     mVideoPromise.Reject(WAITING_FOR_DATA, __func__);
   }
 }
 
 nsRefPtr<ShutdownPromise>
 MediaSourceReader::Shutdown()
 {
   mSeekPromise.RejectIfExists(NS_ERROR_FAILURE, __func__);
+  // Any previous requests we've been waiting on are now unwanted.
+  mAudioRequest.DisconnectIfExists();
+  mVideoRequest.DisconnectIfExists();
+
+  // Additionally, reject any outstanding promises _we_ made that we might have
+  // been waiting on the above to fulfill.
+  mAudioPromise.RejectIfExists(CANCELED, __func__);
+  mVideoPromise.RejectIfExists(CANCELED, __func__);
 
   MOZ_ASSERT(mMediaSourceShutdownPromise.IsEmpty());
   nsRefPtr<ShutdownPromise> p = mMediaSourceShutdownPromise.Ensure(__func__);
 
   ContinueShutdown();
   return p;
 }
 
--- a/dom/media/mediasource/MediaSourceReader.h
+++ b/dom/media/mediasource/MediaSourceReader.h
@@ -137,20 +137,26 @@ public:
   // Set the duration of the attached mediasource element.
   void SetMediaSourceDuration(double aDuration /* seconds */);
 
 #ifdef MOZ_EME
   nsresult SetCDMProxy(CDMProxy* aProxy);
 #endif
 
   virtual bool IsAsync() const MOZ_OVERRIDE {
+    ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
     return (!GetAudioReader() || GetAudioReader()->IsAsync()) &&
            (!GetVideoReader() || GetVideoReader()->IsAsync());
   }
 
+  virtual bool VideoIsHardwareAccelerated() const MOZ_OVERRIDE {
+    ReentrantMonitorAutoEnter decoderMon(mDecoder->GetReentrantMonitor());
+    return GetVideoReader() && GetVideoReader()->VideoIsHardwareAccelerated();
+  }
+
   // Returns true if aReader is a currently active audio or video
   bool IsActiveReader(MediaDecoderReader* aReader);
 
   // Returns a string describing the state of the MediaSource internal
   // buffered data. Used for debugging purposes.
   void GetMozDebugReaderData(nsAString& aString);
 
 private:
--- a/dom/media/mediasource/SourceBufferResource.cpp
+++ b/dom/media/mediasource/SourceBufferResource.cpp
@@ -42,17 +42,17 @@ SourceBufferResource::Close()
   mon.NotifyAll();
   return NS_OK;
 }
 
 nsresult
 SourceBufferResource::Read(char* aBuffer, uint32_t aCount, uint32_t* aBytes)
 {
   SBR_DEBUGV("Read(aBuffer=%p, aCount=%u, aBytes=%p)",
-             aBytes, aCount, aBytes);
+             aBuffer, aCount, aBytes);
   ReentrantMonitorAutoEnter mon(mMonitor);
 
   return ReadInternal(aBuffer, aCount, aBytes, /* aMayBlock = */ true);
 }
 
 nsresult
 SourceBufferResource::ReadInternal(char* aBuffer, uint32_t aCount, uint32_t* aBytes, bool aMayBlock)
 {
@@ -69,17 +69,17 @@ SourceBufferResource::ReadInternal(char*
          readOffset + aCount > static_cast<uint64_t>(GetLength())) {
     SBR_DEBUGV("waiting for data");
     mMonitor.Wait();
   }
 
   uint32_t available = GetLength() - readOffset;
   uint32_t count = std::min(aCount, available);
   SBR_DEBUGV("readOffset=%llu GetLength()=%u available=%u count=%u mEnded=%d",
-             this, readOffset, GetLength(), available, count, mEnded);
+             readOffset, GetLength(), available, count, mEnded);
   if (available == 0) {
     SBR_DEBUGV("reached EOF");
     *aBytes = 0;
     return NS_OK;
   }
 
   mInputBuffer.CopyData(readOffset, count, aBuffer);
   *aBytes = count;
--- a/dom/media/mediasource/test/crashtests/1005366.html
+++ b/dom/media/mediasource/test/crashtests/1005366.html
@@ -1,17 +1,17 @@
 <!DOCTYPE html>
 <html>
 <head>
 <meta charset="UTF-8">
 <script>
 
 /*
 user_pref("media.mediasource.enabled", true);
-user_pref("media.mediasource.youtubeonly", false);
+user_pref("media.mediasource.whitelist", false);
 */
 
 function boom()
 {
     var source = new window.MediaSource();
     var videoElement = document.createElementNS('http://www.w3.org/1999/xhtml', 'video');
     videoElement.src = URL.createObjectURL(source);
 
--- a/dom/media/mediasource/test/crashtests/1059035.html
+++ b/dom/media/mediasource/test/crashtests/1059035.html
@@ -1,16 +1,16 @@
 <!DOCTYPE html>
 <html>
 <head>
 <script>
 
 /*
 user_pref("media.mediasource.enabled", true);
-user_pref("media.mediasource.youtubeonly", false);
+user_pref("media.mediasource.whitelist", false);
 */
 
 function boom()
 {
     var mediaSource = new MediaSource();
     var htmlAudio = document.createElement("audio");
     htmlAudio.src = URL.createObjectURL(mediaSource);
 
--- a/dom/media/mediasource/test/crashtests/crashtests.list
+++ b/dom/media/mediasource/test/crashtests/crashtests.list
@@ -1,4 +1,4 @@
-test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 926665.html
-test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 931388.html
-test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 1005366.html
-test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.youtubeonly,false) load 1059035.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.whitelist,false) load 926665.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.whitelist,false) load 931388.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.whitelist,false) load 1005366.html
+test-pref(media.mediasource.enabled,true) test-pref(media.mediasource.whitelist,false) load 1059035.html
--- a/dom/media/mediasource/test/mediasource.js
+++ b/dom/media/mediasource/test/mediasource.js
@@ -14,17 +14,17 @@ function runWithMSE(testFunction) {
     });
 
     testFunction(ms, el);
   }
 
   addLoadEvent(function () {
     SpecialPowers.pushPrefEnv({"set": [
 	[ "media.mediasource.enabled", true ],
-	[ "media.mediasource.youtubeonly", false ],
+	[ "media.mediasource.whitelist", false ],
     ]},
                               bootstrapTest);
   });
 }
 
 function fetchWithXHR(uri, onLoadFunction) {
   var p = new Promise(function(resolve, reject) {
     var xhr = new XMLHttpRequest();
--- a/dom/media/mediasource/test/test_MediaSource_disabled.html
+++ b/dom/media/mediasource/test/test_MediaSource_disabled.html
@@ -17,17 +17,17 @@ function test() {
   SimpleTest.doesThrow(() => new MediaSource,
                        "MediaSource should be hidden behind a pref");
   SimpleTest.finish();
 }
 
 SpecialPowers.pushPrefEnv({"set":
     [
       ["media.mediasource.enabled", false],
-      ["media.mediasource.youtubeonly", false],
+      ["media.mediasource.whitelist", false],
     ]
   },
                           test);
 
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/test/mochitest.ini
+++ b/dom/media/test/mochitest.ini
@@ -366,18 +366,21 @@ skip-if = buildapp == 'b2g' && toolkit !
 [test_dormant_playback.html]
 skip-if = (os == 'win' && os_version == '5.1') || (os != 'win' && toolkit != 'gonk')
 [test_eme_access_control.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
 [test_eme_canvas_blocked.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s || (os == 'win' && !debug) # bug 1043403, bug 1057908, bug 1140675
 [test_eme_non_fragmented.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
-[test_eme_obs_notification.html]
-skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
+#[test_eme_obs_notification.html]
+#skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
+# Disabled (bug 1140778) since this test fails and we don't want to remove the
+# functionality being tested by this test. We should still test other observers
+# in future however, so I'm not removing the test, just disabling it.
 [test_eme_persistent_sessions.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
 [test_eme_playback.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
 [test_eme_requestKeySystemAccess.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # bug 1043403, bug 1057908
 [test_eme_stream_capture_blocked.html]
 skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s || (os == 'win' && !debug) # bug 1043403, bug 1057908, bug 1140675
--- a/dom/media/test/test_VideoPlaybackQuality.html
+++ b/dom/media/test/test_VideoPlaybackQuality.html
@@ -49,16 +49,16 @@ function test() {
     });
   });
 }
 
 addLoadEvent(function() {
   SpecialPowers.pushPrefEnv({"set":
     [
       ["media.mediasource.enabled", true],
-      ["media.mediasource.youtubeonly", false],
+      ["media.mediasource.whitelist", false],
     ]
   }, test);
 });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/test/test_VideoPlaybackQuality_disabled.html
+++ b/dom/media/test/test_VideoPlaybackQuality_disabled.html
@@ -23,16 +23,16 @@ function test() {
   ok(accessThrows, "getVideoPlaybackQuality should be hidden behind a pref");
   SimpleTest.finish();
 }
 
 addLoadEvent(function() {
   SpecialPowers.pushPrefEnv({"set":
     [
      ["media.mediasource.enabled", false],
-     ["media.mediasource.youtubeonly", false],
+     ["media.mediasource.whitelist", false],
     ]
   }, test);
 });
 </script>
 </pre>
 </body>
 </html>
--- a/dom/media/test/test_eme_access_control.html
+++ b/dom/media/test/test_eme_access_control.html
@@ -88,17 +88,17 @@ function startTest(test, token)
 }
 
 function beginTest() {
   manager.runTests(gEMETests.filter(t => t.crossOrigin), startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
-  [ "media.mediasource.youtubeonly", false ],
+  [ "media.mediasource.whitelist", false ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
     !document.createElement('video').canPlayType("video/mp4")) {
   // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
   prefs.push([ "media.fragmented-mp4.exposed", true ]);
   prefs.push([ "media.fragmented-mp4.use-blank-decoder", true ]);
--- a/dom/media/test/test_eme_canvas_blocked.html
+++ b/dom/media/test/test_eme_canvas_blocked.html
@@ -42,17 +42,17 @@ function startTest(test, token)
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
-  [ "media.mediasource.youtubeonly", false ],
+  [ "media.mediasource.whitelist", false ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
     !document.createElement('video').canPlayType("video/mp4")) {
   // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
   prefs.push([ "media.fragmented-mp4.exposed", true ]);
   prefs.push([ "media.fragmented-mp4.use-blank-decoder", true ]);
--- a/dom/media/test/test_eme_non_fragmented.html
+++ b/dom/media/test/test_eme_non_fragmented.html
@@ -84,17 +84,17 @@ function startTest(test, token)
 }
 
 function beginTest() {
   manager.runTests(gEMENonFragmentedTests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
-  [ "media.mediasource.youtubeonly", false ],
+  [ "media.mediasource.whitelist", false ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
     !document.createElement('video').canPlayType("video/mp4")) {
   // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
   prefs.push([ "media.fragmented-mp4.exposed", true ]);
   prefs.push([ "media.fragmented-mp4.use-blank-decoder", true ]);
--- a/dom/media/test/test_eme_obs_notification.html
+++ b/dom/media/test/test_eme_obs_notification.html
@@ -56,17 +56,17 @@ function startTest(test, token)
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
-  [ "media.mediasource.youtubeonly", false ],
+  [ "media.mediasource.whitelist", false ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
     !document.createElement('video').canPlayType("video/mp4")) {
   // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
   prefs.push([ "media.fragmented-mp4.exposed", true ]);
   prefs.push([ "media.fragmented-mp4.use-blank-decoder", true ]);
--- a/dom/media/test/test_eme_playback.html
+++ b/dom/media/test/test_eme_playback.html
@@ -98,17 +98,17 @@ function startTest(test, token)
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
-  [ "media.mediasource.youtubeonly", false ],
+  [ "media.mediasource.whitelist", false ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
     !document.createElement('video').canPlayType("video/mp4")) {
   // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
   prefs.push([ "media.fragmented-mp4.exposed", true ]);
   prefs.push([ "media.fragmented-mp4.use-blank-decoder", true ]);
--- a/dom/media/test/test_eme_requestKeySystemAccess.html
+++ b/dom/media/test/test_eme_requestKeySystemAccess.html
@@ -289,17 +289,17 @@ var tests = [
 ];
 
 function beginTest() {
   Promise.all(tests.map(Test)).then(function() { SimpleTest.finish(); });
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
-  [ "media.mediasource.youtubeonly", false ],
+  [ "media.mediasource.whitelist", false ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
     !document.createElement('video').canPlayType("video/mp4")) {
   // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
   prefs.push([ "media.fragmented-mp4.exposed", true ]);
   prefs.push([ "media.fragmented-mp4.use-blank-decoder", true ]);
--- a/dom/media/test/test_eme_stream_capture_blocked.html
+++ b/dom/media/test/test_eme_stream_capture_blocked.html
@@ -73,17 +73,17 @@ function startTest(test, token)
 }
 
 function beginTest() {
   manager.runTests(gEMETests, startTest);
 }
 
 var prefs = [
   [ "media.mediasource.enabled", true ],
-  [ "media.mediasource.youtubeonly", false ],
+  [ "media.mediasource.whitelist", false ],
   [ "media.mediasource.mp4.enabled", true ],
 ];
 
 if (/Linux/.test(navigator.userAgent) ||
     !document.createElement('video').canPlayType("video/mp4")) {
   // XXX remove once we have mp4 PlatformDecoderModules on all platforms.
   prefs.push([ "media.fragmented-mp4.exposed", true ]);
   prefs.push([ "media.fragmented-mp4.use-blank-decoder", true ]);
--- a/dom/svg/SVGFragmentIdentifier.cpp
+++ b/dom/svg/SVGFragmentIdentifier.cpp
@@ -254,17 +254,19 @@ SVGFragmentIdentifier::ProcessFragmentId
 
   if (viewElement) {
     if (!rootElement->mCurrentViewID) {
       rootElement->mCurrentViewID = new nsString();
     }
     *rootElement->mCurrentViewID = aAnchorName;
     rootElement->mUseCurrentView = true;
     rootElement->InvalidateTransformNotifyFrame();
-    return true;
+    // not an svgView()-style fragment identifier, return false so the caller
+    // continues processing to match any :target pseudo elements
+    return false;
   }
 
   bool wasOverridden = !!rootElement->mCurrentViewID;
   rootElement->mCurrentViewID = nullptr;
 
   rootElement->mUseCurrentView = ProcessSVGViewSpec(aAnchorName, rootElement);
   if (rootElement->mUseCurrentView) {
     return true;
--- a/dom/svg/SVGFragmentIdentifier.h
+++ b/dom/svg/SVGFragmentIdentifier.h
@@ -24,17 +24,19 @@ class SVGSVGElement;
 class SVGFragmentIdentifier
 {
   // To prevent the class being instantiated
   SVGFragmentIdentifier() = delete;
 
 public:
   /**
    * Process the SVG fragment identifier, if there is one.
-   * @return true if we found something we recognised
+   * @return true if we found a valid svgView()-style fragment identifier,
+   * in which case further processing by the caller can stop. Otherwise return
+   * false as we may have an ordinary anchor which needs to be :target matched.
    */
   static bool ProcessFragmentIdentifier(nsIDocument *aDocument,
                                         const nsAString &aAnchorName);
 
 private:
  /**
   * Parse an SVG ViewSpec and set applicable attributes on the root element.
   * @return true if there is a valid ViewSpec
--- a/embedding/components/printingui/ipc/PPrintingTypes.ipdlh
+++ b/embedding/components/printingui/ipc/PPrintingTypes.ipdlh
@@ -1,16 +1,21 @@
 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
 /* 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/. */
 
 namespace mozilla {
 namespace embedding {
 
+struct CStringKeyValue {
+  nsCString key;
+  nsCString value;
+};
+
 struct PrintData {
   int32_t startPageRange;
   int32_t endPageRange;
   double edgeTop;
   double edgeLeft;
   double edgeBottom;
   double edgeRight;
   double marginTop;
@@ -71,15 +76,25 @@ struct PrintData {
   /* Windows-specific things */
   nsString driverName;
   nsString deviceName;
   bool isFramesetDocument;
   bool isFramesetFrameSelected;
   bool isIFrameSelected;
   bool isRangeSelection;
 
-  /* TODO: OS X specific things - specifically, an array of names for the
+  /**
+   * GTK-specific things. Some of these might look like dupes of the
+   * information we're already passing, but the generalized settings that
+   * we hold in nsIPrintSettings don't map perfectly to GTK's GtkPrintSettings,
+   * so there are some nuances. GtkPrintSettings, for example, stores both an
+   * internal name for paper size, as well as the display name.
+   */
+  CStringKeyValue[] GTKPrintSettings;
+
+  /**
+   * TODO: OS X specific things - specifically, an array of names for the
    * document to be supplied by nsIWebBrowserPrint::enumerateDocumentNames
    */
 };
 
 } // namespace embedding
 } // namespace mozilla
--- a/gfx/2d/BorrowedContext.h
+++ b/gfx/2d/BorrowedContext.h
@@ -82,24 +82,26 @@ public:
   BorrowedCGContext()
     : cg(nullptr)
     , mDT(nullptr)
   { }
 
   explicit BorrowedCGContext(DrawTarget *aDT)
     : mDT(aDT)
   {
+    MOZ_ASSERT(aDT, "Caller should check for nullptr");
     cg = BorrowCGContextFromDrawTarget(aDT);
   }
 
   // We can optionally Init after construction in
   // case we don't know what the DT will be at construction
   // time.
   CGContextRef Init(DrawTarget *aDT)
   {
+    MOZ_ASSERT(aDT, "Caller should check for nullptr");
     MOZ_ASSERT(!mDT, "Can't initialize twice!");
     mDT = aDT;
     cg = BorrowCGContextFromDrawTarget(aDT);
     return cg;
   }
 
   // The caller needs to call Finish if cg is non-null when
   // they are done with the context. This is currently explicit
--- a/gfx/layers/D3D9SurfaceImage.cpp
+++ b/gfx/layers/D3D9SurfaceImage.cpp
@@ -8,26 +8,20 @@
 #include "mozilla/layers/TextureD3D9.h"
 #include "mozilla/layers/CompositableClient.h"
 #include "mozilla/layers/CompositableForwarder.h"
 #include "mozilla/gfx/Types.h"
 
 namespace mozilla {
 namespace layers {
 
-// Maximum number of ms we're willing to wait for
-// the YUV -> RGB conversion to take before marking
-// the texture as invalid.
-static const uint32_t kMaxWaitSyncMs = 5;
-
 
 D3D9SurfaceImage::D3D9SurfaceImage()
   : Image(nullptr, ImageFormat::D3D9_RGB32_TEXTURE)
   , mSize(0, 0)
-  , mIsValid(true)
 {}
 
 D3D9SurfaceImage::~D3D9SurfaceImage()
 {
   if (mTexture) {
     gfxWindowsPlatform::sD3D9SurfaceImageUsed -= mSize.width * mSize.height * 4;
   }
 }
@@ -137,47 +131,56 @@ D3D9SurfaceImage::SetData(const Data& aD
 
   // Stash the surface description for later use.
   textureSurface->GetDesc(&mDesc);
 
   RECT src = { region.x, region.y, region.x+region.width, region.y+region.height };
   hr = device->StretchRect(surface, &src, textureSurface, nullptr, D3DTEXF_NONE);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
+  // Flush the draw command now, so that by the time we come to draw this
+  // image, we're less likely to need to wait for the draw operation to
+  // complete.
   RefPtr<IDirect3DQuery9> query;
   hr = device->CreateQuery(D3DQUERYTYPE_EVENT, byRef(query));
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
   hr = query->Issue(D3DISSUE_END);
   NS_ENSURE_TRUE(SUCCEEDED(hr), hr);
 
   mTexture = texture;
   mShareHandle = shareHandle;
   mSize = gfx::IntSize(region.width, region.height);
+  mQuery = query;
 
-  int iterations = 0;
-  while (true) {
-    HRESULT hr = query->GetData(nullptr, 0, D3DGETDATA_FLUSH);
-    if (hr == S_FALSE) {
-      Sleep(1);
-      iterations++;
-      continue;
-    }
-    if (FAILED(hr) || iterations >= kMaxWaitSyncMs) {
-      mIsValid = false;
-    }
-    break;
-  }
-  
   return S_OK;
 }
 
-bool
-D3D9SurfaceImage::IsValid()
+void
+D3D9SurfaceImage::EnsureSynchronized()
 {
-  return mIsValid;
+  RefPtr<IDirect3DQuery9> query = mQuery;
+  if (!query) {
+    // Not setup, or already synchronized.
+    return;
+  }
+  int iterations = 0;
+  while (iterations < 10 && S_FALSE == query->GetData(nullptr, 0, D3DGETDATA_FLUSH)) {
+    Sleep(1);
+    iterations++;
+  }
+  mQuery = nullptr;
+}
+
+HANDLE
+D3D9SurfaceImage::GetShareHandle()
+{
+  // Ensure the image has completed its synchronization,
+  // and safe to used by the caller on another device.
+  EnsureSynchronized();
+  return mShareHandle;
 }
 
 const D3DSURFACE_DESC&
 D3D9SurfaceImage::GetDesc() const
 {
   return mDesc;
 }
 
@@ -185,16 +188,17 @@ gfx::IntSize
 D3D9SurfaceImage::GetSize()
 {
   return mSize;
 }
 
 TextureClient*
 D3D9SurfaceImage::GetTextureClient(CompositableClient* aClient)
 {
+  EnsureSynchronized();
   if (!mTextureClient) {
     RefPtr<SharedTextureClientD3D9> textureClient =
       new SharedTextureClientD3D9(aClient->GetForwarder(),
                                   gfx::SurfaceFormat::B8G8R8X8,
                                   TextureFlags::DEFAULT);
     textureClient->InitWith(mTexture, mShareHandle, mDesc);
     mTextureClient = textureClient;
   }
@@ -207,16 +211,19 @@ D3D9SurfaceImage::GetAsSourceSurface()
   NS_ENSURE_TRUE(mTexture, nullptr);
 
   HRESULT hr;
   RefPtr<gfx::DataSourceSurface> surface = gfx::Factory::CreateDataSourceSurface(mSize, gfx::SurfaceFormat::B8G8R8X8);
   if (NS_WARN_IF(!surface)) {
     return nullptr;
   }
 
+  // Ensure that the texture is ready to be used.
+  EnsureSynchronized();
+
   // Readback the texture from GPU memory into system memory, so that
   // we can copy it into the Cairo image. This is expensive.
   RefPtr<IDirect3DSurface9> textureSurface;
   hr = mTexture->GetSurfaceLevel(0, byRef(textureSurface));
   NS_ENSURE_TRUE(SUCCEEDED(hr), nullptr);
 
   RefPtr<IDirect3DDevice9> device;
   hr = mTexture->GetDevice(byRef(device));
--- a/gfx/layers/D3D9SurfaceImage.h
+++ b/gfx/layers/D3D9SurfaceImage.h
@@ -36,31 +36,39 @@ public:
 
   // Copies the surface into a sharable texture's surface, and initializes
   // the image.
   HRESULT SetData(const Data& aData);
 
   // Returns the description of the shared surface.
   const D3DSURFACE_DESC& GetDesc() const;
 
+  // Returns the HANDLE that can be used to open the image as a shared resource.
+  // If the operation to copy the original resource to the shared resource
+  // hasn't finished yet, this function blocks until the synchronization is
+  // complete.
+  HANDLE GetShareHandle();
+
   gfx::IntSize GetSize() MOZ_OVERRIDE;
 
   virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() MOZ_OVERRIDE;
 
   virtual TextureClient* GetTextureClient(CompositableClient* aClient) MOZ_OVERRIDE;
   virtual uint8_t* GetBuffer() MOZ_OVERRIDE { return nullptr; }
 
-  virtual bool IsValid() MOZ_OVERRIDE;
+private:
 
-private:
+  // Blocks the calling thread until the copy operation started in SetData()
+  // is complete, whereupon the texture is safe to use.
+  void EnsureSynchronized();
 
   gfx::IntSize mSize;
   RefPtr<IDirect3DTexture9> mTexture;
+  RefPtr<IDirect3DQuery9> mQuery;
   RefPtr<TextureClient> mTextureClient;
   HANDLE mShareHandle;
   D3DSURFACE_DESC mDesc;
-  bool mIsValid;
 };
 
 } // namepace layers
 } // namespace mozilla
 
 #endif // GFX_D3DSURFACEIMAGE_H
--- a/gfx/layers/ImageContainer.h
+++ b/gfx/layers/ImageContainer.h
@@ -163,18 +163,16 @@ public:
 
   int32_t GetSerial() { return mSerial; }
 
   void MarkSent() { mSent = true; }
   bool IsSentToCompositor() { return mSent; }
 
   virtual TemporaryRef<gfx::SourceSurface> GetAsSourceSurface() = 0;
 
-  virtual bool IsValid() { return true; }
-
   virtual GrallocImage* AsGrallocImage()
   {
     return nullptr;
   }
 
 protected:
   Image(void* aImplData, ImageFormat aFormat) :
     mImplData(aImplData),
--- a/gfx/thebes/gfxQuartzNativeDrawing.cpp
+++ b/gfx/thebes/gfxQuartzNativeDrawing.cpp
@@ -39,23 +39,26 @@ gfxQuartzNativeDrawing::BeginNativeDrawi
       return nullptr;
     }
 
     mTempDrawTarget =
       Factory::CreateDrawTarget(BackendType::COREGRAPHICS,
                                 IntSize(mNativeRect.width, mNativeRect.height),
                                 SurfaceFormat::B8G8R8A8);
 
-    transform.PostTranslate(-mNativeRect.x, -mNativeRect.y);
-    mTempDrawTarget->SetTransform(transform);
-
+    if (mTempDrawTarget) {
+        transform.PostTranslate(-mNativeRect.x, -mNativeRect.y);
+        mTempDrawTarget->SetTransform(transform);
+    }
     dt = mTempDrawTarget;
   }
-  mCGContext = mBorrowedContext.Init(dt);
-  MOZ_ASSERT(mCGContext);
+  if (dt) {
+    mCGContext = mBorrowedContext.Init(dt);
+    MOZ_ASSERT(mCGContext);
+  }
   return mCGContext;
 }
 
 void
 gfxQuartzNativeDrawing::EndNativeDrawing()
 {
   NS_ASSERTION(mCGContext, "EndNativeDrawing called without BeginNativeDrawing");
 
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -189,24 +189,24 @@ class LifoAlloc
             last->setNext(start);
         else
             first = latest = start;
         last = end;
     }
 
     // Append used chunks to the end of this LifoAlloc. We act as if all the
     // chunks in |this| are used, even if they're not, so memory may be wasted.
-    void appendUsed(BumpChunk *start, BumpChunk *latest, BumpChunk *end) {
-        MOZ_ASSERT(start && latest &&  end);
+    void appendUsed(BumpChunk *otherFirst, BumpChunk *otherLatest, BumpChunk *otherLast) {
+        MOZ_ASSERT(otherFirst && otherLatest && otherLast);
         if (last)
-            last->setNext(start);
+            last->setNext(otherFirst);
         else
-            first = latest = start;
-        last = end;
-        this->latest = latest;
+            first = otherFirst;
+        latest = otherLatest;
+        last = otherLast;
     }
 
     void incrementCurSize(size_t size) {
         curSize_ += size;
         if (curSize_ > peakSize_)
             peakSize_ = curSize_;
     }
     void decrementCurSize(size_t size) {
--- a/layout/reftests/svg/fragmentIdentifier-01.xhtml
+++ b/layout/reftests/svg/fragmentIdentifier-01.xhtml
@@ -1,16 +1,17 @@
 <html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
   <head>
     <title>Testcases for SVG fragment identifiers</title>
   </head>
   <body style="background-color: lime;">
     <div>
       <object type="image/svg+xml" width="100" height="100" data="fragmentIdentifier-rect-01.svg#limeView" />
       <object type="image/svg+xml" width="100" height="100" data="fragmentIdentifier-rect-01.svg#svgView(viewBox(0,200,100,100))" />
+      <object type="image/svg+xml" width="100" height="100" data="fragmentIdentifier-rect-01.svg#view" />
     </div>
     <div>
       <object type="image/svg+xml" width="100" height="100" data="fragmentIdentifier-rect-01.svg#svgView(viewBox(0,0,100,100);transform(translate(0,200)))" />
       <object id="replace" type="image/svg+xml" width="100" height="100" data="fragmentIdentifier-rect-01.svg#svgView(viewBox(0,0,100,100);transform(translate(0,0))" />
       <object id="remove" type="image/svg+xml" width="100" height="100" data="fragmentIdentifier-rect-01.svg#svgView(viewBox(0,200,100,100);transform(translate(0,200)))" />
     </div>
     <script type="text/javascript">
       window.onload = function() {
--- a/layout/reftests/svg/fragmentIdentifier-rect-01.svg
+++ b/layout/reftests/svg/fragmentIdentifier-rect-01.svg
@@ -1,9 +1,19 @@
 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
      xmlns:xlink="http://www.w3.org/1999/xlink">
 
+  <style>
+      view:target + a rect {
+          fill: lime;
+      }
+  </style>
+
   <view id="limeView" viewBox="0 200 100 100"/>
 
   <rect fill="red" height="100%" width="100%"/>
   <rect fill="lime" x="0" y="200" height="100" width="100"/>
 
+  <view id="view" viewBox="200 200 100 100"/>
+  <a xlink:href="#view">
+      <rect fill="red" x="200" y="200" height="100" width="100"/>
+  </a>
 </svg>
--- a/media/gmp-clearkey/0.1/ClearKeySession.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeySession.cpp
@@ -5,17 +5,16 @@
 #include "ClearKeyDecryptionManager.h"
 #include "ClearKeySession.h"
 #include "ClearKeyUtils.h"
 #include "ClearKeyStorage.h"
 #include "gmp-task-utils.h"
 
 #include "gmp-api/gmp-decryption.h"
 #include "mozilla/Endian.h"
-#include "pk11pub.h"
 
 using namespace mozilla;
 
 ClearKeySession::ClearKeySession(const std::string& aSessionId,
                                  GMPDecryptorCallback* aCallback,
                                  GMPSessionType aSessionType)
   : mSessionId(aSessionId)
   , mCallback(aCallback)
--- a/media/gmp-clearkey/0.1/ClearKeyUtils.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeyUtils.cpp
@@ -390,45 +390,51 @@ Decode6Bit(string& aStr)
       break;
     }
   }
 
   return true;
 }
 
 static bool
-DecodeBase64(string& aEncoded, vector<uint8_t>& aOutDecoded)
+DecodeBase64KeyOrId(string& aEncoded, vector<uint8_t>& aOutDecoded)
 {
-  if (!Decode6Bit(aEncoded)) {
+  if (aEncoded.size() != 22 || // Can't decode to 16 byte CENC key or keyId.
+      !Decode6Bit(aEncoded)) {
     return false;
   }
 
   // The number of bytes we haven't yet filled in the current byte, mod 8.
   int shift = 0;
 
-  aOutDecoded.resize(aEncoded.length() * 6 / 8);
-  aOutDecoded.reserve(aEncoded.length() * 6 / 8 + 1);
-  auto out = aOutDecoded.begin();
+  aOutDecoded.resize(16);
+  vector<uint8_t>::iterator out = aOutDecoded.begin();
   for (size_t i = 0; i < aEncoded.length(); i++) {
     if (!shift) {
       *out = aEncoded[i] << 2;
     } else {
       *out |= aEncoded[i] >> (6 - shift);
-      *(++out) = aEncoded[i] << (shift + 2);
+      out++;
+      if (out == aOutDecoded.end()) {
+        // Hit last 6bit octed in encoded, which is padding and can be ignored.
+        break;
+      }
+      *out = aEncoded[i] << (shift + 2);
     }
     shift = (shift + 2) % 8;
   }
 
   return true;
 }
 
 static bool
 DecodeKey(string& aEncoded, Key& aOutDecoded)
 {
-  return DecodeBase64(aEncoded, aOutDecoded) &&
+  return
+    DecodeBase64KeyOrId(aEncoded, aOutDecoded) &&
     // Key should be 128 bits long.
     aOutDecoded.size() == CLEARKEY_KEY_LEN;
 }
 
 static bool
 ParseKeyObject(ParserContext& aCtx, KeyIdPair& aOutKey)
 {
   EXPECT_SYMBOL(aCtx, '{');
@@ -472,17 +478,17 @@ ParseKeyObject(ParserContext& aCtx, KeyI
     if (!sym || sym == '}') {
       break;
     }
     EXPECT_SYMBOL(aCtx, ',');
   }
 
   return !key.empty() &&
          !keyId.empty() &&
-         DecodeBase64(keyId, aOutKey.mKeyId) &&
+         DecodeBase64KeyOrId(keyId, aOutKey.mKeyId) &&
          DecodeKey(key, aOutKey.mKey) &&
          GetNextSymbol(aCtx) == '}';
 }
 
 static bool
 ParseKeys(ParserContext& aCtx, vector<KeyIdPair>& aOutKeys)
 {
   // Consume start of array.
--- a/media/gmp-clearkey/0.1/WMFAACDecoder.cpp
+++ b/media/gmp-clearkey/0.1/WMFAACDecoder.cpp
@@ -12,16 +12,17 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "WMFAACDecoder.h"
 #include <algorithm>
 #include <stdint.h>
+#include <vector>
 
 using std::vector;
 
 namespace wmf {
 
 WMFAACDecoder::WMFAACDecoder()
   : mDecoder(nullptr)
   , mChannels(0)
--- a/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
+++ b/media/gmp-clearkey/0.1/WMFH264Decoder.cpp
@@ -10,16 +10,17 @@
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "WMFH264Decoder.h"
+#include <algorithm>
 
 namespace wmf {
 
 WMFH264Decoder::WMFH264Decoder()
   : mDecoder(nullptr)
 {
   memset(&mInputStreamInfo, 0, sizeof(MFT_INPUT_STREAM_INFO));
   memset(&mOutputStreamInfo, 0, sizeof(MFT_OUTPUT_STREAM_INFO));
--- a/media/gmp-clearkey/0.1/WMFUtils.cpp
+++ b/media/gmp-clearkey/0.1/WMFUtils.cpp
@@ -50,17 +50,17 @@ namespace wmf {
 
 static bool
 LinkMfplat()
 {
   static bool sInitDone = false;
   static bool sInitOk = false;
   if (!sInitDone) {
     sInitDone = true;
-    auto handle = GetModuleHandle("mfplat.dll");
+    auto handle = GetModuleHandleA("mfplat.dll");
 #define MFPLAT_FUNC(_func) \
     if (!(_func = (decltype(_func))(GetProcAddress(handle, #_func)))) { \
       return false; \
     }
 #include "WMFSymbols.h"
 #undef MFPLAT_FUNC
     sInitOk = true;
   }
@@ -69,19 +69,19 @@ LinkMfplat()
 
 bool
 EnsureLibs()
 {
   static bool sInitDone = false;
   static bool sInitOk = false;
   if (!sInitDone) {
     sInitOk = LinkMfplat() &&
-      !!GetModuleHandle("msauddecmft.dll") &&
-      !!GetModuleHandle("msmpeg2adec.dll") &&
-      !!GetModuleHandle("msmpeg2vdec.dll");
+      !!GetModuleHandleA("msauddecmft.dll") &&
+      !!GetModuleHandleA("msmpeg2adec.dll") &&
+      !!GetModuleHandleA("msmpeg2vdec.dll");
     sInitDone = true;
   }
   return sInitOk;
 }
 
 int32_t
 MFOffsetToInt32(const MFOffset& aOffset)
 {
@@ -178,17 +178,17 @@ void dump(const uint8_t* data, uint32_t 
   fclose(f);
 }
 
 HRESULT
 CreateMFT(const CLSID& clsid,
           const char* aDllName,
           CComPtr<IMFTransform>& aOutMFT)
 {
-  HMODULE module = ::GetModuleHandle(aDllName);
+  HMODULE module = ::GetModuleHandleA(aDllName);
   if (!module) {
     LOG("Failed to get %S\n", aDllName);
     return E_FAIL;
   }
 
   typedef HRESULT (WINAPI* DllGetClassObjectFnPtr)(const CLSID& clsid,
                                                    const IID& iid,
                                                    void** object);
--- a/media/libstagefright/binding/Index.cpp
+++ b/media/libstagefright/binding/Index.cpp
@@ -141,16 +141,20 @@ MP4Sample* SampleIterator::GetNext()
       if (reader.Remaining() < count * 6) {
         return nullptr;
       }
 
       for (size_t i = 0; i < count; i++) {
         sample->crypto.plain_sizes.AppendElement(reader.ReadU16());
         sample->crypto.encrypted_sizes.AppendElement(reader.ReadU32());
       }
+    } else {
+      // No subsample information means the entire sample is encrypted.
+      sample->crypto.plain_sizes.AppendElement(0);
+      sample->crypto.encrypted_sizes.AppendElement(sample->size);
     }
   }
 
   Next();
 
   return sample.forget();
 }
 
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -448,19 +448,19 @@ pref("media.track.enabled", false);
 // configurations because code for those platforms isn't ready yet.
 #if defined(XP_WIN) || defined(XP_MACOSX)
 pref("media.mediasource.enabled", true);
 #else
 pref("media.mediasource.enabled", false);
 #endif
 
 #ifdef RELEASE_BUILD
-pref("media.mediasource.youtubeonly", true);
+pref("media.mediasource.whitelist", true);
 #else
-pref("media.mediasource.youtubeonly", false);
+pref("media.mediasource.whitelist", false);
 #endif // RELEASE_BUILD
 
 pref("media.mediasource.mp4.enabled", true);
 pref("media.mediasource.webm.enabled", false);
 
 #ifdef MOZ_WEBSPEECH
 pref("media.webspeech.recognition.enable", false);
 pref("media.webspeech.synth.enabled", false);
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -3651,8 +3651,10 @@ WebSocketChannel::SaveNetworkStats(bool 
   return NS_OK;
 #else
   return NS_ERROR_NOT_IMPLEMENTED;
 #endif
 }
 
 } // namespace mozilla::net
 } // namespace mozilla
+
+#undef CLOSE_GOING_AWAY
--- a/netwerk/protocol/websocket/moz.build
+++ b/netwerk/protocol/websocket/moz.build
@@ -13,19 +13,17 @@ XPIDL_MODULE = 'necko_websocket'
 
 EXPORTS.mozilla.net += [
     'BaseWebSocketChannel.h',
     'WebSocketChannel.h',
     'WebSocketChannelChild.h',
     'WebSocketChannelParent.h',
 ]
 
-# These files cannot be built in unified mode because they want to force NSPR
-# logging.
-SOURCES += [
+UNIFIED_SOURCES += [
     'BaseWebSocketChannel.cpp',
     'WebSocketChannel.cpp',
     'WebSocketChannelChild.cpp',
     'WebSocketChannelParent.cpp',
 ]
 
 IPDL_SOURCES += [
     'PWebSocket.ipdl',
--- a/netwerk/protocol/wyciwyg/moz.build
+++ b/netwerk/protocol/wyciwyg/moz.build
@@ -10,19 +10,17 @@ XPIDL_SOURCES += [
 
 XPIDL_MODULE = 'necko_wyciwyg'
 
 EXPORTS.mozilla.net += [
     'WyciwygChannelChild.h',
     'WyciwygChannelParent.h',
 ]
 
-# These files cannot be built in unified mode because they want to force NSPR
-# logging.
-SOURCES += [
+UNIFIED_SOURCES += [
     'nsWyciwyg.cpp',
     'nsWyciwygChannel.cpp',
     'nsWyciwygProtocolHandler.cpp',
     'WyciwygChannelChild.cpp',
     'WyciwygChannelParent.cpp',
 ]
 
 IPDL_SOURCES += [
--- a/testing/profiles/prefs_general.js
+++ b/testing/profiles/prefs_general.js
@@ -156,17 +156,17 @@ user_pref("layout.css.ruby.enabled", tru
 // Enable CSS Font Loading API for testing
 user_pref("layout.css.font-loading-api.enabled", true);
 
 // Disable spammy layout warnings because they pollute test logs
 user_pref("layout.spammy_warnings.enabled", false);
 
 // Enable Media Source Extensions for testing
 user_pref("media.mediasource.enabled", true);
-user_pref("media.mediasource.youtubeonly", false);
+user_pref("media.mediasource.whitelist", false);
 user_pref("media.mediasource.mp4.enabled", true);
 user_pref("media.mediasource.webm.enabled", true);
 
 // Enable mozContacts
 user_pref("dom.mozContacts.enabled", true);
 
 // Enable mozSettings
 user_pref("dom.mozSettings.enabled", true);
--- a/toolkit/components/printing/content/printUtils.js
+++ b/toolkit/components/printing/content/printUtils.js
@@ -64,42 +64,23 @@
  *
  */
 
 var gPrintSettingsAreGlobal = false;
 var gSavePrintSettings = false;
 var gFocusedElement = null;
 
 var PrintUtils = {
-  bailOut: function () {
-    let pref = Components.classes["@mozilla.org/preferences-service;1"]
-                         .getService(Components.interfaces.nsIPrefBranch);
-    let allow_for_testing = false;
-    try {
-      allow_for_testing = pref.getBoolPref("print.enable_e10s_testing");
-    } catch(e) {
-      // The pref wasn't set, so I guess we're not overriding.
-    }
-    if (this.usingRemoteTabs && !allow_for_testing) {
-      alert("e10s printing is not implemented yet. Bug 927188.");
-      return true;
-    }
-    return false;
-  },
-
   /**
    * Shows the page setup dialog, and saves any settings changed in
    * that dialog if print.save_print_settings is set to true.
    *
    * @return true on success, false on failure
    */
   showPageSetup: function () {
-    if (this.bailOut()) {
-      return;
-    }
     try {
       var printSettings = this.getPrintSettings();
       var PRINTPROMPTSVC = Components.classes["@mozilla.org/embedcomp/printingprompt-service;1"]
                                      .getService(Components.interfaces.nsIPrintingPromptService);
       PRINTPROMPTSVC.showPageSetup(window, printSettings, null);
       if (gSavePrintSettings) {
         // Page Setup data is a "native" setting on the Mac
         var PSSVC = Components.classes["@mozilla.org/gfx/printsettings-service;1"]
@@ -127,20 +108,16 @@ var PrintUtils = {
    *        not necessary if aWindow came from a non-remote browser, but is
    *        strictly required otherwise. This function will throw if aWindow
    *        comes from a remote browser and aBrowser is not provided. This
    *        browser must have its type attribute set to "content",
    *        "content-targetable", or "content-primary".
    */
   print: function (aWindow, aBrowser)
   {
-    if (this.bailOut()) {
-      return;
-    }
-
     if (!aWindow) {
       // If we're using remote browsers, chances are that window.content will
       // not be defined.
       if (this.usingRemoteTabs) {
         throw new Error("Windows running with remote tabs must explicitly pass " +
                         "a content window to PrintUtils.print.");
       }
       // Otherwise, we should have access to window.content.
@@ -200,19 +177,16 @@ var PrintUtils = {
    *
    *        These methods must be defined. printPreview can be called
    *        with aListenerObj as null iff this window is already displaying
    *        print preview (in which case, the previous aListenerObj passed
    *        to it will be used).
    */
   printPreview: function (aListenerObj)
   {
-    if (this.bailOut()) {
-      return;
-    }
     // if we're already in PP mode, don't set the listener; chances
     // are it is null because someone is calling printPreview() to
     // get us to refresh the display.
     if (!this.inPrintPreview) {
       this._listener = aListenerObj;
       this._sourceBrowser = aListenerObj.getSourceBrowser();
       this._originalTitle = this._sourceBrowser.contentTitle;
       this._originalURL = this._sourceBrowser.currentURI.spec;
--- a/widget/gtk/nsDeviceContextSpecG.cpp
+++ b/widget/gtk/nsDeviceContextSpecG.cpp
@@ -75,19 +75,17 @@ protected:
 
 //---------------
 // static members
 GlobalPrinters GlobalPrinters::mGlobalPrinters;
 nsTArray<nsString>* GlobalPrinters::mGlobalPrinterList = nullptr;
 //---------------
 
 nsDeviceContextSpecGTK::nsDeviceContextSpecGTK()
-  : mPrintJob(nullptr)
-  , mGtkPrinter(nullptr)
-  , mGtkPrintSettings(nullptr)
+  : mGtkPrintSettings(nullptr)
   , mGtkPageSetup(nullptr)
 {
   DO_PR_DEBUG_LOG(("nsDeviceContextSpecGTK::nsDeviceContextSpecGTK()\n"));
 }
 
 nsDeviceContextSpecGTK::~nsDeviceContextSpecGTK()
 {
   DO_PR_DEBUG_LOG(("nsDeviceContextSpecGTK::~nsDeviceContextSpecGTK()\n"));
@@ -115,16 +113,20 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::Ge
 
   // convert twips to points
   width  /= TWIPS_PER_POINT_FLOAT;
   height /= TWIPS_PER_POINT_FLOAT;
 
   DO_PR_DEBUG_LOG(("\"%s\", %f, %f\n", mPath, width, height));
   nsresult rv;
 
+  // We shouldn't be attempting to get a surface if we've already got a spool
+  // file.
+  MOZ_ASSERT(!mSpoolFile);
+
   // Spool file. Use Glib's temporary file function since we're
   // already dependent on the gtk software stack.
   gchar *buf;
   gint fd = g_file_open_tmp("XXXXXX.tmp", &buf, nullptr);
   if (-1 == fd)
     return NS_ERROR_GFX_PRINTER_COULD_NOT_OPEN_FILE;
   close(fd);
 
@@ -153,37 +155,28 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::Ge
 
   // Determine the real format with some GTK magic
   if (format == nsIPrintSettings::kOutputFormatNative) {
     if (mIsPPreview) {
       // There is nothing to detect on Print Preview, use PS.
       format = nsIPrintSettings::kOutputFormatPS;
     } else {
       const gchar* fmtGTK = gtk_print_settings_get(mGtkPrintSettings, GTK_PRINT_SETTINGS_OUTPUT_FILE_FORMAT);
-      if (!fmtGTK && GTK_IS_PRINTER(mGtkPrinter)) {
-        // Likely not print-to-file, check printer's capabilities
-
-        // Prior to gtk 2.24, gtk_printer_accepts_pdf() and
-        // gtk_printer_accepts_ps() always returned true regardless of the
-        // printer's capability.
-        if (gtk_major_version > 2 ||
-            (gtk_major_version == 2 && gtk_minor_version >= 24)) {
-          format =
-            gtk_printer_accepts_pdf(mGtkPrinter) ?
-            static_cast<int16_t>(nsIPrintSettings::kOutputFormatPDF) :
-            static_cast<int16_t>(nsIPrintSettings::kOutputFormatPS);
+      if (fmtGTK) {
+        if (nsDependentCString(fmtGTK).EqualsIgnoreCase("pdf")) {
+          format = nsIPrintSettings::kOutputFormatPDF;
         } else {
           format = nsIPrintSettings::kOutputFormatPS;
         }
+      }
+    }
 
-      } else if (nsDependentCString(fmtGTK).EqualsIgnoreCase("pdf")) {
-        format = nsIPrintSettings::kOutputFormatPDF;
-      } else {
-        format = nsIPrintSettings::kOutputFormatPS;
-      }
+    // If we haven't found the format at this point, we're sunk. :(
+    if (format == nsIPrintSettings::kOutputFormatNative) {
+      return NS_ERROR_FAILURE;
     }
   }
 
   if (format == nsIPrintSettings::kOutputFormatPDF) {
     surface = new gfxPDFSurface(stream, surfaceSize);
   } else {
     int32_t orientation;
     mPrintSettings->GetOrientation(&orientation);
@@ -212,32 +205,30 @@ NS_IMETHODIMP nsDeviceContextSpecGTK::In
                                            bool aIsPrintPreview)
 {
   DO_PR_DEBUG_LOG(("nsDeviceContextSpecGTK::Init(aPS=%p)\n", aPS));
 
   if (gtk_major_version < 2 ||
       (gtk_major_version == 2 && gtk_minor_version < 10))
     return NS_ERROR_NOT_AVAILABLE;  // I'm so sorry bz
 
-  mPrintSettings = aPS;
+  mPrintSettings = do_QueryInterface(aPS);
+  if (!mPrintSettings)
+    return NS_ERROR_NO_INTERFACE;
+
   mIsPPreview = aIsPrintPreview;
 
   // This is only set by embedders
   bool toFile;
   aPS->GetPrintToFile(&toFile);
 
   mToPrinter = !toFile && !aIsPrintPreview;
 
-  nsCOMPtr<nsPrintSettingsGTK> printSettingsGTK(do_QueryInterface(aPS));
-  if (!printSettingsGTK)
-    return NS_ERROR_NO_INTERFACE;
-
-  mGtkPrinter = printSettingsGTK->GetGtkPrinter();
-  mGtkPrintSettings = printSettingsGTK->GetGtkPrintSettings();
-  mGtkPageSetup = printSettingsGTK->GetGtkPageSetup();
+  mGtkPrintSettings = mPrintSettings->GetGtkPrintSettings();
+  mGtkPageSetup = mPrintSettings->GetGtkPageSetup();
 
   // This is a horrible workaround for some printer driver bugs that treat custom page sizes different
   // to standard ones. If our paper object matches one of a standard one, use a standard paper size
   // object instead. See bug 414314 for more info.
   GtkPaperSize* geckosHackishPaperSize = gtk_page_setup_get_paper_size(mGtkPageSetup);
   GtkPaperSize* standardGtkPaperSize = gtk_paper_size_new(gtk_paper_size_get_name(geckosHackishPaperSize));
 
   mGtkPageSetup = gtk_page_setup_copy(mGtkPageSetup);
@@ -274,41 +265,91 @@ print_callback(GtkPrintJob *aJob, gpoint
 }
 
 static void
 ns_release_macro(gpointer aData) {
   nsIFile* spoolFile = (nsIFile*) aData;
   NS_RELEASE(spoolFile);
 }
 
+/* static */
+gboolean nsDeviceContextSpecGTK::PrinterEnumerator(GtkPrinter *aPrinter,
+                                                   gpointer aData) {
+  nsDeviceContextSpecGTK *spec = (nsDeviceContextSpecGTK*)aData;
+
+  // Find the printer whose name matches the one inside the settings.
+  nsXPIDLString printerName;
+  nsresult rv =
+    spec->mPrintSettings->GetPrinterName(getter_Copies(printerName));
+  if (NS_SUCCEEDED(rv) && printerName) {
+    NS_ConvertUTF16toUTF8 requestedName(printerName);
+    const char* currentName = gtk_printer_get_name(aPrinter);
+    if (requestedName.Equals(currentName)) {
+      nsDeviceContextSpecGTK::StartPrintJob(spec, aPrinter);
+      return TRUE;
+    }
+  }
+
+  // We haven't found it yet - keep searching...
+  return FALSE;
+}
+
+/* static */
+void nsDeviceContextSpecGTK::StartPrintJob(nsDeviceContextSpecGTK* spec,
+                                           GtkPrinter* printer) {
+  GtkPrintJob* job = gtk_print_job_new(spec->mTitle.get(),
+                                       printer,
+                                       spec->mGtkPrintSettings,
+                                       spec->mGtkPageSetup);
+
+  if (!gtk_print_job_set_source_file(job, spec->mSpoolName.get(), nullptr))
+    return;
+
+  NS_ADDREF(spec->mSpoolFile.get());
+  gtk_print_job_send(job, print_callback, spec->mSpoolFile, ns_release_macro);
+}
+
+void
+nsDeviceContextSpecGTK::EnumeratePrinters()
+{
+  gtk_enumerate_printers(&nsDeviceContextSpecGTK::PrinterEnumerator, this,
+                         nullptr, TRUE);
+}
+
 NS_IMETHODIMP nsDeviceContextSpecGTK::BeginDocument(const nsAString& aTitle, char16_t * aPrintToFileName,
                                                     int32_t aStartPage, int32_t aEndPage)
 {
-  if (mToPrinter) {
-    if (!GTK_IS_PRINTER(mGtkPrinter))
-      return NS_ERROR_FAILURE;
-
-    mPrintJob = gtk_print_job_new(NS_ConvertUTF16toUTF8(aTitle).get(), mGtkPrinter,
-                                  mGtkPrintSettings, mGtkPageSetup);
-  }
-
+  mTitle.Truncate();
+  AppendUTF16toUTF8(aTitle, mTitle);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsDeviceContextSpecGTK::EndDocument()
 {
   if (mToPrinter) {
-    if (!mPrintJob)
-      return NS_OK; // The operation was aborted.
+    // At this point, we might have a GtkPrinter set up in nsPrintSettingsGTK,
+    // or we might not. In the single-process case, we probably will, as this
+    // is populated by the print settings dialog, or set to the default
+    // printer.
+    // In the multi-process case, we proxy the print settings dialog over to
+    // the parent process, and only get the name of the printer back on the
+    // content process side. In that case, we need to enumerate the printers
+    // on the content side, and find a printer with a matching name.
 
-    if (!gtk_print_job_set_source_file(mPrintJob, mSpoolName.get(), nullptr))
-      return NS_ERROR_GFX_PRINTER_COULD_NOT_OPEN_FILE;
-
-    NS_ADDREF(mSpoolFile.get());
-    gtk_print_job_send(mPrintJob, print_callback, mSpoolFile, ns_release_macro);
+    GtkPrinter* printer = mPrintSettings->GetGtkPrinter();
+    if (printer) {
+      // We have a printer, so we can print right away.
+      nsDeviceContextSpecGTK::StartPrintJob(this, printer);
+    } else {
+      // We don't have a printer. We have to enumerate the printers and find
+      // one with a matching name.
+      nsCOMPtr<nsIRunnable> event =
+        NS_NewRunnableMethod(this, &nsDeviceContextSpecGTK::EnumeratePrinters);
+      NS_DispatchToCurrentThread(event);
+    }
   } else {
     // Handle print-to-file ourselves for the benefit of embedders
     nsXPIDLString targetPath;
     nsCOMPtr<nsIFile> destFile;
     mPrintSettings->GetToFileName(getter_Copies(targetPath));
 
     nsresult rv = NS_NewNativeLocalFile(NS_ConvertUTF16toUTF8(targetPath),
                                         false, getter_AddRefs(destFile));
--- a/widget/gtk/nsDeviceContextSpecG.h
+++ b/widget/gtk/nsDeviceContextSpecG.h
@@ -22,16 +22,18 @@
 #define NS_LANDSCAPE 1
 
 typedef enum
 {
   pmInvalid = 0,
   pmPostScript
 } PrintMethod;
 
+class nsPrintSettingsGTK;
+
 class nsDeviceContextSpecGTK : public nsIDeviceContextSpec
 {
 public:
   nsDeviceContextSpecGTK();
 
   NS_DECL_ISUPPORTS
 
   NS_IMETHOD GetSurfaceForPrinter(gfxASurface **surface) MOZ_OVERRIDE;
@@ -40,32 +42,36 @@ public:
                   bool aIsPrintPreview) MOZ_OVERRIDE;
   NS_IMETHOD BeginDocument(const nsAString& aTitle, char16_t * aPrintToFileName,
                            int32_t aStartPage, int32_t aEndPage) MOZ_OVERRIDE;
   NS_IMETHOD EndDocument() MOZ_OVERRIDE;
   NS_IMETHOD BeginPage() MOZ_OVERRIDE { return NS_OK; }
   NS_IMETHOD EndPage() MOZ_OVERRIDE { return NS_OK; }
 
   static nsresult GetPrintMethod(const char *aPrinter, PrintMethod &aMethod);
-  
+
 protected:
   virtual ~nsDeviceContextSpecGTK();
-  nsCOMPtr<nsIPrintSettings> mPrintSettings;
+  nsCOMPtr<nsPrintSettingsGTK> mPrintSettings;
   bool mToPrinter : 1;      /* If true, print to printer */
   bool mIsPPreview : 1;     /* If true, is print preview */
   char   mPath[PATH_MAX];     /* If toPrinter = false, dest file */
   char   mPrinter[256];       /* Printer name */
-  GtkPrintJob*      mPrintJob;
-  GtkPrinter*       mGtkPrinter;
   GtkPrintSettings* mGtkPrintSettings;
   GtkPageSetup*     mGtkPageSetup;
 
   nsCString         mSpoolName;
   nsCOMPtr<nsIFile> mSpoolFile;
+  nsCString         mTitle;
 
+private:
+  void EnumeratePrinters();
+  static gboolean PrinterEnumerator(GtkPrinter *aPrinter, gpointer aData);
+  static void StartPrintJob(nsDeviceContextSpecGTK *spec,
+                            GtkPrinter *printer);
 };
 
 //-------------------------------------------------------------------------
 // Printer Enumerator
 //-------------------------------------------------------------------------
 class nsPrinterEnumeratorGTK MOZ_FINAL : public nsIPrinterEnumerator
 {
   ~nsPrinterEnumeratorGTK() {}
--- a/widget/gtk/nsPrintOptionsGTK.cpp
+++ b/widget/gtk/nsPrintOptionsGTK.cpp
@@ -1,15 +1,17 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
 #include "nsPrintOptionsGTK.h"
 #include "nsPrintSettingsGTK.h"
 
+using namespace mozilla::embedding;
 
 /** ---------------------------------------------------
  *  See documentation in nsPrintOptionsWin.h
  *	@update 6/21/00 dwc
  */
 nsPrintOptionsGTK::nsPrintOptionsGTK()
 {
 
@@ -18,21 +20,84 @@ nsPrintOptionsGTK::nsPrintOptionsGTK()
 /** ---------------------------------------------------
  *  See documentation in nsPrintOptionsImpl.h
  *	@update 6/21/00 dwc
  */
 nsPrintOptionsGTK::~nsPrintOptionsGTK()
 {
 }
 
+static void
+serialize_gtk_printsettings_to_printdata(const gchar *key,
+                                         const gchar *value,
+                                         gpointer aData)
+{
+  PrintData* data = (PrintData*)aData;
+  CStringKeyValue pair;
+  pair.key() = key;
+  pair.value() = value;
+  data->GTKPrintSettings().AppendElement(pair);
+}
+
+NS_IMETHODIMP
+nsPrintOptionsGTK::SerializeToPrintData(nsIPrintSettings* aSettings,
+                                        nsIWebBrowserPrint* aWBP,
+                                        PrintData* data)
+{
+  nsresult rv = nsPrintOptions::SerializeToPrintData(aSettings, aWBP, data);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  nsCOMPtr<nsPrintSettingsGTK> settingsGTK(do_QueryInterface(aSettings));
+  NS_ENSURE_STATE(settingsGTK);
+
+  GtkPrintSettings* gtkPrintSettings = settingsGTK->GetGtkPrintSettings();
+  NS_ENSURE_STATE(gtkPrintSettings);
+
+  gtk_print_settings_foreach(
+    gtkPrintSettings,
+    serialize_gtk_printsettings_to_printdata,
+    data);
+
+  return NS_OK;
+}
+
+NS_IMETHODIMP
+nsPrintOptionsGTK::DeserializeToPrintSettings(const PrintData& data,
+                                              nsIPrintSettings* settings)
+{
+  nsCOMPtr<nsPrintSettingsGTK> settingsGTK(do_QueryInterface(settings));
+  NS_ENSURE_STATE(settingsGTK);
+
+  nsresult rv = nsPrintOptions::DeserializeToPrintSettings(data, settings);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  // Instead of re-using the GtkPrintSettings that nsIPrintSettings is
+  // wrapping, we'll create a new one to deserialize to and replace it
+  // within nsIPrintSettings.
+  GtkPrintSettings* newGtkPrintSettings = gtk_print_settings_new();
+
+  for (uint32_t i = 0; i < data.GTKPrintSettings().Length(); ++i) {
+    CStringKeyValue pair = data.GTKPrintSettings()[i];
+    gtk_print_settings_set(newGtkPrintSettings,
+                           pair.key().get(),
+                           pair.value().get());
+  }
+
+  settingsGTK->SetGtkPrintSettings(newGtkPrintSettings);
+
+  // nsPrintSettingsGTK is holding a reference to newGtkPrintSettings
+  g_object_unref(newGtkPrintSettings);
+  newGtkPrintSettings = nullptr;
+  return NS_OK;
+}
+
 /* nsIPrintSettings CreatePrintSettings (); */
 nsresult nsPrintOptionsGTK::_CreatePrintSettings(nsIPrintSettings **_retval)
 {
   *_retval = nullptr;
   nsPrintSettingsGTK* printSettings = new nsPrintSettingsGTK(); // does not initially ref count
   NS_ENSURE_TRUE(printSettings, NS_ERROR_OUT_OF_MEMORY);
 
   NS_ADDREF(*_retval = printSettings); // ref count
 
   return NS_OK;
 }
 
-
--- a/widget/gtk/nsPrintOptionsGTK.h
+++ b/widget/gtk/nsPrintOptionsGTK.h
@@ -4,25 +4,37 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsPrintOptionsGTK_h__
 #define nsPrintOptionsGTK_h__
 
 #include "nsPrintOptionsImpl.h"  
 
+namespace mozilla
+{
+namespace embedding
+{
+  struct PrintData;
+} // namespace embedding
+} // namespace mozilla
 
 //*****************************************************************************
 //***    nsPrintOptions
 //*****************************************************************************
 class nsPrintOptionsGTK : public nsPrintOptions
 {
 public:
   nsPrintOptionsGTK();
   virtual ~nsPrintOptionsGTK();
 
+  NS_IMETHODIMP SerializeToPrintData(nsIPrintSettings* aSettings,
+                                     nsIWebBrowserPrint* aWBP,
+                                     mozilla::embedding::PrintData* data);
+  NS_IMETHODIMP DeserializeToPrintSettings(const mozilla::embedding::PrintData& data,
+                                           nsIPrintSettings* settings);
+
   virtual nsresult _CreatePrintSettings(nsIPrintSettings **_retval);
-
 };
 
 
 
 #endif /* nsPrintOptions_h__ */
--- a/widget/gtk/nsPrintSettingsGTK.cpp
+++ b/widget/gtk/nsPrintSettingsGTK.cpp
@@ -193,18 +193,29 @@ nsPrintSettingsGTK::SetGtkPrintSettings(
 
 /** ---------------------------------------------------
  */
 void
 nsPrintSettingsGTK::SetGtkPrinter(GtkPrinter *aPrinter)
 {
   if (mGTKPrinter)
     g_object_unref(mGTKPrinter);
-  
+
   mGTKPrinter = (GtkPrinter*) g_object_ref(aPrinter);
+
+  // Prior to gtk 2.24, gtk_printer_accepts_pdf() and
+  // gtk_printer_accepts_ps() always returned true regardless of the
+  // printer's capability.
+  bool shouldTrustGTK =
+    (gtk_major_version > 2 ||
+     (gtk_major_version == 2 && gtk_minor_version >= 24));
+  bool acceptsPDF = shouldTrustGTK && gtk_printer_accepts_pdf(mGTKPrinter);
+
+  SetOutputFormat(acceptsPDF ? nsIPrintSettings::kOutputFormatPDF
+                             : nsIPrintSettings::kOutputFormatPS);
 }
 
 /**
  * Reimplementation of nsPrintSettings functions so that we get the values
  * from the GTK objects rather than our own variables.
  */
 
 /* attribute long printRange; */
@@ -753,19 +764,21 @@ nsPrintSettingsGTK::SetResolution(int32_
 {
   gtk_print_settings_set_resolution(mPrintSettings, aResolution);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPrintSettingsGTK::GetDuplex(int32_t *aDuplex)
 {
-  if (!gtk_print_settings_has_key(mPrintSettings, GTK_PRINT_SETTINGS_DUPLEX))
-    return NS_ERROR_FAILURE;
-  *aDuplex = gtk_print_settings_get_duplex(mPrintSettings);
+  if (!gtk_print_settings_has_key(mPrintSettings, GTK_PRINT_SETTINGS_DUPLEX)) {
+    *aDuplex = GTK_PRINT_DUPLEX_SIMPLEX;
+  } else {
+    *aDuplex = gtk_print_settings_get_duplex(mPrintSettings);
+  }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsPrintSettingsGTK::SetDuplex(int32_t aDuplex)
 {
   MOZ_ASSERT(aDuplex >= GTK_PRINT_DUPLEX_SIMPLEX &&
              aDuplex <= GTK_PRINT_DUPLEX_VERTICAL,