Merge inbound to central, a=merge
authorWes Kocher <wkocher@mozilla.com>
Mon, 20 Jul 2015 16:32:38 -0700
changeset 253765 3a4bfa5d2d026f7d3fbfd0f87663b87b5caa9344
parent 253747 94bdba42b8463b49ededd790d119a8b91c0d2c5c (current diff)
parent 253764 4ed97e4fa7f56aa4c99621b4bcc5198203485e45 (diff)
child 253766 9704aba173fde5901c85d8bb9febb2b7c1e6a05d
child 253775 75c1398494d586c33f21f0e74131f32ea977259e
child 253797 cbd13a2d5abfaa207a1408b150ca613ed85a276c
child 253835 a0601b2eb84a924f2375fe3838d3cec11fcbc5c4
push id29077
push userkwierso@gmail.com
push dateMon, 20 Jul 2015 23:32:42 +0000
treeherdermozilla-central@3a4bfa5d2d02 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmerge
milestone42.0a1
first release with
nightly linux32
3a4bfa5d2d02 / 42.0a1 / 20150721030212 / files
nightly linux64
3a4bfa5d2d02 / 42.0a1 / 20150721030212 / files
nightly mac
3a4bfa5d2d02 / 42.0a1 / 20150721030212 / files
nightly win32
3a4bfa5d2d02 / 42.0a1 / 20150721030212 / files
nightly win64
3a4bfa5d2d02 / 42.0a1 / 20150721030212 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge inbound to central, a=merge
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -173,30 +173,41 @@ DocAccessibleParent::RecvTextChangeEvent
   ProxyTextChangeEvent(target, aStr, aStart, aLen, aIsInsert, aFromUser);
 
   return true;
 }
 
 bool
 DocAccessibleParent::RecvBindChildDoc(PDocAccessibleParent* aChildDoc, const uint64_t& aID)
 {
+  // One document should never directly be the child of another.
+  // We should always have at least an outer doc accessible in between.
+  MOZ_ASSERT(aID);
+  if (!aID)
+    return false;
+
   auto childDoc = static_cast<DocAccessibleParent*>(aChildDoc);
-  DebugOnly<bool> result = AddChildDoc(childDoc, aID, false);
+  bool result = AddChildDoc(childDoc, aID, false);
   MOZ_ASSERT(result);
-  return true;
+  return result;
 }
 
 bool
 DocAccessibleParent::AddChildDoc(DocAccessibleParent* aChildDoc,
                                  uint64_t aParentID, bool aCreating)
 {
-  ProxyAccessible* outerDoc = mAccessibles.GetEntry(aParentID)->mProxy;
-  if (!outerDoc)
+  // We do not use GetAccessible here because we want to be sure to not get the
+  // document it self.
+  ProxyEntry* e = mAccessibles.GetEntry(aParentID);
+  if (!e)
     return false;
 
+  ProxyAccessible* outerDoc = e->mProxy;
+  MOZ_ASSERT(outerDoc);
+
   aChildDoc->mParent = outerDoc;
   outerDoc->SetChildDoc(aChildDoc);
   mChildDocs.AppendElement(aChildDoc);
   aChildDoc->mParentDoc = this;
 
   if (aCreating) {
     ProxyCreated(aChildDoc, 0);
   }
--- a/b2g/app/b2g.js
+++ b/b2g/app/b2g.js
@@ -329,17 +329,16 @@ pref("media.eme.apiVisible", true);
 
 // The default number of decoded video frames that are enqueued in
 // MediaDecoderReader's mVideoQueue.
 pref("media.video-queue.default-size", 3);
 
 // optimize images' memory usage
 pref("image.downscale-during-decode.enabled", true);
 pref("image.mem.allow_locking_in_content_processes", true);
-pref("image.decode.retry-on-alloc-failure", true);
 // Limit the surface cache to 1/8 of main memory or 128MB, whichever is smaller.
 // Almost everything that was factored into 'max_decoded_image_kb' is now stored
 // in the surface cache.  1/8 of main memory is 32MB on a 256MB device, which is
 // about the same as the old 'max_decoded_image_kb'.
 pref("image.mem.surfacecache.max_size_kb", 131072);  // 128MB
 pref("image.mem.surfacecache.size_factor", 8);  // 1/8 of main memory
 pref("image.mem.surfacecache.discard_factor", 2);  // Discard 1/2 of the surface cache at a time.
 pref("image.mem.surfacecache.min_expiration_ms", 86400000); // 24h, we rely on the out of memory hook
--- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js
+++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_DownloadLastDirWithCPS.js
@@ -2,16 +2,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 let gTests;
 function test() {
   waitForExplicitFinish();
   requestLongerTimeout(2);
+  requestCompleteLog();
   gTests = runTest();
   gTests.next();
 }
 
 /*
  * ================
  * Helper functions
  * ================
--- a/browser/config/mozconfigs/linux32/beta
+++ b/browser/config/mozconfigs/linux32/beta
@@ -1,7 +1,8 @@
 . "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 mk_add_options MOZ_PGO=1
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux32/debug
+++ b/browser/config/mozconfigs/linux32/debug
@@ -1,11 +1,11 @@
 ac_add_options --enable-debug
 ac_add_options --enable-dmd
-ac_add_options --enable-signmar
+ac_add_options --enable-verify-mar
 ac_add_options --with-google-oauth-api-keyfile=/builds/google-oauth-api.key
 
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/unix/mozconfig.linux32
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
--- a/browser/config/mozconfigs/linux32/nightly
+++ b/browser/config/mozconfigs/linux32/nightly
@@ -1,12 +1,12 @@
 . "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
 
-ac_add_options --enable-signmar
 ac_add_options --enable-profiling
+ac_add_options --enable-verify-mar
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 ac_add_options --with-branding=browser/branding/nightly
 
--- a/browser/config/mozconfigs/linux32/release
+++ b/browser/config/mozconfigs/linux32/release
@@ -1,13 +1,14 @@
 # This make file should be identical to the beta mozconfig, apart from the
 # safeguard below
 . "$topsrcdir/browser/config/mozconfigs/linux32/common-opt"
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 mk_add_options MOZ_PGO=1
 
 # safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
 # defines.sh during the beta cycle
 export BUILDING_RELEASE=1
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/beta
+++ b/browser/config/mozconfigs/linux64/beta
@@ -1,7 +1,8 @@
 . "$topsrcdir/browser/config/mozconfigs/linux64/common-opt"
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 mk_add_options MOZ_PGO=1
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/linux64/debug
+++ b/browser/config/mozconfigs/linux64/debug
@@ -1,11 +1,11 @@
 ac_add_options --enable-debug
 ac_add_options --enable-dmd
-ac_add_options --enable-signmar
+ac_add_options --enable-verify-mar
 ac_add_options --with-google-oauth-api-keyfile=/builds/google-oauth-api.key
 
 MOZ_AUTOMATION_L10N_CHECK=0
 
 . $topsrcdir/build/unix/mozconfig.linux
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
--- a/browser/config/mozconfigs/linux64/nightly
+++ b/browser/config/mozconfigs/linux64/nightly
@@ -1,12 +1,12 @@
 . "$topsrcdir/browser/config/mozconfigs/linux64/common-opt"
 
-ac_add_options --enable-signmar
 ac_add_options --enable-profiling
+ac_add_options --enable-verify-mar
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling and debugging and only increases the package size
 # by 2 MBs.
 STRIP_FLAGS="--strip-debug"
 
 ac_add_options --with-branding=browser/branding/nightly
 
--- a/browser/config/mozconfigs/linux64/release
+++ b/browser/config/mozconfigs/linux64/release
@@ -1,13 +1,14 @@
 # This make file should be identical to the beta mozconfig, apart from the
 # safeguard below
 . "$topsrcdir/browser/config/mozconfigs/linux64/common-opt"
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 mk_add_options MOZ_PGO=1
 
 # safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
 # defines.sh during the beta cycle
 export BUILDING_RELEASE=1
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/macosx-universal/beta
+++ b/browser/config/mozconfigs/macosx-universal/beta
@@ -1,6 +1,7 @@
 . "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.cache"
--- a/browser/config/mozconfigs/macosx-universal/nightly
+++ b/browser/config/mozconfigs/macosx-universal/nightly
@@ -1,12 +1,12 @@
 . "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
 
 ac_add_options --disable-install-strip
-ac_add_options --enable-signmar
+ac_add_options --enable-verify-mar
 ac_add_options --enable-profiling
 ac_add_options --enable-instruments
 ac_add_options --enable-dtrace
 
 if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
 ac_add_options --with-macbundlename-prefix=Firefox
 fi
 
--- a/browser/config/mozconfigs/macosx-universal/release
+++ b/browser/config/mozconfigs/macosx-universal/release
@@ -1,12 +1,13 @@
 # This make file should be identical to the beta mozconfig, apart from the
 # safeguard below
 . "$topsrcdir/browser/config/mozconfigs/macosx-universal/common-opt"
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 # safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
 # defines.sh during the beta cycle
 export BUILDING_RELEASE=1
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.cache"
--- a/browser/config/mozconfigs/macosx64/debug
+++ b/browser/config/mozconfigs/macosx64/debug
@@ -1,13 +1,13 @@
 . $topsrcdir/build/macosx/mozconfig.common
 
 ac_add_options --enable-debug
 ac_add_options --enable-dmd
-ac_add_options --enable-signmar
+ac_add_options --enable-verify-mar
 ac_add_options --with-google-oauth-api-keyfile=/builds/google-oauth-api.key
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
 ac_add_options --with-macbundlename-prefix=Firefox
 fi
@@ -15,10 +15,11 @@ fi
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
 
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 ac_add_options --with-branding=browser/branding/nightly
 
+. "$topsrcdir/build/macosx/mozconfig.rust"
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.cache"
--- a/browser/config/mozconfigs/macosx64/nightly
+++ b/browser/config/mozconfigs/macosx64/nightly
@@ -1,11 +1,11 @@
 . $topsrcdir/build/macosx/mozconfig.common
 
-ac_add_options --enable-signmar
+ac_add_options --enable-verify-mar
 ac_add_options --with-google-oauth-api-keyfile=/builds/google-oauth-api.key
 
 # Needed to enable breakpad in application.ini
 export MOZILLA_OFFICIAL=1
 
 if test "${MOZ_UPDATE_CHANNEL}" = "nightly"; then
 ac_add_options --with-macbundlename-prefix=Firefox
 fi
@@ -13,10 +13,11 @@ fi
 # Treat warnings as errors in directories with FAIL_ON_WARNINGS.
 ac_add_options --enable-warnings-as-errors
 
 # Package js shell.
 export MOZ_PACKAGE_JSSHELL=1
 
 ac_add_options --with-branding=browser/branding/nightly
 
+. "$topsrcdir/build/macosx/mozconfig.rust"
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.cache"
--- a/browser/config/mozconfigs/whitelist
+++ b/browser/config/mozconfigs/whitelist
@@ -15,19 +15,16 @@ for platform in all_platforms:
         'mk_add_options CLIENT_PY_ARGS="--hg-options=\'--verbose --time\' --hgtool=../tools/buildfarm/utils/hgtool.py --skip-chatzilla --skip-comm --skip-inspector --tinderbox-print"'
     ]
 
 for platform in ['linux32', 'linux64', 'macosx-universal']:
     whitelist['nightly'][platform] += [
         'mk_add_options MOZ_MAKE_FLAGS="-j4"',
     ]
 
-for platform in ['linux32', 'linux64', 'macosx-universal', 'win32', 'win64']:
-    whitelist['nightly'][platform] += ['ac_add_options --enable-signmar']
-
 whitelist['nightly']['linux32'] += [
     'CXX=$REAL_CXX',
     'CXX="ccache $REAL_CXX"',
     'CC="ccache $REAL_CC"',
     'mk_add_options PROFILE_GEN_SCRIPT=@TOPSRCDIR@/build/profile_pageloader.pl',
     'ac_add_options --with-ccache=/usr/bin/ccache',
     '. "$topsrcdir/build/mozconfig.cache"',
     'export MOZILLA_OFFICIAL=1',
--- a/browser/config/mozconfigs/win32/beta
+++ b/browser/config/mozconfigs/win32/beta
@@ -1,8 +1,9 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win32/common-opt"
 
 mk_add_options MOZ_PGO=1
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/win32/debug
+++ b/browser/config/mozconfigs/win32/debug
@@ -1,16 +1,16 @@
 . "$topsrcdir/build/mozconfig.win-common"
 MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 ac_add_options --enable-debug
 ac_add_options --enable-dmd
 ac_add_options --enable-profiling  # needed for --enable-dmd to work on Windows
-ac_add_options --enable-signmar
+ac_add_options --enable-verify-mar
 ac_add_options --enable-require-all-d3dc-versions
 
 if [ -f /c/builds/google-oauth-api.key ]; then
   _google_oauth_api_keyfile=/c/builds/google-oauth-api.key
 else
   _google_oauth_api_keyfile=/e/builds/google-oauth-api.key
 fi
 ac_add_options --with-google-oauth-api-keyfile=${_google_oauth_api_keyfile}
--- a/browser/config/mozconfigs/win32/nightly
+++ b/browser/config/mozconfigs/win32/nightly
@@ -1,10 +1,10 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win32/common-opt"
 
-ac_add_options --enable-signmar
 ac_add_options --enable-profiling
+ac_add_options --enable-verify-mar
 
 ac_add_options --with-branding=browser/branding/nightly
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.cache"
--- a/browser/config/mozconfigs/win32/release
+++ b/browser/config/mozconfigs/win32/release
@@ -1,14 +1,15 @@
 # This make file should be identical to the beta mozconfig, apart from the
 # safeguard below
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win32/common-opt"
 
 mk_add_options MOZ_PGO=1
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 # safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
 # defines.sh during the beta cycle
 export BUILDING_RELEASE=1
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/win64/beta
+++ b/browser/config/mozconfigs/win64/beta
@@ -1,9 +1,10 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-win64"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-opt"
 
 mk_add_options MOZ_PGO=1
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/mozconfigs/win64/debug
+++ b/browser/config/mozconfigs/win64/debug
@@ -3,17 +3,17 @@ MOZ_AUTOMATION_L10N_CHECK=0
 . "$topsrcdir/browser/config/mozconfigs/common"
 
 ac_add_options --target=x86_64-pc-mingw32
 ac_add_options --host=x86_64-pc-mingw32
 
 ac_add_options --enable-debug
 ac_add_options --enable-dmd
 ac_add_options --enable-profiling  # needed for --enable-dmd to work on Windows
-ac_add_options --enable-signmar
+ac_add_options --enable-verify-mar
 
 if [ -f /c/builds/google-oauth-api.key ]; then
   _google_oauth_api_keyfile=/c/builds/google-oauth-api.key
 else
   _google_oauth_api_keyfile=/e/builds/google-oauth-api.key
 fi
 ac_add_options --with-google-oauth-api-keyfile=${_google_oauth_api_keyfile}
 
--- a/browser/config/mozconfigs/win64/nightly
+++ b/browser/config/mozconfigs/win64/nightly
@@ -1,11 +1,11 @@
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-win64"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-opt"
 
-ac_add_options --enable-signmar
 ac_add_options --enable-profiling
+ac_add_options --enable-verify-mar
 
 ac_add_options --with-branding=browser/branding/nightly
 
 . "$topsrcdir/build/mozconfig.common.override"
 . "$topsrcdir/build/mozconfig.cache"
--- a/browser/config/mozconfigs/win64/release
+++ b/browser/config/mozconfigs/win64/release
@@ -2,14 +2,15 @@
 # safeguard below
 . "$topsrcdir/build/mozconfig.win-common"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-win64"
 . "$topsrcdir/browser/config/mozconfigs/win64/common-opt"
 
 mk_add_options MOZ_PGO=1
 
 ac_add_options --enable-official-branding
+ac_add_options --enable-verify-mar
 
 # safeguard against someone forgetting to re-set EARLY_BETA_OR_EARLIER in
 # defines.sh during the beta cycle
 export BUILDING_RELEASE=1
 
 . "$topsrcdir/build/mozconfig.common.override"
--- a/browser/config/tooltool-manifests/macosx64/releng.manifest
+++ b/browser/config/tooltool-manifests/macosx64/releng.manifest
@@ -10,10 +10,17 @@
 "unpack": true
 },
 {
 "size": 167175,
 "digest": "0b71a936edf5bd70cf274aaa5d7abc8f77fe8e7b5593a208f805cc9436fac646b9c4f0b43c2b10de63ff3da671497d35536077ecbc72dba7f8159a38b580f831",
 "algorithm": "sha512",
 "filename": "sccache.tar.bz2",
 "unpack": true
+},
+{
+"size": 86474070,
+"digest": "85d528ba396d35e38280d01586d91c082a57846fb82c471579632995565caa54320b083581b04d96e526efa6cef53ea076a32c25f220f7f32f651a4dfdf30e31",
+"algorithm": "sha512",
+"filename": "rustc.tar.gz",
+"unpack": true
 }
 ]
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -5,29 +5,26 @@
 
 MOZ_APP_BASENAME=Firefox
 MOZ_APP_VENDOR=Mozilla
 MOZ_UPDATER=1
 MOZ_PHOENIX=1
 
 if test "$OS_ARCH" = "WINNT"; then
   MOZ_MAINTENANCE_SERVICE=1
-  MOZ_VERIFY_MAR_SIGNATURE=1
   if ! test "$HAVE_64BIT_BUILD"; then
     if test "$MOZ_UPDATE_CHANNEL" = "nightly" -o \
             "$MOZ_UPDATE_CHANNEL" = "aurora" -o \
             "$MOZ_UPDATE_CHANNEL" = "beta" -o \
             "$MOZ_UPDATE_CHANNEL" = "release"; then
       if ! test "$MOZ_DEBUG"; then
         MOZ_STUB_INSTALLER=1
       fi
     fi
   fi
-elif test "$OS_ARCH" = "Darwin"; then
-  MOZ_VERIFY_MAR_SIGNATURE=1
 fi
 
 # Enable building ./signmar and running libmar signature tests
 MOZ_ENABLE_SIGNMAR=1
 
 MOZ_CHROME_FILE_FORMAT=omni
 MOZ_DISABLE_EXPORT_JS=1
 MOZ_SAFE_BROWSING=1
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -240,17 +240,17 @@ def bootstrap(topsrcdir, mozilla_dir=Non
         if 'MOZ_AUTOMATION' in os.environ or 'TASK_ID' in os.environ:
             return
 
         # We are a curmudgeon who has found this undocumented variable.
         if 'I_PREFER_A_SUBOPTIMAL_MERCURIAL_EXPERIENCE' in os.environ:
             return
 
         # The environment is likely a machine invocation.
-        if not sys.stdin.isatty():
+        if sys.stdin.closed or not sys.stdin.isatty():
             return
 
         # Mercurial isn't managing this source checkout.
         if not os.path.exists(os.path.join(topsrcdir, '.hg')):
             return
 
         state_dir = get_state_dir()[0]
         last_check_path = os.path.join(state_dir, 'mercurial',
new file mode 100644
--- /dev/null
+++ b/build/macosx/mozconfig.rust
@@ -0,0 +1,5 @@
+# Options to enable rust in automation builds.
+
+RUSTC="$topsrcdir/rustc/bin/rustc"
+mk_add_options "export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$topsrcdir/rustc/lib"
+ac_add_options --enable-rust
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -1206,21 +1206,35 @@ TabParent::DeallocPDocAccessibleParent(P
 bool
 TabParent::RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc,
                                          PDocAccessibleParent* aParentDoc,
                                          const uint64_t& aParentID)
 {
 #ifdef ACCESSIBILITY
   auto doc = static_cast<a11y::DocAccessibleParent*>(aDoc);
   if (aParentDoc) {
+    // A document should never directly be the parent of another document.
+    // There should always be an outer doc accessible child of the outer
+    // document containing the child.
     MOZ_ASSERT(aParentID);
+    if (!aParentID) {
+      return false;
+    }
+
     auto parentDoc = static_cast<a11y::DocAccessibleParent*>(aParentDoc);
     return parentDoc->AddChildDoc(doc, aParentID);
   } else {
+    // null aParentDoc means this document is at the top level in the child
+    // process.  That means it makes no sense to get an id for an accessible
+    // that is its parent.
     MOZ_ASSERT(!aParentID);
+    if (aParentID) {
+      return false;
+    }
+
     doc->SetTopLevel();
     a11y::DocManager::RemoteDocAdded(doc);
   }
 #endif
   return true;
 }
 
 PDocumentRendererParent*
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -256,17 +256,16 @@ private:
   DECL_GFX_PREF(Once, "gfx.work-around-driver-bugs",           WorkAroundDriverBugs, bool, true);
 
   DECL_GFX_PREF(Live, "gl.msaa-level",                         MSAALevel, uint32_t, 2);
   DECL_GFX_PREF(Live, "gl.require-hardware",                   RequireHardwareGL, bool, false);
 
   DECL_GFX_PREF(Once, "image.cache.size",                      ImageCacheSize, int32_t, 5*1024*1024);
   DECL_GFX_PREF(Once, "image.cache.timeweight",                ImageCacheTimeWeight, int32_t, 500);
   DECL_GFX_PREF(Live, "image.decode-immediately.enabled",      ImageDecodeImmediatelyEnabled, bool, false);
-  DECL_GFX_PREF(Once, "image.decode.retry-on-alloc-failure",   ImageDecodeRetryOnAllocFailure, bool, false);
   DECL_GFX_PREF(Live, "image.downscale-during-decode.enabled", ImageDownscaleDuringDecodeEnabled, bool, true);
   DECL_GFX_PREF(Live, "image.high_quality_downscaling.enabled", ImageHQDownscalingEnabled, bool, false);
   DECL_GFX_PREF(Live, "image.high_quality_downscaling.min_factor", ImageHQDownscalingMinFactor, uint32_t, 1000);
   DECL_GFX_PREF(Live, "image.high_quality_upscaling.max_size", ImageHQUpscalingMaxSize, uint32_t, 20971520);
   DECL_GFX_PREF(Live, "image.infer-src-animation.threshold-ms", ImageInferSrcAnimationThresholdMS, uint32_t, 2000);
   DECL_GFX_PREF(Once, "image.mem.decode_bytes_at_a_time",      ImageMemDecodeBytesAtATime, uint32_t, 200000);
   DECL_GFX_PREF(Live, "image.mem.discardable",                 ImageMemDiscardable, bool, false);
   DECL_GFX_PREF(Once, "image.mem.surfacecache.discard_factor", ImageMemSurfaceCacheDiscardFactor, uint32_t, 1);
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -258,17 +258,16 @@ RasterImage::RasterImage(ImageURL* aURI 
   mDecodeCount(0),
   mRequestedSampleSize(0),
   mLastImageContainerDrawResult(DrawResult::NOT_READY),
 #ifdef DEBUG
   mFramesNotified(0),
 #endif
   mSourceBuffer(new SourceBuffer()),
   mFrameCount(0),
-  mRetryCount(0),
   mHasSize(false),
   mTransient(false),
   mSyncLoad(false),
   mDiscardable(false),
   mHasSourceData(false),
   mHasBeenDecoded(false),
   mDownscaleDuringDecode(false),
   mPendingAnimation(false),
@@ -1366,41 +1365,16 @@ RasterImage::Discard()
 }
 
 bool
 RasterImage::CanDiscard() {
   return mHasSourceData &&       // ...have the source data...
          !mAnim;                 // Can never discard animated images
 }
 
-class RetryDecodeRunnable : public nsRunnable
-{
-public:
-  RetryDecodeRunnable(RasterImage* aImage,
-                      const IntSize& aSize,
-                      uint32_t aFlags)
-    : mImage(aImage)
-    , mSize(aSize)
-    , mFlags(aFlags)
-  {
-    MOZ_ASSERT(aImage);
-  }
-
-  NS_IMETHOD Run()
-  {
-    mImage->RequestDecodeForSize(mSize, mFlags);
-    return NS_OK;
-  }
-
-private:
-  nsRefPtr<RasterImage> mImage;
-  const IntSize mSize;
-  const uint32_t mFlags;
-};
-
 // Sets up a decoder for this image.
 already_AddRefed<Decoder>
 RasterImage::CreateDecoder(const Maybe<IntSize>& aSize, uint32_t aFlags)
 {
   // Make sure we actually get size before doing a full decode.
   if (aSize) {
     MOZ_ASSERT(mHasSize, "Must do a size decode before a full decode!");
     MOZ_ASSERT(mDownscaleDuringDecode || *aSize == mSize,
@@ -1456,42 +1430,16 @@ RasterImage::CreateDecoder(const Maybe<I
   if (!mHasBeenDecoded && aSize) {
     // Lock the image while we're decoding, so that it doesn't get evicted from
     // the SurfaceCache before we have a chance to realize that it's animated.
     // The corresponding unlock happens in FinalizeDecoder.
     LockImage();
     decoder->SetImageIsLocked();
   }
 
-  if (aSize && decoder->HasError()) {
-    if (gfxPrefs::ImageDecodeRetryOnAllocFailure() &&
-        mRetryCount < 10) {
-      // We couldn't allocate the first frame for this image. We're probably in
-      // a temporary low-memory situation, so fire off a runnable and hope that
-      // things have improved when it runs. (Unless we've already retried 10
-      // times in a row, in which case just give up.)
-      mRetryCount++;
-
-      if (decoder->ImageIsLocked()) {
-        UnlockImage();
-      }
-      decoder->TakeProgress();
-      decoder->TakeInvalidRect();
-
-      nsCOMPtr<nsIRunnable> runnable =
-        new RetryDecodeRunnable(this, *aSize, aFlags);
-      NS_DispatchToMainThread(runnable);
-
-      return nullptr;
-    }
-  } else {
-    // We didn't encounter an error when allocating the first frame.
-    mRetryCount = 0;
-  }
-
   decoder->SetIterator(mSourceBuffer->Iterator());
 
   // Set a target size for downscale-during-decode if applicable.
   if (mDownscaleDuringDecode && aSize && *aSize != mSize) {
     DebugOnly<nsresult> rv = decoder->SetTargetSize(*aSize);
     MOZ_ASSERT(nsresult(rv) != NS_ERROR_NOT_AVAILABLE,
                "We're downscale-during-decode but decoder doesn't support it?");
     MOZ_ASSERT(NS_SUCCEEDED(rv), "Bad downscale-during-decode target size?");
--- a/image/RasterImage.h
+++ b/image/RasterImage.h
@@ -402,19 +402,16 @@ private: // data
 #endif
 
   // The source data for this image.
   nsRefPtr<SourceBuffer>     mSourceBuffer;
 
   // The number of frames this image has.
   uint32_t                   mFrameCount;
 
-  // The number of times we've retried decoding this image.
-  uint8_t                    mRetryCount;
-
   // Boolean flags (clustered together to conserve space):
   bool                       mHasSize:1;       // Has SetSize() been called?
   bool                       mTransient:1;     // Is the image short-lived?
   bool                       mSyncLoad:1;      // Are we loading synchronously?
   bool                       mDiscardable:1;   // Is container discardable?
   bool                       mHasSourceData:1; // Do we have source data?
   bool                       mHasBeenDecoded:1; // Decoded at least once?
   bool                       mDownscaleDuringDecode:1;
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -6883,23 +6883,17 @@ class MPhi final
         // once Vector supports that.
         inputs_.infallibleGrowByUninitialized(1);
         new (&inputs_.back()) MUse(ins, this);
     }
 
     // Appends a new input to the input vector. May perform reallocation.
     // Prefer reserveLength() and addInput() instead, where possible.
     bool addInputSlow(MDefinition* ins) {
-        // Use growByUninitialized and placement-new instead of just append,
-        // similar to what addInput does.
-        if (!inputs_.growByUninitialized(1))
-            return false;
-
-        new (&inputs_.back()) MUse(ins, this);
-        return true;
+        return inputs_.emplaceBack(ins, this);
     }
 
     // Update the type of this phi after adding |ins| as an input. Set
     // |*ptypeChange| to true if the type changed.
     bool checkForTypeChange(MDefinition* ins, bool* ptypeChange);
 
     MDefinition* foldsTo(TempAllocator& alloc) override;
     MDefinition* foldsTernary();
--- a/js/src/vm/SavedStacks.cpp
+++ b/js/src/vm/SavedStacks.cpp
@@ -925,38 +925,34 @@ SavedStacks::insertFrames(JSContext* cx,
             }
         } else if (asyncActivation != &activation) {
             // We found an async stack in the previous activation, and we
             // walked past the oldest frame of that activation, we're done.
             break;
         }
 
         AutoLocationValueRooter location(cx);
-
         {
             AutoCompartment ac(cx, iter.compartment());
             if (!cx->compartment()->savedStacks().getLocation(cx, iter, &location))
                 return false;
         }
 
-        // Use growByUninitialized and placement-new instead of just append.
-        // We'd ideally like to use an emplace method once Vector supports it.
-        if (!stackChain->growByUninitialized(1)) {
+        auto displayAtom = iter.isNonEvalFunctionFrame() ? iter.functionDisplayAtom() : nullptr;
+        if (!stackChain->emplaceBack(location->source,
+                                     location->line,
+                                     location->column,
+                                     displayAtom,
+                                     nullptr,
+                                     nullptr,
+                                     iter.compartment()->principals()))
+        {
             ReportOutOfMemory(cx);
             return false;
         }
-        new (&stackChain->back()) SavedFrame::Lookup(
-          location->source,
-          location->line,
-          location->column,
-          iter.isNonEvalFunctionFrame() ? iter.functionDisplayAtom() : nullptr,
-          nullptr,
-          nullptr,
-          iter.compartment()->principals()
-        );
 
         ++iter;
 
         // If maxFrameCount is zero there's no limit on the number of frames.
         if (maxFrameCount == 0)
             continue;
 
         if (maxFrameCount == 1) {
@@ -1006,23 +1002,20 @@ SavedStacks::adoptAsyncStack(JSContext* 
     // still don't enforce an upper limit if the caller requested more frames.
     if (maxFrameCount == 0)
         maxFrameCount = ASYNC_STACK_MAX_FRAME_COUNT;
 
     // Accumulate the vector of Lookup objects in |stackChain|.
     SavedFrame::AutoLookupVector stackChain(cx);
     SavedFrame* currentSavedFrame = asyncStack;
     for (unsigned i = 0; i < maxFrameCount && currentSavedFrame; i++) {
-        // Use growByUninitialized and placement-new instead of just append.
-        // We'd ideally like to use an emplace method once Vector supports it.
-        if (!stackChain->growByUninitialized(1)) {
+        if (!stackChain->emplaceBack(*currentSavedFrame)) {
             ReportOutOfMemory(cx);
             return false;
         }
-        new (&stackChain->back()) SavedFrame::Lookup(*currentSavedFrame);
 
         // Attach the asyncCause to the youngest frame.
         if (i == 0)
             stackChain->back().asyncCause = asyncCauseAtom;
 
         currentSavedFrame = currentSavedFrame->getParent();
     }
 
--- a/mfbt/Tuple.h
+++ b/mfbt/Tuple.h
@@ -137,17 +137,40 @@ struct TupleImpl<Index, HeadT, TailT...>
   // Copy and move constructors.
   // We'd like to use '= default' to implement these, but MSVC 2013's support
   // for '= default' is incomplete and this doesn't work.
   TupleImpl(const TupleImpl& aOther)
     : Base(Tail(aOther))
     , mHead(Head(aOther)) {}
   TupleImpl(TupleImpl&& aOther)
     : Base(Move(Tail(aOther)))
-    , mHead(Move(Head(aOther))) {}
+    , mHead(Forward<HeadT>(Head(aOther))) {}
+
+  // Assign from a tuple whose elements are convertible to the elements
+  // of this tuple.
+  template <typename... OtherElements,
+            typename = typename EnableIf<
+                sizeof...(OtherElements) == sizeof...(TailT) + 1>::Type>
+  TupleImpl& operator=(const TupleImpl<Index, OtherElements...>& aOther)
+  {
+    typedef TupleImpl<Index, OtherElements...> OtherT;
+    Head(*this) = OtherT::Head(aOther);
+    Tail(*this) = OtherT::Tail(aOther);
+    return *this;
+  }
+  template <typename... OtherElements,
+            typename = typename EnableIf<
+                sizeof...(OtherElements) == sizeof...(TailT) + 1>::Type>
+  TupleImpl& operator=(TupleImpl<Index, OtherElements...>&& aOther)
+  {
+    typedef TupleImpl<Index, OtherElements...> OtherT;
+    Head(*this) = Move(OtherT::Head(aOther));
+    Tail(*this) = Move(OtherT::Tail(aOther));
+    return *this;
+  }
 
   // Copy and move assignment operators.
   TupleImpl& operator=(const TupleImpl& aOther)
   {
     Head(*this) = Head(aOther);
     Tail(*this) = Tail(aOther);
     return *this;
   }
@@ -190,16 +213,32 @@ public:
                 detail::CheckConvertibility<
                     detail::Group<OtherHead, OtherTail...>,
                     detail::Group<Elements...>>::value>::Type>
   explicit Tuple(OtherHead&& aHead, OtherTail&&... aTail)
     : Impl(Forward<OtherHead>(aHead), Forward<OtherTail>(aTail)...) { }
   Tuple(const Tuple& aOther) : Impl(aOther) { }
   Tuple(Tuple&& aOther) : Impl(Move(aOther)) { }
 
+  template <typename... OtherElements,
+            typename = typename EnableIf<
+                sizeof...(OtherElements) == sizeof...(Elements)>::Type>
+  Tuple& operator=(const Tuple<OtherElements...>& aOther)
+  {
+    static_cast<Impl&>(*this) = aOther;
+    return *this;
+  }
+  template <typename... OtherElements,
+            typename = typename EnableIf<
+                sizeof...(OtherElements) == sizeof...(Elements)>::Type>
+  Tuple& operator=(Tuple<OtherElements...>&& aOther)
+  {
+    static_cast<Impl&>(*this) = Move(aOther);
+    return *this;
+  }
   Tuple& operator=(const Tuple& aOther)
   {
     static_cast<Impl&>(*this) = aOther;
     return *this;
   }
   Tuple& operator=(Tuple&& aOther)
   {
     static_cast<Impl&>(*this) = Move(aOther);
@@ -291,11 +330,30 @@ auto Get(Tuple<Elements...>&& aTuple)
  * auto tuple = MakeTuple(42, 0.5f, 'c');  // has type Tuple<int, float, char>
  */
 template<typename... Elements>
 Tuple<Elements...> MakeTuple(Elements&&... aElements)
 {
   return Tuple<Elements...>(Forward<Elements>(aElements)...);
 }
 
+/**
+ * A convenience function for constructing a tuple of references to a
+ * sequence of variables. Since assignments to the elements of the tuple
+ * "go through" to the referenced variables, this can be used to "unpack"
+ * a tuple into individual variables.
+ *
+ * Example:
+ *
+ * int i;
+ * float f;
+ * char c;
+ * Tie(i, f, c) = FunctionThatReturnsATuple();
+ */
+template<typename... Elements>
+Tuple<Elements&...> Tie(Elements&... aVariables)
+{
+  return Tuple<Elements&...>(aVariables...);
+}
+
 } // namespace mozilla
 
 #endif /* mozilla_Tuple_h */
--- a/mfbt/Vector.h
+++ b/mfbt/Vector.h
@@ -559,16 +559,28 @@ public:
 
   /**
    * This can take either a T& or a T&&. Given a T&&, it moves |aU| into the
    * vector, instead of copying it. If it fails, |aU| is left unmoved. ("We are
    * not amused.")
    */
   template<typename U> bool append(U&& aU);
 
+  /**
+   * Construct a T in-place as a new entry at the end of this vector.
+   */
+  template<typename... Args>
+  bool emplaceBack(Args&&... aArgs)
+  {
+    if (!growByUninitialized(1))
+      return false;
+    new (&back()) T(Forward<Args>(aArgs)...);
+    return true;
+  }
+
   template<typename U, size_t O, class BP, class UV>
   bool appendAll(const VectorBase<U, O, BP, UV>& aU);
   bool appendN(const T& aT, size_t aN);
   template<typename U> bool append(const U* aBegin, const U* aEnd);
   template<typename U> bool append(const U* aBegin, size_t aLength);
 
   /*
    * Guaranteed-infallible append operations for use upon vectors whose
--- a/mfbt/tests/TestTuple.cpp
+++ b/mfbt/tests/TestTuple.cpp
@@ -13,16 +13,17 @@
 
 #include <stddef.h>
 
 using mozilla::Get;
 using mozilla::IsSame;
 using mozilla::MakeTuple;
 using mozilla::MakeUnique;
 using mozilla::Move;
+using mozilla::Tie;
 using mozilla::Tuple;
 using mozilla::UniquePtr;
 using mozilla::unused;
 
 #define CHECK(c) \
   do { \
     bool cond = !!(c); \
     MOZ_RELEASE_ASSERT(cond, "Failed assertion: " #c); \
@@ -31,17 +32,17 @@ using mozilla::unused;
 // The second argument is the expected type. It's variadic to allow the
 // type to contain commas.
 #define CHECK_TYPE(expression, ...)  \
   static_assert(IsSame<decltype(expression), __VA_ARGS__>::value, \
       "Type mismatch!")
 
 struct ConvertibleToInt
 {
-  operator int() { return 42; }
+  operator int() const { return 42; }
 };
 
 static void
 TestConstruction()
 {
   // Default construction
   Tuple<> a;
   unused << a;
@@ -131,17 +132,39 @@ TestMakeTuple()
   auto tuple = MakeTuple(42, 0.5f, 'c');
   CHECK_TYPE(tuple, Tuple<int, float, char>);
   CHECK(Get<0>(tuple) == 42);
   CHECK(Get<1>(tuple) == 1.0f);
   CHECK(Get<2>(tuple) == 'c');
   return true;
 }
 
+static bool
+TestTie()
+{
+  int i;
+  float f;
+  char c;
+  Tuple<int, float, char> rhs1(42, 0.5f, 'c');
+  Tie(i, f, c) = rhs1;
+  CHECK(i == Get<0>(rhs1));
+  CHECK(f == Get<1>(rhs1));
+  CHECK(c == Get<2>(rhs1));
+  // Test conversions
+  Tuple<ConvertibleToInt, double, unsigned char> rhs2(ConvertibleToInt(),
+      0.7f, 'd');
+  Tie(i, f, c) = rhs2;
+  CHECK(i == Get<0>(rhs2));
+  CHECK(f == Get<1>(rhs2));
+  CHECK(c == Get<2>(rhs2));
+  return true;
+}
+
 int
 main()
 {
   TestConstruction();
   TestAssignment();
   TestGet();
   TestMakeTuple();
+  TestTie();
   return 0;
 }
--- a/mfbt/tests/TestVector.cpp
+++ b/mfbt/tests/TestVector.cpp
@@ -1,25 +1,29 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "mozilla/Move.h"
+#include "mozilla/UniquePtr.h"
 #include "mozilla/Vector.h"
 
 using mozilla::detail::VectorTesting;
+using mozilla::MakeUnique;
 using mozilla::Move;
+using mozilla::UniquePtr;
 using mozilla::Vector;
 
 struct mozilla::detail::VectorTesting
 {
   static void testReserved();
   static void testConstRange();
+  static void testEmplaceBack();
 };
 
 void
 mozilla::detail::VectorTesting::testReserved()
 {
 #ifdef DEBUG
   Vector<bool> bv;
   MOZ_RELEASE_ASSERT(bv.reserved() == 0);
@@ -92,15 +96,78 @@ mozilla::detail::VectorTesting::testCons
   for (int i = 0; i < 10; i++) {
     MOZ_RELEASE_ASSERT(!range.empty());
     MOZ_RELEASE_ASSERT(range.front() == i);
     range.popFront();
   }
 #endif
 }
 
+namespace {
+
+struct S
+{
+  size_t            j;
+  UniquePtr<size_t> k;
+
+  static size_t constructCount;
+  static size_t moveCount;
+
+  S(size_t j, size_t k)
+    : j(j)
+    , k(MakeUnique<size_t>(k))
+  {
+    constructCount++;
+  }
+
+  S(S&& rhs)
+    : j(rhs.j)
+    , k(Move(rhs.k))
+  {
+    rhs.~S();
+    moveCount++;
+  }
+
+  S(const S&) = delete;
+  S& operator=(const S&) = delete;
+};
+
+size_t S::constructCount = 0;
+size_t S::moveCount = 0;
+
+}
+
+void
+mozilla::detail::VectorTesting::testEmplaceBack()
+{
+  Vector<S> vec;
+  MOZ_RELEASE_ASSERT(vec.reserve(20));
+
+  for (size_t i = 0; i < 10; i++) {
+    S s(i, i*i);
+    MOZ_RELEASE_ASSERT(vec.append(Move(s)));
+  }
+
+  MOZ_RELEASE_ASSERT(vec.length() == 10);
+  MOZ_RELEASE_ASSERT(S::constructCount == 10);
+  MOZ_RELEASE_ASSERT(S::moveCount == 10);
+
+  for (size_t i = 10; i < 20; i++) {
+    MOZ_RELEASE_ASSERT(vec.emplaceBack(i, i*i));
+  }
+
+  MOZ_RELEASE_ASSERT(vec.length() == 20);
+  MOZ_RELEASE_ASSERT(S::constructCount == 20);
+  MOZ_RELEASE_ASSERT(S::moveCount == 10);
+
+  for (size_t i = 0; i < 20; i++) {
+    MOZ_RELEASE_ASSERT(vec[i].j == i);
+    MOZ_RELEASE_ASSERT(*vec[i].k == i*i);
+  }
+}
 
 int
 main()
 {
   VectorTesting::testReserved();
   VectorTesting::testConstRange();
+  VectorTesting::testEmplaceBack();
 }
--- a/python/mozboot/mozboot/osx.py
+++ b/python/mozboot/mozboot/osx.py
@@ -301,16 +301,17 @@ class OSXBootstrapper(BaseBootstrapper):
             # We need to install Python because Mercurial requires the Python
             # development headers which are missing from OS X (at least on
             # 10.8) and because the build system wants a version newer than
             # what Apple ships.
             ('python', 'python'),
             ('mercurial', 'mercurial'),
             ('git', 'git'),
             ('autoconf213', HOMEBREW_AUTOCONF213),
+            ('gnu-tar', 'gnu-tar'),
         ]
         self._ensure_homebrew_packages(packages)
 
     def ensure_homebrew_browser_packages(self):
         packages = [
             ('yasm', 'yasm'),
         ]
         self._ensure_homebrew_packages(packages)
@@ -367,17 +368,18 @@ class OSXBootstrapper(BaseBootstrapper):
         missing = [package for package in packages if package not in installed]
         if missing:
             print(PACKAGE_MANAGER_PACKAGES % ('MacPorts',))
             self.run_as_root([self.port, '-v', 'install'] + missing)
 
     def ensure_macports_system_packages(self):
         packages = ['python27',
                     'mercurial',
-                    'autoconf213']
+                    'autoconf213',
+                    'gnutar']
 
         self._ensure_macports_packages(packages)
         self.run_as_root([self.port, 'select', '--set', 'python', 'python27'])
 
     def ensure_macports_browser_packages(self):
         packages = ['yasm']
 
         self._ensure_macports_packages(packages)
--- a/toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini
@@ -12,20 +12,20 @@ head = head_update.js
 tail =
 
 [marSuccessComplete.js]
 [marSuccessPartial.js]
 [marFailurePartial.js]
 [marStageSuccessComplete.js]
 [marStageSuccessPartial.js]
 [marVersionDowngrade.js]
-skip-if = os != 'win' && os != 'mac'
+skip-if = toolkit == 'gonk'
 reason = mar signing
 [marWrongChannel.js]
-skip-if = os != 'win' && os != 'mac'
+skip-if = toolkit == 'gonk'
 reason = mar signing
 [marStageFailurePartial.js]
 [marCallbackAppSuccessComplete_win.js]
 skip-if = os != 'win'
 [marCallbackAppSuccessPartial_win.js]
 skip-if = os != 'win'
 [marCallbackAppStageSuccessComplete_win.js]
 skip-if = os != 'win'
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -115,17 +115,18 @@ static int ioprio_set(int which, int who
 #endif
 
 # define MAYBE_USE_HARD_LINKS 1
 static bool sUseHardLinks = true;
 #else
 # define MAYBE_USE_HARD_LINKS 0
 #endif
 
-#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && !defined(XP_MACOSX)
+#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && \
+    !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
 #include "nss.h"
 #include "prerror.h"
 #endif
 
 #ifdef XP_WIN
 #include "updatehelper.h"
 
 // Closes the handle if valid and if the updater is elevated returns with the
@@ -2371,17 +2372,18 @@ int NS_main(int argc, NS_tchar **argv)
     unsetenv("LD_PRELOAD");
     execv(argv[0], argv);
     __android_log_print(ANDROID_LOG_INFO, "updater",
                         "execve failed: errno: %d. Exiting...", errno);
     _exit(1);
   }
 #endif
 
-#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && !defined(XP_MACOSX)
+#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && \
+    !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
   // On Windows and Mac we rely on native APIs to do verifications so we don't
   // need to initialize NSS at all there.
   // Otherwise, minimize the amount of NSS we depend on by avoiding all the NSS
   // databases.
   if (NSS_NoDB_Init(NULL) != SECSuccess) {
    PRErrorCode error = PR_GetError();
    fprintf(stderr, "Could not initialize NSS: %s (%d)",
            PR_ErrorToName(error), (int) error);
@@ -2873,17 +2875,17 @@ int NS_main(int argc, NS_tchar **argv)
       CloseHandle(elevatedFileHandle);
 
       if (!useService && !noServiceFallback &&
           INVALID_HANDLE_VALUE == updateLockFileHandle) {
         // We didn't use the service and we did run the elevated updater.exe.
         // The elevated updater.exe is responsible for writing out the
         // update.status file.
         return 0;
-      } else if(useService) {
+      } else if (useService) {
         // The service command was launched. The service is responsible for
         // writing out the update.status file.
         if (updateLockFileHandle != INVALID_HANDLE_VALUE) {
           CloseHandle(updateLockFileHandle);
         }
         return 0;
       } else {
         // Otherwise the service command was not launched at all.
@@ -3239,16 +3241,17 @@ int NS_main(int argc, NS_tchar **argv)
     }
     EXIT_WHEN_ELEVATED(elevatedLockFilePath, updateLockFileHandle, 0);
 #endif /* XP_WIN */
 #ifdef XP_MACOSX
     if (gSucceeded) {
       LaunchMacPostProcess(gInstallDirPath);
     }
 #endif /* XP_MACOSX */
+
     LaunchCallbackApp(argv[5],
                       argc - callbackIndex,
                       argv + callbackIndex,
                       sUsingService);
   }
 
   return gSucceeded ? 0 : 1;
 }
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -397,17 +397,18 @@ CopyUpdaterIntoUpdateDir(nsIFile *greDir
 }
 
 /**
  * Appends the specified path to the library path.
  * This is used so that updater can find libmozsqlite3.so and other shared libs.
  *
  * @param pathToAppend A new library path to prepend to LD_LIBRARY_PATH
  */
-#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && !defined(XP_MACOSX)
+#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && \
+    !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
 #include "prprf.h"
 #define PATH_SEPARATOR ":"
 #define LD_LIBRARY_PATH_ENVVAR_NAME "LD_LIBRARY_PATH"
 static void
 AppendToLibPath(const char *pathToAppend)
 {
   char *pathValue = getenv(LD_LIBRARY_PATH_ENVVAR_NAME);
   if (nullptr == pathValue || '\0' == *pathValue) {
@@ -621,17 +622,18 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIF
   } else {
     argc = 5;
     argv[5] = nullptr;
   }
 
   if (gSafeMode) {
     PR_SetEnv("MOZ_SAFE_MODE_RESTART=1");
   }
-#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && !defined(XP_MACOSX)
+#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && \
+    !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
   AppendToLibPath(installDirPath.get());
 #endif
 
   LOG(("spawning updater process for replacing [%s]\n", updaterPath.get()));
 
 #if defined(USE_EXECV)
 # if defined(MOZ_WIDGET_GONK)
   // In Gonk, we preload libmozglue, which the updater process doesn't need.
@@ -901,17 +903,18 @@ ApplyUpdate(nsIFile *greDir, nsIFile *up
   } else {
     argc = 5;
     argv[5] = nullptr;
   }
 
   if (gSafeMode) {
     PR_SetEnv("MOZ_SAFE_MODE_RESTART=1");
   }
-#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && !defined(XP_MACOSX)
+#if defined(MOZ_VERIFY_MAR_SIGNATURE) && !defined(XP_WIN) && \
+    !defined(XP_MACOSX) && !defined(MOZ_WIDGET_GONK)
   AppendToLibPath(installDirPath.get());
 #endif
 
   if (isOSUpdate) {
     PR_SetEnv("MOZ_OS_UPDATE=1");
   }
 #if defined(MOZ_WIDGET_GONK)
   // We want the updater to be CPU friendly and not subject to being killed by