Merge b2g-inbound to m-c.
authorRyan VanderMeulen <ryanvm@gmail.com>
Sat, 01 Feb 2014 17:22:20 -0500
changeset 166445 f66e1ff54609fcb5386be739c8fe9017d27f270e
parent 166434 d09f9a9f81ae8cba40ac5a65ca0ef86d428ff802 (current diff)
parent 166444 c5b7d3d1d5ee0ab81565e54213849dd9512fd4ab (diff)
child 166446 3e40f7389d1b9a6d81427e0bcae6666a9963bddc
child 166463 c78aa51b8a9cc270bb9a3f1da281372d418cca04
child 166531 b973195f0aaf72c4c6f49c2c0158b46900dfcfb1
child 166540 bb2ea99adc11433fda94cdda56dea9b9f6db7eb0
push id26125
push userryanvm@gmail.com
push dateSat, 01 Feb 2014 22:22:25 +0000
treeherdermozilla-central@f66e1ff54609 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone29.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 b2g-inbound to m-c.
--- a/accessible/src/jsat/content-script.js
+++ b/accessible/src/jsat/content-script.js
@@ -15,18 +15,16 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 XPCOMUtils.defineLazyModuleGetter(this, 'Presentation',
   'resource://gre/modules/accessibility/Presentation.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'TraversalRules',
   'resource://gre/modules/accessibility/TraversalRules.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Utils',
   'resource://gre/modules/accessibility/Utils.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'EventManager',
   'resource://gre/modules/accessibility/EventManager.jsm');
-XPCOMUtils.defineLazyModuleGetter(this, 'ObjectWrapper',
-  'resource://gre/modules/ObjectWrapper.jsm');
 XPCOMUtils.defineLazyModuleGetter(this, 'Roles',
   'resource://gre/modules/accessibility/Constants.jsm');
 
 Logger.debug('content-script.js');
 
 let eventManager = null;
 
 function moveCursor(aMessage) {
--- a/b2g/chrome/content/payment.js
+++ b/b2g/chrome/content/payment.js
@@ -42,18 +42,16 @@ XPCOMUtils.defineLazyServiceGetter(this,
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsIMessageSender");
 
 XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
                                    "@mozilla.org/uuid-generator;1",
                                    "nsIUUIDGenerator");
 
 #ifdef MOZ_B2G_RIL
-Cu.import('resource://gre/modules/ObjectWrapper.jsm');
-
 XPCOMUtils.defineLazyServiceGetter(this, "gRil",
                                    "@mozilla.org/ril;1",
                                    "nsIRadioInterfaceLayer");
 
 XPCOMUtils.defineLazyServiceGetter(this, "iccProvider",
                                    "@mozilla.org/ril/content-helper;1",
                                    "nsIIccProvider");
 
@@ -327,17 +325,17 @@ let PaymentProvider = {
           iccId: info.iccid,
           mcc: info.mcc,
           mnc: info.mnc,
           dataPrimary: i == this._settings.dataServiceId
         };
       }
     }
 
-    return ObjectWrapper.wrap(this._iccInfo, content);
+    return Cu.cloneInto(this._iccInfo, content);
   },
 
   _silentNumbers: null,
   _silentSmsObservers: null,
 
   sendSilentSms: function sendSilentSms(aNumber, aMessage) {
     if (_debug) {
       LOG("Sending silent message " + aNumber + " - " + aMessage);
--- a/b2g/chrome/content/shell.js
+++ b/b2g/chrome/content/shell.js
@@ -5,17 +5,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Cu.import('resource://gre/modules/ContactService.jsm');
 Cu.import('resource://gre/modules/SettingsChangeNotifier.jsm');
 Cu.import('resource://gre/modules/DataStoreChangeNotifier.jsm');
 Cu.import('resource://gre/modules/AlarmService.jsm');
 Cu.import('resource://gre/modules/ActivitiesService.jsm');
 Cu.import('resource://gre/modules/PermissionPromptHelper.jsm');
-Cu.import('resource://gre/modules/ObjectWrapper.jsm');
 Cu.import('resource://gre/modules/NotificationDB.jsm');
 Cu.import('resource://gre/modules/Payment.jsm');
 Cu.import("resource://gre/modules/AppsUtils.jsm");
 Cu.import('resource://gre/modules/UserAgentOverrides.jsm');
 Cu.import('resource://gre/modules/Keyboard.jsm');
 Cu.import('resource://gre/modules/ErrorPage.jsm');
 #ifdef MOZ_WIDGET_GONK
 Cu.import('resource://gre/modules/NetworkStatsService.jsm');
@@ -545,33 +544,33 @@ var shell = {
     let event = content.document.createEvent('CustomEvent');
     event.initCustomEvent(type, true, true, details ? details : {});
     content.dispatchEvent(event);
   },
 
   sendCustomEvent: function shell_sendCustomEvent(type, details) {
     let content = getContentWindow();
     let event = content.document.createEvent('CustomEvent');
-    let payload = details ? ObjectWrapper.wrap(details, content) : {};
+    let payload = details ? Cu.cloneInto(details, content) : {};
     event.initCustomEvent(type, true, true, payload);
     content.dispatchEvent(event);
   },
 
   sendChromeEvent: function shell_sendChromeEvent(details) {
     if (!this.isHomeLoaded) {
       if (!('pendingChromeEvents' in this)) {
         this.pendingChromeEvents = [];
       }
 
       this.pendingChromeEvents.push(details);
       return;
     }
 
     this.sendEvent(getContentWindow(), "mozChromeEvent",
-                   ObjectWrapper.wrap(details, getContentWindow()));
+                   Cu.cloneInto(details, getContentWindow()));
   },
 
   openAppForSystemMessage: function shell_openAppForSystemMessage(msg) {
     let origin = Services.io.newURI(msg.manifest, null, null).prePath;
     let payload = {
       url: msg.uri,
       manifestURL: msg.manifest,
       isActivity: (msg.type == 'activity'),
--- a/b2g/components/FxAccountsMgmtService.jsm
+++ b/b2g/components/FxAccountsMgmtService.jsm
@@ -19,17 +19,16 @@
 "use strict";
 
 this.EXPORTED_SYMBOLS = ["FxAccountsMgmtService"];
 
 const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 Cu.import("resource://gre/modules/FxAccountsCommon.js");
 
 XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsManager",
   "resource://gre/modules/FxAccountsManager.jsm");
 
 this.FxAccountsMgmtService = {
 
   _sendChromeEvent: function(aEventName, aMsg) {
--- a/b2g/components/FxAccountsUIGlue.js
+++ b/b2g/components/FxAccountsUIGlue.js
@@ -3,17 +3,16 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict"
 
 const { interfaces: Ci, utils: Cu } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 Cu.import("resource://gre/modules/Promise.jsm");
 Cu.import("resource://gre/modules/FxAccountsCommon.js");
 
 XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
                                    "@mozilla.org/uuid-generator;1",
                                    "nsIUUIDGenerator");
 
 function FxAccountsUIGlue() {
--- a/b2g/config/emulator-ics/sources.xml
+++ b/b2g/config/emulator-ics/sources.xml
@@ -7,17 +7,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="87aa8679560ce09f6445621d6f370d9de722cdba"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
@@ -90,12 +90,12 @@
   <project name="platform/system/netd" path="system/netd" revision="3d298fde142bee3fc4f07f63f16f2d8ce42339c0"/>
   <project name="platform/system/vold" path="system/vold" revision="919829940468066a32f403980b43f6ebfee5d314"/>
   <!-- Emulator specific things -->
   <project name="android-development" path="development" remote="b2g" revision="4e236e65a5d652a66ac32590f69f2123d17cb4ad"/>
   <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="5be0a9c4b3c6c004786917fdb5bee248960d045b"/>
   <project name="platform/external/iproute2" path="external/iproute2" revision="c66c5716d5335e450f7a7b71ccc6a604fb2f41d2"/>
   <project 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="d2685281e2e54ca14d1df304867aa82c37b27162"/>
   <project 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="627f9b20fc518937b93747a7ff1ed4f5ed46e06f"/>
-  <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="a3daa50e9b5db558696951ae724f913e4e5c7489"/>
+  <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="c16df012d9649be75d6590f93aeacbdc24b29d53"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="11663426672fcc46e2a0f29239afa736b90635ba"/>
   <project name="android-sdk" path="sdk" remote="b2g" revision="5701d3cb45c2e848cc57003cda2e1141288ecae4"/>
 </manifest>
--- a/b2g/config/emulator-jb/sources.xml
+++ b/b2g/config/emulator-jb/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="317f25e0a4cb3e8e86e2b76c37a14081372f0307">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/emulator/sources.xml
+++ b/b2g/config/emulator/sources.xml
@@ -7,17 +7,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <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="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="eda08beb3ba9a159843c70ffde0f9660ec351eb9"/>
   <project name="platform_external_qemu" path="external/qemu" remote="b2g" revision="87aa8679560ce09f6445621d6f370d9de722cdba"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="dd924f92906085b831bf1cbbc7484d3c043d613c"/>
@@ -90,12 +90,12 @@
   <project name="platform/system/netd" path="system/netd" revision="3d298fde142bee3fc4f07f63f16f2d8ce42339c0"/>
   <project name="platform/system/vold" path="system/vold" revision="919829940468066a32f403980b43f6ebfee5d314"/>
   <!-- Emulator specific things -->
   <project name="android-development" path="development" remote="b2g" revision="4e236e65a5d652a66ac32590f69f2123d17cb4ad"/>
   <project name="device_generic_goldfish" path="device/generic/goldfish" remote="b2g" revision="5be0a9c4b3c6c004786917fdb5bee248960d045b"/>
   <project name="platform/external/iproute2" path="external/iproute2" revision="c66c5716d5335e450f7a7b71ccc6a604fb2f41d2"/>
   <project 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="d2685281e2e54ca14d1df304867aa82c37b27162"/>
   <project 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="627f9b20fc518937b93747a7ff1ed4f5ed46e06f"/>
-  <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="a3daa50e9b5db558696951ae724f913e4e5c7489"/>
+  <project name="platform/prebuilts/tools" path="prebuilts/tools" revision="c16df012d9649be75d6590f93aeacbdc24b29d53"/>
   <project name="platform_prebuilts_qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="11663426672fcc46e2a0f29239afa736b90635ba"/>
   <project name="android-sdk" path="sdk" remote="b2g" revision="5701d3cb45c2e848cc57003cda2e1141288ecae4"/>
 </manifest>
--- a/b2g/config/gaia.json
+++ b/b2g/config/gaia.json
@@ -1,4 +1,4 @@
 {
-    "revision": "56cedb487649ecd17173482c4ffe87d1bc298d86", 
+    "revision": "3f66811d103f803b94ec2c7127356ff3283073cd", 
     "repo_path": "/integration/gaia-central"
 }
--- a/b2g/config/hamachi/sources.xml
+++ b/b2g/config/hamachi/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
--- a/b2g/config/helix/sources.xml
+++ b/b2g/config/helix/sources.xml
@@ -5,17 +5,17 @@
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="d2eb6c7b6e1bc7643c17df2d9d9bcb1704d0b9ab"/>
--- a/b2g/config/inari/sources.xml
+++ b/b2g/config/inari/sources.xml
@@ -7,17 +7,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="ics_chocolate_rb4.2" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
   <project name="platform/bionic" path="bionic" revision="cd5dfce80bc3f0139a56b58aca633202ccaee7f8"/>
--- a/b2g/config/leo/sources.xml
+++ b/b2g/config/leo/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="b2g/ics_strawberry" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
--- a/b2g/config/mako/sources.xml
+++ b/b2g/config/mako/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/external/caf" name="caf"/>
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <!-- B2G specific things. -->
   <project name="platform_build" path="build" remote="b2g" revision="317f25e0a4cb3e8e86e2b76c37a14081372f0307">
     <copyfile dest="Makefile" src="core/root.mk"/>
   </project>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
-  <project name="gaia" path="gaia" remote="mozillaorg" revision="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <project name="valgrind" path="external/valgrind" remote="b2g" revision="905bfa3548eb75cf1792d0d8412b92113bbd4318"/>
   <project name="vex" path="external/VEX" remote="b2g" revision="c3d7efc45414f1b44cd9c479bb2758c91c4707c0"/>
   <!-- Stock Android things -->
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.1" path="prebuilts/clang/linux-x86/3.1" revision="5c45f43419d5582949284eee9cef0c43d866e03b"/>
   <project groups="linux" name="platform/prebuilts/clang/linux-x86/3.2" path="prebuilts/clang/linux-x86/3.2" revision="3748b4168e7bd8d46457d4b6786003bc6a5223ce"/>
--- a/b2g/config/wasabi/sources.xml
+++ b/b2g/config/wasabi/sources.xml
@@ -6,17 +6,17 @@
   <remote fetch="https://git.mozilla.org/releases" name="mozillaorg"/>
   <remote fetch="https://git.mozilla.org/external/apitrace" name="apitrace"/>
   <default remote="caf" revision="ics_chocolate_rb4.2" sync-j="4"/>
   <!-- Gonk specific things and forks -->
   <project name="platform_build" path="build" remote="b2g" revision="59605a7c026ff06cc1613af3938579b1dddc6cfe">
     <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="67f11d9b60750270f0bea834832e8108e95204e8"/>
+  <project name="gaia.git" path="gaia" remote="mozillaorg" revision="ba8b7bf62f871fff4b6a844504c969860c6889b7"/>
   <project name="gonk-misc" path="gonk-misc" remote="b2g" revision="e9b6626eddbc85873eaa2a9174a9bd5101e5c05f"/>
   <project name="rilproxy" path="rilproxy" remote="b2g" revision="827214fcf38d6569aeb5c6d6f31cb296d1f09272"/>
   <project name="librecovery" path="librecovery" remote="b2g" revision="84f2f2fce22605e17d511ff1767e54770067b5b5"/>
   <project name="moztt" path="external/moztt" remote="b2g" revision="e33ea242b4328fb0d1824c951f379332b5021512"/>
   <project name="apitrace" path="external/apitrace" remote="apitrace" revision="0ff2eb11982b9d3c7a3333900cf0d3a5c0f77e32"/>
   <project name="gonk-patches" path="patches" remote="b2g" revision="223a2421006e8f5da33f516f6891c87cae86b0f6"/>
   <!-- Stock Android things -->
   <project name="platform/abi/cpp" path="abi/cpp" revision="6426040f1be4a844082c9769171ce7f5341a5528"/>
--- a/b2g/confvars.sh
+++ b/b2g/confvars.sh
@@ -52,13 +52,13 @@ MOZ_TIME_MANAGER=1
 
 MOZ_B2G_CERTDATA=1
 MOZ_PAY=1
 MOZ_TOOLKIT_SEARCH=
 MOZ_PLACES=
 MOZ_B2G=1
 
 if test "$OS_TARGET" = "Android"; then
-MOZ_NUWA_PROCESS=1
+MOZ_NUWA_PROCESS=
 fi
 MOZ_FOLD_LIBS=1
 
 MOZ_JSDOWNLOADS=1
--- a/browser/base/content/test/chrome/test_aboutCrashed.xul
+++ b/browser/base/content/test/chrome/test_aboutCrashed.xul
@@ -60,26 +60,26 @@
       let errorPageReady = waitForErrorPage(frame1);
       frame1.docShell.chromeEventHandler.setAttribute("crashedPageTitle", "pageTitle");
       frame1.docShell.displayLoadError(Components.results.NS_ERROR_CONTENT_CRASHED, uri1, null);
 
       yield errorPageReady;
       frame1.docShell.chromeEventHandler.removeAttribute("crashedPageTitle");
 
       SimpleTest.is(frame1.contentDocument.documentURI,
-                    "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/1&c=UTF-8&d=pageTitle",
+                    "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/1&c=UTF-8&d=pageTitle&f=regular",
                     "Correct about:tabcrashed displayed for page with title.");
 
       errorPageReady = waitForErrorPage(frame2);
       frame2.docShell.displayLoadError(Components.results.NS_ERROR_CONTENT_CRASHED, uri2, null);
 
       yield errorPageReady;
 
       SimpleTest.is(frame2.contentDocument.documentURI,
-                    "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/2&c=UTF-8&d=%20",
+                    "about:tabcrashed?e=tabcrashed&u=http%3A//www.example.com/2&c=UTF-8&d=%20&f=regular",
                     "Correct about:tabcrashed displayed for page with no title.");
 
       SimpleTest.finish();
   });
   }
   ]]></script>
 
   <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;" />
--- a/content/media/encoder/fmp4_muxer/ISOControl.cpp
+++ b/content/media/encoder/fmp4_muxer/ISOControl.cpp
@@ -10,18 +10,16 @@
 #include "EncodedFrameContainer.h"
 
 namespace mozilla {
 
 // For MP4 creation_time and modification_time offset from January 1, 1904 to
 // January 1, 1970.
 #define iso_time_offset 2082844800
 
-const static uint32_t MUXING_BUFFER_SIZE = 512*1024;
-
 FragmentBuffer::FragmentBuffer(uint32_t aTrackType, uint32_t aFragDuration,
                                TrackMetadataBase* aMetadata)
   : mTrackType(aTrackType)
   , mFragDuration(aFragDuration)
   , mMediaStartTime(0)
   , mFragmentNumber(0)
   , mEOS(false)
 {
@@ -135,17 +133,18 @@ FragmentBuffer::GetFirstFragmentSampleSi
 ISOControl::ISOControl()
   : mAudioFragmentBuffer(nullptr)
   , mVideoFragmentBuffer(nullptr)
   , mFragNum(0)
   , mOutputSize(0)
   , mBitCount(0)
   , mBit(0)
 {
-  mOutBuffer.SetCapacity(MUXING_BUFFER_SIZE);
+  // Create a data array for first mp4 Box, ftyp.
+  mOutBuffers.SetLength(1);
   MOZ_COUNT_CTOR(ISOControl);
 }
 
 ISOControl::~ISOControl()
 {
   MOZ_COUNT_DTOR(ISOControl);
 }
 
@@ -245,32 +244,58 @@ ISOControl::GetFragment(uint32_t aType)
   } else if (aType == Video_Track){
     return mVideoFragmentBuffer;
   }
   MOZ_ASSERT(0);
   return nullptr;
 }
 
 nsresult
-ISOControl::GetBuf(nsTArray<uint8_t>& aOutBuf)
+ISOControl::GetBufs(nsTArray<nsTArray<uint8_t>>* aOutputBufs)
 {
-  mOutputSize += mOutBuffer.Length();
-  aOutBuf.SwapElements(mOutBuffer);
+  uint32_t len = mOutBuffers.Length();
+  for (uint32_t i = 0; i < len; i++) {
+    mOutBuffers[i].SwapElements(*aOutputBufs->AppendElement());
+    mOutputSize += mOutBuffers[i].Length();
+  }
   return FlushBuf();
 }
 
 nsresult
 ISOControl::FlushBuf()
 {
-  mOutBuffer.SetCapacity(MUXING_BUFFER_SIZE);
+  mOutBuffers.SetLength(1);
   mLastWrittenBoxPos = 0;
   return NS_OK;
 }
 
 uint32_t
+ISOControl::WriteAVData(nsTArray<uint8_t>& aArray)
+{
+  MOZ_ASSERT(!mBitCount);
+
+  uint32_t len = aArray.Length();
+  if (!len) {
+    return 0;
+  }
+
+  // The last element already has data, allocated a new element for pointer
+  // swapping.
+  if (mOutBuffers.LastElement().Length()) {
+    mOutBuffers.AppendElement();
+  }
+  // Swap the video/audio data pointer.
+  mOutBuffers.LastElement().SwapElements(aArray);
+  // Following data could be boxes, so appending a new uint8_t array here.
+  mOutBuffers.AppendElement();
+
+  return len;
+}
+
+uint32_t
 ISOControl::WriteBits(uint64_t aBits, size_t aNumBits)
 {
   uint8_t output_byte = 0;
 
   MOZ_ASSERT(aNumBits <= 64);
   // TODO: rewritten following with bitset?
   for (size_t i = aNumBits; i > 0; i--) {
     mBit |= (((aBits >> (i - 1)) & 1) << (8 - ++mBitCount));
@@ -282,29 +307,40 @@ ISOControl::WriteBits(uint64_t aBits, si
     }
   }
   return output_byte;
 }
 
 uint32_t
 ISOControl::Write(uint8_t* aBuf, uint32_t aSize)
 {
-  mOutBuffer.AppendElements(aBuf, aSize);
+  mOutBuffers.LastElement().AppendElements(aBuf, aSize);
   return aSize;
 }
 
 uint32_t
 ISOControl::Write(uint8_t aData)
 {
   MOZ_ASSERT(!mBitCount);
   Write((uint8_t*)&aData, sizeof(uint8_t));
   return sizeof(uint8_t);
 }
 
 uint32_t
+ISOControl::GetBufPos()
+{
+  uint32_t len = mOutBuffers.Length();
+  uint32_t pos = 0;
+  for (uint32_t i = 0; i < len; i++) {
+    pos += mOutBuffers.ElementAt(i).Length();
+  }
+  return pos;
+}
+
+uint32_t
 ISOControl::WriteFourCC(const char* aType)
 {
   // Bit operation should be aligned to byte before writing any byte data.
   MOZ_ASSERT(!mBitCount);
 
   uint32_t size = strlen(aType);
   if (size == 4) {
     return Write((uint8_t*)aType, size);
--- a/content/media/encoder/fmp4_muxer/ISOControl.h
+++ b/content/media/encoder/fmp4_muxer/ISOControl.h
@@ -2,17 +2,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef ISOCOMPOSITOR_H_
 #define ISOCOMPOSITOR_H_
 
 #include "mozilla/Endian.h"
-#include "TrackMetadataBase.h"
 #include "nsTArray.h"
 #include "ISOTrackMetadata.h"
 #include "EncodedFrameContainer.h"
 
 namespace mozilla {
 
 class Box;
 class ISOControl;
@@ -125,16 +124,19 @@ friend class Box;
 public:
   ISOControl();
   ~ISOControl();
 
   nsresult GenerateFtyp();
   nsresult GenerateMoov();
   nsresult GenerateMoof(uint32_t aTrackType);
 
+  // Swap elementary stream pointer to output buffers.
+  uint32_t WriteAVData(nsTArray<uint8_t>& aArray);
+
   uint32_t Write(uint8_t* aBuf, uint32_t aSize);
 
   uint32_t Write(uint8_t aData);
 
   template <typename T>
   uint32_t Write(T aData) {
     MOZ_ASSERT(!mBitCount);
 
@@ -155,18 +157,18 @@ public:
   }
 
   uint32_t WriteFourCC(const char* aType);
 
   // Bit writing. Note: it needs to be byte-boundary before using
   // others non-bit writing function.
   uint32_t WriteBits(uint64_t aBits, size_t aNumBits);
 
-  // This is called by GetContainerData and swap the buffer to aOutBuf.
-  nsresult GetBuf(nsTArray<uint8_t>& aOutBuf);
+  // This is called by GetContainerData and swap all the buffers to aOutputBuffers.
+  nsresult GetBufs(nsTArray<nsTArray<uint8_t>>* aOutputBufs);
 
   // Presentation time in seconds since midnight, Jan. 1, 1904, in UTC time.
   uint32_t GetTime();
 
   // current fragment number
   uint32_t GetCurFragmentNumber() { return mFragNum; }
 
   nsresult SetFragment(FragmentBuffer* aFragment);
@@ -179,37 +181,47 @@ public:
   // Track ID is the Metadata index in mMetaArray.
   uint32_t GetTrackID(uint32_t aTrackType);
   uint32_t GetNextTrackID();
 
   bool HasAudioTrack();
   bool HasVideoTrack();
 
 private:
-  uint32_t GetBufPos() { return mOutBuffer.Length(); }
+  uint32_t GetBufPos();
   nsresult FlushBuf();
 
   // Audio and video fragments are owned by ISOMediaWriter.
   // They don't need to worry about pointer going stale.
   FragmentBuffer* mAudioFragmentBuffer;
   FragmentBuffer* mVideoFragmentBuffer;
 
   // Generated fragment number
   uint32_t mFragNum;
 
   // The (index + 1) will be the track ID.
   nsTArray<nsRefPtr<TrackMetadataBase>> mMetaArray;
 
-  // TODO:
-  // ContainerWriter accepts a array of uint8_t array so it is possible to
-  // create a serial of small box header + swap the raw data pointer from
-  // WriteEncodedTrack to another array without any memory copy.
-  nsTArray<uint8_t> mOutBuffer;
+  // Array of output buffers.
+  // To save memory usage, audio/video sample will be swapped into a new element
+  // of this array.
+  //
+  // For example,
+  //   mOutBuffers[0] --> boxes (allocated by muxer)
+  //   mOutBuffers[1] --> video raw data (allocated by encoder)
+  //   mOutBuffers[2] --> video raw data (allocated by encoder)
+  //   mOutBuffers[3] --> video raw data (allocated by encoder)
+  //   mOutBuffers[4] --> boxes (allocated by muxer)
+  //   mOutBuffers[5] --> audio raw data (allocated by encoder)
+  //   ...etc.
+  //
+  nsTArray<nsTArray<uint8_t>> mOutBuffers;
 
-  // Last written position of current box, it is for box checking purpose.
+  // Last written position of current box, it is for box checking purpose and
+  // calculating the sample offset in moof.
   uint32_t mLastWrittenBoxPos;
 
   // Accumulate size of output fragments.
   uint64_t mOutputSize;
 
   // Bit writing operation. Note: the mBitCount should be 0 before any
   // byte-boundary writing method be called (Write(uint32_t), Write(uint16_t)...etc);
   // otherwise, there will be assertion on these functions.
--- a/content/media/encoder/fmp4_muxer/ISOMediaBoxes.cpp
+++ b/content/media/encoder/fmp4_muxer/ISOMediaBoxes.cpp
@@ -35,17 +35,20 @@ Box::BoxSizeChecker::BoxSizeChecker(ISOC
 }
 
 Box::BoxSizeChecker::~BoxSizeChecker()
 {
   uint32_t cur_size = mControl->GetBufPos();
   if ((cur_size - ori_size) != box_size) {
     MOZ_ASSERT(false);
   }
-  mControl->mLastWrittenBoxPos = mControl->mOutBuffer.Length();
+
+  // Keeps the last box size position, it is for counting the sample offset when
+  // generating moof.
+  mControl->mLastWrittenBoxPos += box_size;
   MOZ_COUNT_DTOR(BoxSizeChecker);
 }
 
 nsresult
 MediaDataBox::Generate(uint32_t* aBoxSize)
 {
   mFirstSampleOffset = size;
   mAllSampleSize = 0;
@@ -80,18 +83,19 @@ MediaDataBox::Write()
       nsTArray<nsRefPtr<EncodedFrame>> frames;
 
       // Here is the last time we get fragment frames, flush it!
       rv = frag->GetFirstFragment(frames, true);
       NS_ENSURE_SUCCESS(rv, rv);
 
       uint32_t len = frames.Length();
       for (uint32_t i = 0; i < len; i++) {
-        mControl->Write((uint8_t*)frames.ElementAt(i)->GetFrameData().Elements(),
-            frames.ElementAt(i)->GetFrameData().Length());
+        nsTArray<uint8_t> frame_buffer;
+        frames.ElementAt(i)->SwapOutFrameData(frame_buffer);
+        mControl->WriteAVData(frame_buffer);
       }
     }
   }
 
   return NS_OK;
 }
 
 MediaDataBox::MediaDataBox(uint32_t aTrackType, ISOControl* aControl)
--- a/content/media/encoder/fmp4_muxer/ISOMediaWriter.cpp
+++ b/content/media/encoder/fmp4_muxer/ISOMediaWriter.cpp
@@ -112,20 +112,22 @@ ISOMediaWriter::WriteEncodedTrack(const 
 
     frag->AddFrame(frame);
   }
 
   // Encoder should send CSD (codec specific data) frame before sending the
   // audio/video frames. When CSD data is ready, it is sufficient to generate a
   // moov data. If encoder doesn't send CSD yet, muxer needs to wait before
   // generating anything.
-  if (mType & Audio_Track && !mAudioFragmentBuffer->HasCSD()) {
+  if (mType & Audio_Track && (!mAudioFragmentBuffer ||
+                              !mAudioFragmentBuffer->HasCSD())) {
     return NS_OK;
   }
-  if (mType & Video_Track && !mVideoFragmentBuffer->HasCSD()) {
+  if (mType & Video_Track && (!mVideoFragmentBuffer ||
+                              !mVideoFragmentBuffer->HasCSD())) {
     return NS_OK;
   }
 
   // Only one FrameType in EncodedFrameContainer so it doesn't need to be
   // inside the for-loop.
   if (frag && (aFlags & END_OF_STREAM)) {
     frag->SetEndOfStream();
   }
@@ -188,18 +190,17 @@ nsresult
 ISOMediaWriter::GetContainerData(nsTArray<nsTArray<uint8_t>>* aOutputBufs,
                                  uint32_t aFlags)
 {
   if (mBlobReady) {
     if (mState == MUXING_DONE) {
       mIsWritingComplete = true;
     }
     mBlobReady = false;
-    aOutputBufs->AppendElement();
-    return mControl->GetBuf(aOutputBufs->LastElement());
+    return mControl->GetBufs(aOutputBufs);
   }
   return NS_OK;
 }
 
 nsresult
 ISOMediaWriter::SetMetadata(TrackMetadataBase* aMetadata)
 {
   if (aMetadata->GetKind() == TrackMetadataBase::METADATA_AAC ) {
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -4786,16 +4786,20 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, 
       nsCString manifestParam;
       SAFE_ESCAPE(manifestParam,
                   NS_ConvertUTF16toUTF8(manifestURL).get(),
                   url_Path);
       errorPageUrl.AppendLiteral("&m=");
       errorPageUrl.AppendASCII(manifestParam.get());
     }
 
+    nsAutoCString frameType(FrameTypeToString(mFrameType));
+    errorPageUrl.AppendLiteral("&f=");
+    errorPageUrl.AppendASCII(frameType.get());
+
     nsCOMPtr<nsIURI> errorPageURI;
     rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl);
     NS_ENSURE_SUCCESS(rv, rv);
 
     return InternalLoad(errorPageURI, nullptr, nullptr,
                         INTERNAL_LOAD_FLAGS_INHERIT_OWNER, nullptr, nullptr,
                         NullString(), nullptr, nullptr, LOAD_ERROR_PAGE,
                         nullptr, true, NullString(), this, nullptr, nullptr);
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -662,16 +662,31 @@ protected:
     bool JustStartedNetworkLoad();
 
     enum FrameType {
         eFrameTypeRegular,
         eFrameTypeBrowser,
         eFrameTypeApp
     };
 
+    static const nsCString FrameTypeToString(FrameType aFrameType)
+    {
+      switch (aFrameType) {
+      case FrameType::eFrameTypeApp:
+        return NS_LITERAL_CSTRING("app");
+      case FrameType::eFrameTypeBrowser:
+        return NS_LITERAL_CSTRING("browser");
+      case FrameType::eFrameTypeRegular:
+        return NS_LITERAL_CSTRING("regular");
+      default:
+        NS_ERROR("Unknown frame type");
+        return EmptyCString();
+      }
+    }
+
     FrameType GetInheritedFrameType();
 
     bool HasUnloadedParent();
 
     // Dimensions of the docshell
     nsIntRect                  mBounds;
     nsString                   mName;
     nsString                   mTitle;
--- a/dom/activities/src/ActivityProxy.js
+++ b/dom/activities/src/ActivityProxy.js
@@ -5,17 +5,16 @@
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsISyncMessageSender");
 
 function debug(aMsg) {
   //dump("-- ActivityProxy " + Date.now() + " : " + aMsg + "\n");
 }
@@ -71,17 +70,17 @@ ActivityProxy.prototype = {
     if (msg.id != this.id)
       return;
     debug("msg=" + JSON.stringify(msg));
 
     switch(aMessage.name) {
       case "Activity:FireSuccess":
         debug("FireSuccess");
         Services.DOMRequest.fireSuccess(this.activity,
-                                        ObjectWrapper.wrap(msg.result, this.window));
+                                        Cu.cloneInto(msg.result, this.window));
         Services.obs.notifyObservers(null, "Activity:Success", null);
         break;
       case "Activity:FireError":
         debug("FireError");
         Services.DOMRequest.fireError(this.activity, msg.error);
         Services.obs.notifyObservers(null, "Activity:Error", null);
         break;
     }
--- a/dom/activities/src/ActivityWrapper.js
+++ b/dom/activities/src/ActivityWrapper.js
@@ -4,17 +4,16 @@
 
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsISyncMessageSender");
 
 function debug(aMsg) {
   //dump("-- ActivityWrapper.js " + Date.now() + " : " + aMsg + "\n");
@@ -33,17 +32,17 @@ ActivityWrapper.prototype = {
     debug("Wrapping " + JSON.stringify(aMessage));
     let handler = Cc["@mozilla.org/dom/activities/request-handler;1"]
                     .createInstance(Ci.nsIDOMMozActivityRequestHandler);
     handler.wrappedJSObject._id = aMessage.id;
 
     // options is an nsIDOMActivityOptions object.
     var options = handler.wrappedJSObject._options;
     options.wrappedJSObject._name = aMessage.payload.name;
-    options.wrappedJSObject._data = ObjectWrapper.wrap(aMessage.payload.data, aWindow);
+    options.wrappedJSObject._data = Cu.cloneInto(aMessage.payload.data, aWindow);
 
     // When the activity window is closed, fire an error to notify the activity
     // caller of the situation.
     // We don't need to check whether the activity itself already sent
     // back something since ActivitiesService.jsm takes care of that.
     let util = aWindow.QueryInterface(Ci.nsIInterfaceRequestor)
                       .getInterface(Ci.nsIDOMWindowUtils);
     let innerWindowID = util.currentInnerWindowID;
--- a/dom/alarm/AlarmsManager.js
+++ b/dom/alarm/AlarmsManager.js
@@ -12,17 +12,16 @@ function debug(aStr) {
     dump("AlarmsManager: " + aStr + "\n");
 }
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 
 const ALARMSMANAGER_CONTRACTID = "@mozilla.org/alarmsManager;1";
 const ALARMSMANAGER_CID        = Components.ID("{fea1e884-9b05-11e1-9b64-87a7016c3860}");
 const nsIDOMMozAlarmsManager   = Ci.nsIDOMMozAlarmsManager;
 const nsIClassInfo             = Ci.nsIClassInfo;
 
 function AlarmsManager()
 {
@@ -129,17 +128,17 @@ AlarmsManager.prototype = {
           let alarm = { "id":              aAlarm.id,
                         "date":            aAlarm.date,
                         "respectTimezone": aAlarm.ignoreTimezone ?
                                              "ignoreTimezone" : "honorTimezone",
                         "data":            aAlarm.data };
           alarms.push(alarm);
         });
         Services.DOMRequest.fireSuccess(request,
-                                        ObjectWrapper.wrap(alarms, this._window));
+                                        Cu.cloneInto(alarms, this._window));
         break;
 
       case "AlarmsManager:Add:Return:KO":
         Services.DOMRequest.fireError(request, json.errorMsg);
         break;
 
       case "AlarmsManager:GetAll:Return:KO":
         Services.DOMRequest.fireError(request, json.errorMsg);
--- a/dom/apps/src/InterAppMessagePort.js
+++ b/dom/apps/src/InterAppMessagePort.js
@@ -11,17 +11,16 @@
 
 "use strict";
 
 const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
 
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 
 const DEBUG = false;
 function debug(aMsg) {
   dump("-- InterAppMessagePort: " + Date.now() + ": " + aMsg + "\n");
 }
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
@@ -170,17 +169,17 @@ InterAppMessagePort.prototype = {
       if (DEBUG) debug("start() has been called. Don't need to start again.");
       return;
     }
 
     this.start();
   },
 
   _dispatchMessage: function _dispatchMessage(aMessage) {
-    let wrappedMessage = ObjectWrapper.wrap(aMessage, this._window);
+    let wrappedMessage = Cu.cloneInto(aMessage, this._window);
     if (DEBUG) {
       debug("_dispatchMessage: wrappedMessage: " +
             JSON.stringify(wrappedMessage));
     }
 
     let event = new this._window
                     .MozInterAppMessageEvent("message",
                                              { data: wrappedMessage });
--- a/dom/apps/src/Webapps.js
+++ b/dom/apps/src/Webapps.js
@@ -5,17 +5,16 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 Cu.import("resource://gre/modules/AppsUtils.jsm");
 Cu.import("resource://gre/modules/BrowserElementPromptService.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsIMessageSender");
 
 function convertAppsArray(aApps, aWindow) {
@@ -272,17 +271,17 @@ let manifestCache = {
   // Gets an entry from the cache, and populates the cache if needed.
   get: function mcache_get(aManifestURL, aManifest, aWindow, aInnerWindowID) {
     if (!(aManifestURL in this._cache)) {
       this._cache[aManifestURL] = { };
     }
 
     let winObjs = this._cache[aManifestURL];
     if (!(aInnerWindowID in winObjs)) {
-      winObjs[aInnerWindowID] = ObjectWrapper.wrap(aManifest, aWindow);
+      winObjs[aInnerWindowID] = Cu.cloneInto(aManifest, aWindow);
     }
 
     return winObjs[aInnerWindowID];
   },
 
   // Invalidates an entry in the cache.
   evict: function mcache_evict(aManifestURL, aInnerWindowID) {
     if (aManifestURL in this._cache) {
@@ -376,18 +375,17 @@ WebappsApplication.prototype = {
     return manifestCache.get(this.manifestURL,
                              this._manifest,
                              this._window,
                              this.innerWindowID);
   },
 
   get updateManifest() {
     return this.updateManifest =
-      this._updateManifest ? ObjectWrapper.wrap(this._updateManifest,
-                                                this._window)
+      this._updateManifest ? Cu.cloneInto(this._updateManifest, this._window)
                            : null;
   },
 
   set onprogress(aCallback) {
     this._onprogress = aCallback;
   },
 
   get onprogress() {
--- a/dom/inputmethod/MozKeyboard.js
+++ b/dom/inputmethod/MozKeyboard.js
@@ -5,17 +5,16 @@
 "use strict";
 
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
   "@mozilla.org/childprocessmessagemanager;1", "nsIMessageSender");
 
 XPCOMUtils.defineLazyServiceGetter(this, "tm",
   "@mozilla.org/thread-manager;1", "nsIThreadManager");
 
@@ -170,30 +169,30 @@ MozKeyboard.prototype = {
       if (!handler || !(handler instanceof Ci.nsIDOMEventListener))
         return;
 
       let detail = {
         "detail": msgJson
       };
 
       let evt = new this._window.CustomEvent("focuschanged",
-          ObjectWrapper.wrap(detail, this._window));
+          Cu.cloneInto(detail, this._window));
       handler.handleEvent(evt);
     } else if (msg.name == "Keyboard:SelectionChange") {
       let msgJson = msg.json;
 
       this._selectionStart = msgJson.selectionStart;
       this._selectionEnd = msgJson.selectionEnd;
 
       let handler = this._selectionHandler;
       if (!handler || !(handler instanceof Ci.nsIDOMEventListener))
         return;
 
       let evt = new this._window.CustomEvent("selectionchange",
-          ObjectWrapper.wrap({}, this._window));
+          Cu.cloneInto({}, this._window));
       handler.handleEvent(evt);
     }
   },
 
   observe: function mozKeyboardObserve(subject, topic, data) {
     let wId = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
     if (wId == this.innerWindowID)
       this.uninit();
@@ -408,17 +407,17 @@ MozInputMethod.prototype = {
         this._layouts[data.type] > 1 :
         false;
 
       this._inputcontext = new MozInputContext(data);
       this._inputcontext.init(this._window);
     }
 
     let event = new this._window.Event("inputcontextchange",
-                                       ObjectWrapper.wrap({}, this._window));
+                                       Cu.cloneInto({}, this._window));
     this.__DOM_IMPL__.dispatchEvent(event);
   },
 
   setActive: function mozInputMethodSetActive(isActive) {
     if (WindowMap.isActive(this._window) === isActive) {
       return;
     }
 
@@ -547,17 +546,17 @@ MozInputContext.prototype = {
         resolver.resolve(json.text);
         break;
       case "Keyboard:GetText:Result:Error":
         resolver.reject(json.error);
         break;
       case "Keyboard:SetSelectionRange:Result:OK":
       case "Keyboard:ReplaceSurroundingText:Result:OK":
         resolver.resolve(
-          ObjectWrapper.wrap(json.selectioninfo, this._window));
+          Cu.cloneInto(json.selectioninfo, this._window));
         break;
       case "Keyboard:SequenceError":
         // Occurs when a new element got focus, but the inputContext was
         // not invalidated yet...
         resolver.reject("InputContext has expired");
         break;
       case "Keyboard:SetComposition:Result:OK": // Fall through.
       case "Keyboard:EndComposition:Result:OK":
@@ -601,17 +600,17 @@ MozInputContext.prototype = {
   },
 
   _fireEvent: function ic_fireEvent(eventName, aDetail) {
     let detail = {
       detail: aDetail
     };
 
     let event = new this._window.Event(eventName,
-                                       ObjectWrapper.wrap(aDetail, this._window));
+                                       Cu.cloneInto(aDetail, this._window));
     this.__DOM_IMPL__.dispatchEvent(event);
   },
 
   // tag name of the input field
   get type() {
     return this._context.type;
   },
 
--- a/dom/ipc/PreallocatedProcessManager.cpp
+++ b/dom/ipc/PreallocatedProcessManager.cpp
@@ -304,17 +304,17 @@ PreallocatedProcessManagerImpl::PublishS
   MOZ_ASSERT(NS_IsMainThread());
 
   if (Preferences::GetBool("dom.ipc.processPriorityManager.testMode")) {
     AutoJSContext cx;
     nsCOMPtr<nsIMessageBroadcaster> ppmm =
       do_GetService("@mozilla.org/parentprocessmessagemanager;1");
     nsresult rv = ppmm->BroadcastAsyncMessage(
       NS_LITERAL_STRING("TEST-ONLY:nuwa-add-new-process"),
-      JS::NullHandleValue, JS::NullHandleValue, cx, 1);
+      JSVAL_NULL, JSVAL_NULL, cx, 1);
   }
 
   if (!mNuwaForkWaitTasks.IsEmpty()) {
     mNuwaForkWaitTasks.ElementAt(0)->Cancel();
     mNuwaForkWaitTasks.RemoveElementAt(0);
   }
 
   mSpareProcesses.AppendElement(aContent);
@@ -357,17 +357,17 @@ PreallocatedProcessManagerImpl::OnNuwaRe
                                              hal::PROCESS_PRIORITY_MASTER);
   mIsNuwaReady = true;
   if (Preferences::GetBool("dom.ipc.processPriorityManager.testMode")) {
     AutoJSContext cx;
     nsCOMPtr<nsIMessageBroadcaster> ppmm =
       do_GetService("@mozilla.org/parentprocessmessagemanager;1");
     nsresult rv = ppmm->BroadcastAsyncMessage(
       NS_LITERAL_STRING("TEST-ONLY:nuwa-ready"),
-      JS::NullHandleValue, JS::NullHandleValue, cx, 1);
+      JSVAL_NULL, JSVAL_NULL, cx, 1);
   }
   NuwaFork();
 }
 
 bool
 PreallocatedProcessManagerImpl::PreallocatedProcessReady()
 {
   return !mSpareProcesses.IsEmpty();
--- a/dom/ipc/preload.js
+++ b/dom/ipc/preload.js
@@ -20,17 +20,16 @@ const BrowserElementIsPreloaded = true;
   Cu.import("resource://gre/modules/AppsUtils.jsm");
   Cu.import("resource://gre/modules/BrowserElementPromptService.jsm");
   Cu.import("resource://gre/modules/CSPUtils.jsm");
   Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
   Cu.import("resource://gre/modules/FileUtils.jsm");
   Cu.import("resource://gre/modules/Geometry.jsm");
   Cu.import("resource://gre/modules/IndexedDBHelper.jsm");
   Cu.import("resource://gre/modules/NetUtil.jsm");
-  Cu.import("resource://gre/modules/ObjectWrapper.jsm");
   Cu.import("resource://gre/modules/Services.jsm");
   Cu.import("resource://gre/modules/SettingsDB.jsm");
   Cu.import("resource://gre/modules/SettingsQueue.jsm");
   Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
   Cc["@mozilla.org/appshell/appShellService;1"].getService(Ci["nsIAppShellService"]);
   Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci["nsIWindowMediator"]);
   Cc["@mozilla.org/AppsService;1"].getService(Ci["nsIAppsService"]);
--- a/dom/ipc/tests/mochitest.ini
+++ b/dom/ipc/tests/mochitest.ini
@@ -1,2 +1,2 @@
 [test_NuwaProcessCreation.html]
-run-if = toolkit == 'gonk'
+skip-if = true # re-enable when nuwa is enabled.
--- a/dom/messages/SystemMessageManager.js
+++ b/dom/messages/SystemMessageManager.js
@@ -7,17 +7,16 @@
 const Cc = Components.classes;
 const Ci = Components.interfaces;
 const Cu = Components.utils;
 const Cr = Components.results;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 
 const kSystemMessageInternalReady = "system-message-internal-ready";
 
 XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
                                    "@mozilla.org/childprocessmessagemanager;1",
                                    "nsISyncMessageSender");
 
 function debug(aMsg) {
@@ -89,17 +88,17 @@ SystemMessageManager.prototype = {
         aMessage = wrapper.wrapMessage(aMessage, this._window);
         wrapped = true;
         debug("wrapped = " + aMessage);
       }
     }
 
     aDispatcher.handler
       .handleMessage(wrapped ? aMessage
-                             : ObjectWrapper.wrap(aMessage, this._window));
+                             : Cu.cloneInto(aMessage, this._window));
 
     // We need to notify the parent one of the system messages has been handled,
     // so the parent can release the CPU wake lock it took on our behalf.
     cpmm.sendAsyncMessage("SystemMessageManager:HandleMessagesDone",
                           { type: aType,
                             manifest: this._manifest,
                             uri: this._uri,
                             handledCount: 1 });
--- a/dom/network/src/NetworkStatsManager.js
+++ b/dom/network/src/NetworkStatsManager.js
@@ -7,17 +7,16 @@
 const DEBUG = false;
 function debug(s) { dump("-*- NetworkStatsManager: " + s + "\n"); }
 
 const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 Cu.import("resource://gre/modules/Services.jsm");
 Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
-Cu.import("resource://gre/modules/ObjectWrapper.jsm");
 
 // Ensure NetworkStatsService and NetworkStatsDB are loaded in the parent process
 // to receive messages from the child processes.
 let appInfo = Cc["@mozilla.org/xre/app-info;1"];
 let isParentProcess = !appInfo || appInfo.getService(Ci.nsIXULRuntime)
                         .processType == Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT;
 if (isParentProcess) {
   Cu.import("resource://gre/modules/NetworkStatsService.jsm");
--- a/dom/nfc/nsNfc.js
+++ b/dom/nfc/nsNfc.js
@@ -127,17 +127,17 @@ MozNFCPeer.prototype = {
     return this._nfcContentHelper.writeNDEF(this._window, records, this.session);
   },
 
   sendFile: function sendFile(blob) {
     let data = {
       "blob": blob.slice()
     };
     return this._nfcContentHelper.sendFile(this._window,
-                                           ObjectWrapper.wrap(data, this._window),
+                                           Cu.cloneInto(data, this._window),
                                            this.session);
   },
 
   classID: Components.ID("{c1b2bcf0-35eb-11e3-aa6e-0800200c9a66}"),
   contractID: "@mozilla.org/nfc/NFCPeer;1",
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
                                          Ci.nsIDOMGlobalPropertyInitializer]),
 };
@@ -153,17 +153,17 @@ function mozNfc() {
   } catch(e) {
     debug("No NFC support.")
   }
 }
 mozNfc.prototype = {
   _nfcContentHelper: null,
   _window: null,
   _wrap: function _wrap(obj) {
-    return ObjectWrapper.wrap(obj, this._window);
+    return Cu.cloneInto(obj, this._window);
   },
 
   init: function init(aWindow) {
     debug("mozNfc init called");
     this._window = aWindow;
   },
 
   // Only System Process can call the following interfaces
@@ -272,18 +272,17 @@ mozNfc.prototype = {
     return eventType;
   },
 
   firePeerEvent: function firePeerEvent(evt, sessionToken) {
     let peerEvent = (NFC_PEER_EVENT_READY === evt) ? "peerready" : "peerlost";
     let detail = {
       "detail":sessionToken
     };
-    let event = new this._window.CustomEvent(peerEvent,
-      ObjectWrapper.wrap(detail, this._window));
+    let event = new this._window.CustomEvent(peerEvent, this._wrap(detail);
     this.__DOM_IMPL__.dispatchEvent(event);
   },
 
   classID: Components.ID("{6ff2b290-2573-11e3-8224-0800200c9a66}"),
   contractID: "@mozilla.org/navigatorNfc;1",
   QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports,
                                          Ci.nsIDOMGlobalPropertyInitializer]),
 };
--- a/dom/settings/SettingsManager.js
+++ b/dom/settings/SettingsManager.js
@@ -32,17 +32,17 @@ function SettingsLock(aSettingsManager) 
 }
 
 SettingsLock.prototype = {
   get closed() {
     return !this._open;
   },
 
   _wrap: function _wrap(obj) {
-    return ObjectWrapper.wrap(obj, this._settingsManager._window);
+    return Cu.cloneInto(obj, this._settingsManager._window);
   },
 
   process: function process() {
     let lock = this;
     let store = lock._transaction.objectStore(SETTINGSSTORE_NAME);
 
     while (!lock._requests.isEmpty()) {
       let info = lock._requests.dequeue();
@@ -252,17 +252,17 @@ function SettingsManager() {
   this._settingsDB = new SettingsDB();
   this._settingsDB.init();
 }
 
 SettingsManager.prototype = {
   _callbacks: null,
 
   _wrap: function _wrap(obj) {
-    return ObjectWrapper.wrap(obj, this._window);
+    return Cu.cloneInto(obj, this._window);
   },
 
   nextTick: function nextTick(aCallback, thisObj) {
     if (thisObj)
       aCallback = aCallback.bind(thisObj);
 
     Services.tm.currentThread.dispatch(aCallback, Ci.nsIThread.DISPATCH_NORMAL);
   },
--- a/dom/system/gonk/NetworkUtils.cpp
+++ b/dom/system/gonk/NetworkUtils.cpp
@@ -12,16 +12,17 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #include "NetworkUtils.h"
 
 #include <android/log.h>
 #include <cutils/properties.h>
+#include <limits>
 #include "mozilla/dom/network/NetUtils.h"
 
 #define _DEBUG 0
 
 #define WARN(args...)   __android_log_print(ANDROID_LOG_WARN,  "NetworlUtils", ## args)
 #define ERROR(args...)  __android_log_print(ANDROID_LOG_ERROR,  "NetworkUtils", ## args)
 
 #if _DEBUG
@@ -527,17 +528,17 @@ void NetworkUtils::disableAlarm(CommandC
   doCommand(command, aChain, aCallback);
 }
 
 void NetworkUtils::setQuota(CommandChain* aChain,
                             CommandCallback aCallback,
                             NetworkResultOptions& aResult)
 {
   char command[MAX_COMMAND_SIZE];
-  snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %lld", GET_CHAR(mIfname), atoll("0xffffffffffffffff"));
+  snprintf(command, MAX_COMMAND_SIZE - 1, "bandwidth setiquota %s %lld", GET_CHAR(mIfname), LLONG_MAX);
 
   doCommand(command, aChain, aCallback);
 }
 
 void NetworkUtils::removeQuota(CommandChain* aChain,
                                CommandCallback aCallback,
                                NetworkResultOptions& aResult)
 {
--- a/testing/marionette/client/marionette/atoms/b2g_update_test.js
+++ b/testing/marionette/client/marionette/atoms/b2g_update_test.js
@@ -48,17 +48,17 @@ function getContentWindow() {
 }
 
 function sendContentEvent(type, detail) {
   detail = detail || {};
   detail.type = type;
 
   let content = getContentWindow();
   shell.sendEvent(content, "mozContentEvent",
-                   ObjectWrapper.wrap(detail, content));
+                   Cu.cloneInto(detail, content));
   return true;
 }
 
 function addChromeEventListener(type, listener) {
   let content = getContentWindow();
   content.addEventListener("mozChromeEvent", function chromeListener(evt) {
     if (!evt.detail || evt.detail.type !== type) {
       return;
--- a/testing/mochitest/b2g.json
+++ b/testing/mochitest/b2g.json
@@ -170,17 +170,16 @@
     "content/html/content/test/test_iframe_sandbox_popups_inheritance.html":"multiple concurrent window.open()s fail on B2G",
     "content/html/content/test/test_iframe_sandbox_modal.html":"modal tests fail on B2G",
 
     "content/html/content/test/test_iframe_sandbox_plugins.html":"plugins not supported",
     "content/html/content/test/test_object_plugin_nav.html":"plugins not supported",
     "content/html/document/test/test_bug741266.html":"needs control of popup window size",
     "docshell/test/navigation/test_popup-navigates-children.html":"Needs multiple window.open support, also uses docshelltreenode",
     "docshell/test/test_bug590573.html":"queryinterfaces into webnavigation, might suffer from something similar as bug 823022",
-    "docshell/test/navigation/test_bug430723.html":"apz race condition, see bug 965351",
     "dom/devicestorage/ipc/test_ipc.html":"nested ipc not working",
 
     "dom/indexedDB/ipc/test_ipc.html":"nested ipc not working",
     "dom/indexedDB/test/test_lowDiskSpace.html":"this needs probably modification for notifyObserversInParentProcess to be similar as pushPermissions",
 
     "content/base/test/test_object.html":"needs plugin support",
     "content/base/test/test_bug827160.html": "needs plugin support",
 
@@ -263,17 +262,16 @@
     "dom/browser-element/mochitest/test_browserElement_oop_TargetBlank.html":"",
     "dom/events/test/test_bug226361.xhtml":"",
     "dom/events/test/test_bug238987.html":"",
     "dom/events/test/test_bug409604.html":"",
     "dom/events/test/test_bug457672.html":"",
     "dom/events/test/test_bug574663.html":"",
     "dom/events/test/test_bug607464.html":"",
     "dom/events/test/test_wheel_default_action.html":"",
-    "dom/events/test/test_bug946632.html":"apz race condition, see bug 965351",
 
     "dom/file/test/test_progress_events.html":"All of these fail fairly regularly with: UnknownError: The operation failed for reasons unrelated to the database itself and not covered by any other error code. at http://mochi.test:8888/tests/dom/file/test/helpers.js:126",
     "dom/file/test/test_request_readyState.html":"",
     "dom/file/test/test_stream_tracking.html":"",
     "dom/file/test/test_append_read_data.html":"",
     "dom/file/test/test_archivereader.html":"",
     "dom/file/test/test_archivereader_nonUnicode.html":"",
     "dom/file/test/test_archivereader_zip_in_zip.html":"",
@@ -367,17 +365,16 @@
     "layout/base/tests/test_bug603550.html":"Components.classes[@mozilla.org/widget/dragservice;1] is undefined",
     "layout/base/tests/test_bug629838.html":"depends on plugins support",
     "layout/base/tests/test_mozPaintCount.html":"depends on plugins support",
     "layout/forms/test/test_bug348236.html":"select form control popup",
     "layout/forms/test/test_bug446663.html":"needs copy support",
     "layout/forms/test/test_bug571352.html":"shift-click multi-select not working?",
     "layout/forms/test/test_textarea_resize.html":"resizing textarea not available in b2g",
     "layout/forms/test/test_bug903715.html":"select elements don't use an in-page popup in B2G",
-    "layout/forms/test/test_bug564115.html":"apz race condition, see bug 965351",
     "layout/generic/test/test_bug392746.html":"ctrl mouse select not working in b2g",
     "layout/generic/test/test_bug791616.html":"Target should not have scrolled - got 114.10000610351562, expected 115.39999389648438",
     "layout/generic/test/test_invalidate_during_plugin_paint.html":"plugins not supported",
     "layout/generic/test/test_plugin_focus.html":"plugins not supported",
     "layout/generic/test/test_plugin_mouse_coords.html":"plugins not supported",
     "layout/generic/test/test_selection_expanding.html":"mouse selection not working",
 
     "layout/style/test/test_transitions_per_property.html":"times out, needs more time + various failures",
--- a/toolkit/devtools/apps/tests/test_webapps_actor.html
+++ b/toolkit/devtools/apps/tests/test_webapps_actor.html
@@ -86,16 +86,17 @@ var steps = [
     // Because of wrapping issues, we can't use SpecialPowers.Cu.import to load
     // devtools jsm into mochitest scope. We end up not receiving
     // DebuggerClient.addListener callback arguments...
     let scriptUrl = SimpleTest.getTestFileURL("debugger-protocol-helper.js");
     mm = SpecialPowers.loadChromeScript(scriptUrl);
     installTestApp = function (url, appId, callback) {
       let installResponse, appObject;
       let installedEvent = false;
+      mm.sendAsyncMessage("install", {url: url, appId: appId});
       mm.addMessageListener("installed", function onInstalled(aResponse) {
         mm.removeMessageListener("installed", onInstalled);
         ok(true, "install request replied");
         installResponse = aResponse;
         checkEnd();
       });
       mm.addMessageListener("installed-event", function onInstalledEvent(aResponse) {
         mm.removeMessageListener("installed-event", onInstalledEvent);
@@ -107,17 +108,16 @@ var steps = [
         appObject = evt.application;
         ok(true, "mozApps.mgmt install event fired");
         checkEnd();
       };
       function checkEnd() {
         if (appObject && installResponse && installedEvent)
           callback(installResponse, appObject);
       }
-      mm.sendAsyncMessage("install", {url: url, appId: appId});
     };
     SpecialPowers.autoConfirmAppInstall(next);
   },
   function() {
     ok(true, "== TEST == Install packaged app");
     let appId = "test-app-id";
     let url = SimpleTest.getTestFileURL("data/app.zip");
     installTestApp(url, appId,