Merge release to beta. CLOSED TREE
authorRyan VanderMeulen <ryanvm@gmail.com>
Mon, 04 May 2015 13:29:00 -0400
changeset 260392 f84585d763a5
parent 260391 ac5b76223f2f (current diff)
parent 260364 f33925faccee (diff)
child 260393 b91226cec861
push id768
push userraliiev@mozilla.com
push date2015-05-04 18:02 +0000
treeherdermozilla-release@b1bfde2ccb22 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone38.0
Merge release to beta. CLOSED TREE
mobile/android/confvars.sh
--- a/browser/base/content/test/social/browser_social_activation.js
+++ b/browser/base/content/test/social/browser_social_activation.js
@@ -84,28 +84,25 @@ function activateIFrameProvider(domain, 
     sendActivationEvent(tab, callback, false);
   });
 }
 
 function waitForProviderLoad(cb) {
     waitForCondition(function() {
       let sbrowser = document.getElementById("social-sidebar-browser");
       let provider = SocialSidebar.provider;
-      let postActivation = provider && gBrowser.contentDocument.location.href == provider.origin + "/browser/browser/base/content/test/social/social_postActivation.html";
+      let postActivation = provider && gBrowser.contentDocument &&
+                            gBrowser.contentDocument.location.href == provider.origin + "/browser/browser/base/content/test/social/social_postActivation.html";
 
-      return provider &&
-             provider.profile &&
-             provider.profile.displayName &&
-             postActivation &&
-             sbrowser.docShellIsActive;
+      return postActivation && sbrowser.docShellIsActive;
     }, function() {
       // executeSoon to let the browser UI observers run first
       executeSoon(cb);
     },
-    "waitForProviderLoad: provider profile was not set");
+    "waitForProviderLoad: provider was not loaded");
 }
 
 
 function getAddonItemInList(aId, aList) {
   var item = aList.firstChild;
   while (item) {
     if ("mAddon" in item && item.mAddon.id == aId) {
       aList.ensureElementIsVisible(item);
@@ -173,32 +170,29 @@ function activateOneProvider(manifest, f
   });
 }
 
 let gTestDomains = ["https://example.com", "https://test1.example.com", "https://test2.example.com"];
 let gProviders = [
   {
     name: "provider 1",
     origin: "https://example.com",
-    sidebarURL: "https://example.com/browser/browser/base/content/test/social/social_sidebar.html?provider1",
-    workerURL: "https://example.com/browser/browser/base/content/test/social/social_worker.js#no-profile,no-recommend",
+    sidebarURL: "https://example.com/browser/browser/base/content/test/social/social_sidebar_empty.html?provider1",
     iconURL: "chrome://branding/content/icon48.png"
   },
   {
     name: "provider 2",
     origin: "https://test1.example.com",
-    sidebarURL: "https://test1.example.com/browser/browser/base/content/test/social/social_sidebar.html?provider2",
-    workerURL: "https://test1.example.com/browser/browser/base/content/test/social/social_worker.js#no-profile,no-recommend",
+    sidebarURL: "https://test1.example.com/browser/browser/base/content/test/social/social_sidebar_empty.html?provider2",
     iconURL: "chrome://branding/content/icon64.png"
   },
   {
     name: "provider 3",
     origin: "https://test2.example.com",
-    sidebarURL: "https://test2.example.com/browser/browser/base/content/test/social/social_sidebar.html?provider2",
-    workerURL: "https://test2.example.com/browser/browser/base/content/test/social/social_worker.js#no-profile,no-recommend",
+    sidebarURL: "https://test2.example.com/browser/browser/base/content/test/social/social_sidebar_empty.html?provider2",
     iconURL: "chrome://branding/content/about-logo.png"
   }
 ];
 
 
 function test() {
   waitForExplicitFinish();
   runSocialTests(tests, undefined, postTestCleanup);
--- a/browser/confvars.sh
+++ b/browser/confvars.sh
@@ -43,19 +43,19 @@ MOZ_EXTENSIONS_DEFAULT=" gio"
 # "nightly" branding (until bug 659568 is fixed).
 # For the mozilla-aurora repository, use "aurora".
 MOZ_BRANDING_DIRECTORY=browser/branding/nightly
 MOZ_OFFICIAL_BRANDING_DIRECTORY=browser/branding/official
 MOZ_APP_ID={ec8030f7-c20a-464f-9b0e-13a3a9e97384}
 # This should usually be the same as the value MAR_CHANNEL_ID.
 # If more than one ID is needed, then you should use a comma separated list
 # of values.
-ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-beta,firefox-mozilla-release
+ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-release
 # The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
-MAR_CHANNEL_ID=firefox-mozilla-beta
+MAR_CHANNEL_ID=firefox-mozilla-release
 MOZ_PROFILE_MIGRATOR=1
 MOZ_APP_STATIC_INI=1
 MOZ_WEBAPP_RUNTIME=1
 MOZ_MEDIA_NAVIGATOR=1
 MOZ_WEBGL_CONFORMANT=1
 # Enable navigator.mozPay
 MOZ_PAY=1
 # Enable activities. These are used for FxOS developers currently.
--- a/dom/indexedDB/ActorsChild.cpp
+++ b/dom/indexedDB/ActorsChild.cpp
@@ -66,16 +66,22 @@ ThreadLocal::ThreadLocal(const nsID& aBa
   , mCurrentTransaction(0)
 #ifdef DEBUG
   , mOwningThread(PR_GetCurrentThread())
 #endif
 {
   MOZ_ASSERT(mOwningThread);
 
   MOZ_COUNT_CTOR(mozilla::dom::indexedDB::ThreadLocal);
+
+  // NSID_LENGTH counts the null terminator, SetLength() does not.
+  mLoggingIdString.SetLength(NSID_LENGTH - 1);
+
+  aBackgroundChildLoggingId.ToProvidedString(
+    *reinterpret_cast<char(*)[NSID_LENGTH]>(mLoggingIdString.BeginWriting()));
 }
 
 ThreadLocal::~ThreadLocal()
 {
   MOZ_COUNT_DTOR(mozilla::dom::indexedDB::ThreadLocal);
 }
 
 #ifdef DEBUG
--- a/dom/indexedDB/ActorsChild.h
+++ b/dom/indexedDB/ActorsChild.h
@@ -49,16 +49,17 @@ class SerializedStructuredCloneReadInfo;
 
 class ThreadLocal
 {
   friend class nsAutoPtr<ThreadLocal>;
   friend class IDBFactory;
 
   LoggingInfo mLoggingInfo;
   IDBTransaction* mCurrentTransaction;
+  nsCString mLoggingIdString;
 
 #ifdef DEBUG
   PRThread* mOwningThread;
 #endif
 
 public:
   void
   AssertIsOnOwningThread() const
@@ -79,16 +80,24 @@ public:
   const nsID&
   Id() const
   {
     AssertIsOnOwningThread();
 
     return mLoggingInfo.backgroundChildLoggingId();
   }
 
+  const nsCString&
+  IdString() const
+  {
+    AssertIsOnOwningThread();
+
+    return mLoggingIdString;
+  }
+
   int64_t
   NextTransactionSN(IDBTransaction::Mode aMode)
   {
     AssertIsOnOwningThread();
     MOZ_ASSERT(mLoggingInfo.nextTransactionSerialNumber() < INT64_MAX);
     MOZ_ASSERT(mLoggingInfo.nextVersionChangeTransactionSerialNumber() >
                  INT64_MIN);
 
--- a/dom/indexedDB/ProfilerHelpers.h
+++ b/dom/indexedDB/ProfilerHelpers.h
@@ -39,44 +39,45 @@ namespace indexedDB {
 class MOZ_STACK_CLASS LoggingIdString final
   : public nsAutoCString
 {
 public:
   LoggingIdString()
   {
     using mozilla::ipc::BackgroundChildImpl;
 
-    BackgroundChildImpl::ThreadLocal* threadLocal =
-      BackgroundChildImpl::GetThreadLocalForCurrentThread();
-    MOZ_ASSERT(threadLocal);
-
-    ThreadLocal* idbThreadLocal = threadLocal->mIndexedDBThreadLocal;
-    MOZ_ASSERT(idbThreadLocal);
-
-    Init(idbThreadLocal->Id());
+    if (IndexedDatabaseManager::GetLoggingMode() !=
+          IndexedDatabaseManager::Logging_Disabled) {
+      const BackgroundChildImpl::ThreadLocal* threadLocal =
+        BackgroundChildImpl::GetThreadLocalForCurrentThread();
+      if (threadLocal) {
+        const ThreadLocal* idbThreadLocal = threadLocal->mIndexedDBThreadLocal;
+        if (idbThreadLocal) {
+          Assign(idbThreadLocal->IdString());
+        }
+      }
+    }
   }
 
   explicit
   LoggingIdString(const nsID& aID)
   {
-    Init(aID);
-  }
-
-private:
-  void
-  Init(const nsID& aID)
-  {
     static_assert(NSID_LENGTH > 1, "NSID_LENGTH is set incorrectly!");
+    static_assert(NSID_LENGTH <= kDefaultStorageSize,
+                  "nID string won't fit in our storage!");
     MOZ_ASSERT(Capacity() > NSID_LENGTH);
 
-    // NSID_LENGTH counts the null terminator, SetLength() does not.
-    SetLength(NSID_LENGTH - 1);
+    if (IndexedDatabaseManager::GetLoggingMode() !=
+          IndexedDatabaseManager::Logging_Disabled) {
+      // NSID_LENGTH counts the null terminator, SetLength() does not.
+      SetLength(NSID_LENGTH - 1);
 
-    aID.ToProvidedString(
-      *reinterpret_cast<char(*)[NSID_LENGTH]>(BeginWriting()));
+      aID.ToProvidedString(
+        *reinterpret_cast<char(*)[NSID_LENGTH]>(BeginWriting()));
+    }
   }
 };
 
 class MOZ_STACK_CLASS LoggingString final
   : public nsAutoCString
 {
   static const char kQuote = '\"';
   static const char kOpenBracket = '[';
--- a/gfx/layers/basic/BasicCompositor.cpp
+++ b/gfx/layers/basic/BasicCompositor.cpp
@@ -277,17 +277,17 @@ Transform(DataSourceSurface* aDest,
 
   IntSize srcSize = aSource->GetSize();
   pixman_image_t* src = pixman_image_create_bits(PIXMAN_a8r8g8b8,
                                                  srcSize.width,
                                                  srcSize.height,
                                                  (uint32_t*)aSource->GetData(),
                                                  aSource->Stride());
 
-  NS_ABORT_IF_FALSE(src && dest, "Failed to create pixman images?");
+  MOZ_ASSERT(src !=0 && dest != 0, "Failed to create pixman images?");
 
   pixman_transform pixTransform = Matrix3DToPixman(aTransform);
   pixman_transform pixTransformInverted;
 
   // If the transform is singular then nothing would be drawn anyway, return here
   if (!pixman_transform_invert(&pixTransformInverted, &pixTransform)) {
     pixman_image_unref(dest);
     pixman_image_unref(src);
--- a/gfx/layers/basic/BasicLayerManager.cpp
+++ b/gfx/layers/basic/BasicLayerManager.cpp
@@ -706,17 +706,17 @@ Transform(const gfxImageSurface* aDest,
 
   IntSize srcSize = aSrc->GetSize();
   pixman_image_t* src = pixman_image_create_bits(aSrc->GetFormat() == SurfaceFormat::B8G8R8A8 ? PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8,
                                                  srcSize.width,
                                                  srcSize.height,
                                                  (uint32_t*)aSrc->GetData(),
                                                  aSrc->Stride());
 
-  NS_ABORT_IF_FALSE(src && dest, "Failed to create pixman images?");
+  MOZ_ASSERT(src != 0 && dest !=0, "Failed to create pixman images?");
 
   pixman_transform pixTransform = BasicLayerManager_Matrix3DToPixman(aTransform);
   pixman_transform pixTransformInverted;
 
   // If the transform is singular then nothing would be drawn anyway, return here
   if (!pixman_transform_invert(&pixTransformInverted, &pixTransform)) {
     pixman_image_unref(dest);
     pixman_image_unref(src);
--- a/image/src/moz.build
+++ b/image/src/moz.build
@@ -14,17 +14,16 @@ EXPORTS += [
     'Orientation.h',
     'SurfaceCache.h',
 ]
 
 UNIFIED_SOURCES += [
     'ClippedImage.cpp',
     'DecodePool.cpp',
     'Decoder.cpp',
-    'Downscaler.cpp',
     'DynamicImage.cpp',
     'FrameAnimator.cpp',
     'FrozenImage.cpp',
     'Image.cpp',
     'ImageFactory.cpp',
     'ImageMetadata.cpp',
     'ImageOps.cpp',
     'ImageWrapper.cpp',
@@ -34,16 +33,18 @@ UNIFIED_SOURCES += [
     'OrientedImage.cpp',
     'ScriptedNotificationObserver.cpp',
     'ShutdownTracker.cpp',
     'SourceBuffer.cpp',
     'SurfaceCache.cpp',
     'SVGDocumentWrapper.cpp',
     'VectorImage.cpp',
 ]
+if CONFIG['MOZ_ENABLE_SKIA']:
+    UNIFIED_SOURCES += [ 'Downscaler.cpp']
 
 # These files can't be unified because of ImageLogging.h #include order issues.
 SOURCES += [
     'imgLoader.cpp',
     'imgRequest.cpp',
     'imgRequestProxy.cpp',
     'ProgressTracker.cpp',
     'RasterImage.cpp',
--- a/mobile/android/config/mozconfigs/android-api-11/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-api-11/l10n-nightly
@@ -15,13 +15,13 @@ ac_add_options --target=arm-linux-androi
 
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export MOZILLA_OFFICIAL=1
 export MOZ_DISABLE_GECKOVIEW=1
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --disable-stdcxx-compat
 
 . "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/config/mozconfigs/android-api-11/l10n-release
+++ b/mobile/android/config/mozconfigs/android-api-11/l10n-release
@@ -13,13 +13,13 @@ ac_add_options --target=arm-linux-androi
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export MOZILLA_OFFICIAL=1
 export MOZ_DISABLE_GECKOVIEW=1
 
 ac_add_options --enable-official-branding
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --disable-stdcxx-compat
 
 . "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/config/mozconfigs/android-api-11/nightly
+++ b/mobile/android/config/mozconfigs/android-api-11/nightly
@@ -1,17 +1,17 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 
 
 # Android
 ac_add_options --with-android-min-sdk=11
 ac_add_options --target=arm-linux-androideabi
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling with eideticker. See bug 788680
 STRIP_FLAGS="--strip-debug"
 
 export MOZILLA_OFFICIAL=1
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/mobile/android/config/mozconfigs/android-api-11/release
+++ b/mobile/android/config/mozconfigs/android-api-11/release
@@ -1,15 +1,15 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 # Android
 ac_add_options --with-android-min-sdk=11
 ac_add_options --target=arm-linux-androideabi
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --enable-updater
 
 export MOZILLA_OFFICIAL=1
 export MOZ_TELEMETRY_REPORTING=1
 
 ac_add_options --enable-official-branding
 
--- a/mobile/android/config/mozconfigs/android-api-9-10-constrained/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-api-9-10-constrained/l10n-nightly
@@ -17,13 +17,13 @@ ac_add_options --target=arm-linux-androi
 
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export MOZILLA_OFFICIAL=1
 export MOZ_DISABLE_GECKOVIEW=1
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --disable-stdcxx-compat
 
 . "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/config/mozconfigs/android-api-9-10-constrained/l10n-release
+++ b/mobile/android/config/mozconfigs/android-api-9-10-constrained/l10n-release
@@ -15,13 +15,13 @@ ac_add_options --target=arm-linux-androi
 ac_add_options --with-system-zlib
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export MOZILLA_OFFICIAL=1
 export MOZ_DISABLE_GECKOVIEW=1
 
 ac_add_options --enable-official-branding
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --disable-stdcxx-compat
 
 . "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/config/mozconfigs/android-api-9-10-constrained/nightly
+++ b/mobile/android/config/mozconfigs/android-api-9-10-constrained/nightly
@@ -5,17 +5,17 @@
 # Android
 ac_add_options --with-android-min-sdk=9
 ac_add_options --with-android-max-sdk=10
 ac_add_options --enable-android-resource-constrained
 export MOZ_DISABLE_GECKOVIEW=1
 
 ac_add_options --target=arm-linux-androideabi
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling with eideticker. See bug 788680
 STRIP_FLAGS="--strip-debug"
 
 export MOZILLA_OFFICIAL=1
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/mobile/android/config/mozconfigs/android-api-9-10-constrained/release
+++ b/mobile/android/config/mozconfigs/android-api-9-10-constrained/release
@@ -3,17 +3,17 @@
 # Android
 ac_add_options --with-android-min-sdk=9
 ac_add_options --with-android-max-sdk=10
 ac_add_options --enable-android-resource-constrained
 export MOZ_DISABLE_GECKOVIEW=1
 
 ac_add_options --target=arm-linux-androideabi
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --enable-updater
 
 export MOZILLA_OFFICIAL=1
 export MOZ_TELEMETRY_REPORTING=1
 
 ac_add_options --enable-official-branding
 
--- a/mobile/android/config/mozconfigs/android-x86/l10n-nightly
+++ b/mobile/android/config/mozconfigs/android-x86/l10n-nightly
@@ -13,13 +13,13 @@ ac_add_options --enable-js-diagnostics
 ac_add_options --target=i386-linux-android
 
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export MOZILLA_OFFICIAL=1
 export MOZ_DISABLE_GECKOVIEW=1
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --disable-stdcxx-compat
 
 . "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/config/mozconfigs/android-x86/l10n-release
+++ b/mobile/android/config/mozconfigs/android-x86/l10n-release
@@ -11,13 +11,13 @@ ac_add_options --target=i386-linux-andro
 
 ac_add_options --enable-updater
 ac_add_options --enable-update-channel=${MOZ_UPDATE_CHANNEL}
 
 export MOZILLA_OFFICIAL=1
 export MOZ_DISABLE_GECKOVIEW=1
 
 ac_add_options --enable-official-branding
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 ac_add_options --disable-stdcxx-compat
 
 . "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/config/mozconfigs/android-x86/nightly
+++ b/mobile/android/config/mozconfigs/android-x86/nightly
@@ -1,15 +1,15 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 ac_add_options --target=i386-linux-android
 
 
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 # This will overwrite the default of stripping everything and keep the symbol table.
 # This is useful for profiling with eideticker. See bug 788680
 STRIP_FLAGS="--strip-debug"
 
 export MOZILLA_OFFICIAL=1
 export MOZ_TELEMETRY_REPORTING=1
 
--- a/mobile/android/config/mozconfigs/android-x86/release
+++ b/mobile/android/config/mozconfigs/android-x86/release
@@ -1,15 +1,15 @@
 . "$topsrcdir/mobile/android/config/mozconfigs/common"
 
 # Android
 ac_add_options --target=i386-linux-android
 
 ac_add_options --enable-updater
 
-ac_add_options --with-branding=mobile/android/branding/beta
+ac_add_options --with-branding=mobile/android/branding/official
 
 export MOZILLA_OFFICIAL=1
 export MOZ_TELEMETRY_REPORTING=1
 
 ac_add_options --enable-official-branding
 
 . "$topsrcdir/mobile/android/config/mozconfigs/common.override"
--- a/mobile/android/confvars.sh
+++ b/mobile/android/confvars.sh
@@ -1,16 +1,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/.
 
 MOZ_APP_BASENAME=Fennec
 MOZ_APP_VENDOR=Mozilla
 
-MOZ_APP_VERSION=38.0b8
+MOZ_APP_VERSION=38.0
 MOZ_APP_UA_NAME=Firefox
 
 MOZ_BRANDING_DIRECTORY=mobile/android/branding/unofficial
 MOZ_OFFICIAL_BRANDING_DIRECTORY=mobile/android/branding/official
 # MOZ_APP_DISPLAYNAME is set by branding/configure.sh
 
 # We support Android SDK version 9 and up by default.
 # See the --enable-android-min-sdk and --enable-android-max-sdk arguments in configure.in.
--- a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
+++ b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
@@ -1476,28 +1476,33 @@ function runUpdate(aExpectedExitValue, a
   if (!updater.exists()) {
     updater = binDir.clone();
     updater.append(FILE_UPDATER_BIN);
     if (!updater.exists()) {
       do_throw("Unable to find updater binary!");
     }
   }
 
-  let updatesDir = getUpdatesPatchDir();
-  updater.copyToFollowingLinks(updatesDir, updater.leafName);
-  let updateBin = updatesDir.clone();
-  updateBin.append(updater.leafName);
-  if (updateBin.leafName == "updater.app") {
-    updateBin.append("Contents");
-    updateBin.append("MacOS");
-    updateBin.append("updater");
-    if (!updateBin.exists()) {
-      do_throw("Unable to find the updater executable!");
+   let updatesDir = getUpdatesPatchDir();
+  let updateBin;
+  if (IS_WIN) {
+    updateBin = updater.clone();
+  } else {
+    updater.copyToFollowingLinks(updatesDir, updater.leafName);
+    updateBin = updatesDir.clone();
+    updateBin.append(updater.leafName);
+    if (updateBin.leafName == "updater.app") {
+      updateBin.append("Contents");
+      updateBin.append("MacOS");
+      updateBin.append("updater");
     }
   }
+  if (!updateBin.exists()) {
+    do_throw("Unable to find the updater executable!");
+  }
 
   let applyToDir = getApplyDirFile(null, true);
   let applyToDirPath = applyToDir.path;
 
   let stageDir = getStageDirFile(null, true);
   let stageDirPath = stageDir.path;
 
   if (IS_WIN) {
@@ -2466,16 +2471,20 @@ function checkUpdateLogContents(aCompare
   if (IS_MACOSX) {
     // Skip lines that log moving the distribution directory for Mac v2 signing.
     updateLogContents = updateLogContents.replace(/Moving old [^\n]*\nrename_file: .*/g, "");
     updateLogContents = updateLogContents.replace(/New distribution directory .*/g, "");
   }
   if (gSwitchApp) {
     // Remove the lines which contain absolute paths
     updateLogContents = updateLogContents.replace(/^Begin moving.*$/mg, "");
+    updateLogContents = updateLogContents.replace(/^ensure_remove: failed to remove file: .*$/mg, "");
+    updateLogContents = updateLogContents.replace(/^ensure_remove_recursive: unable to remove directory: .*$/mg, "");
+    updateLogContents = updateLogContents.replace(/^Removing tmpDir failed, err: -1$/mg, "");
+    updateLogContents = updateLogContents.replace(/^remove_recursive_on_reboot: .*$/mg, "");
   }
   updateLogContents = updateLogContents.replace(/\r/g, "");
   // Replace error codes since they are different on each platform.
   updateLogContents = updateLogContents.replace(/, err:.*\n/g, "\n");
   // Replace to make the log parsing happy.
   updateLogContents = updateLogContents.replace(/non-fatal error /g, "");
   // The FindFile results when enumerating the filesystem on Windows is not
   // determistic so the results matching the following need to be ignored.
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
+++ b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
@@ -226,17 +226,17 @@ function finishCheckUpdateApplied() {
     logTestInfo("testing last modified time on the apply to directory has " +
                 "changed after a successful update (bug 600098)");
     let now = Date.now();
     let applyToDir = getApplyDirFile();
     let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
     do_check_true(timeDiff < MAC_MAX_TIME_DIFFERENCE);
   }
 
-  checkFilesAfterUpdateSuccess(getApplyDirFile, false, false);
+  checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
   gSwitchApp = true;
   checkUpdateLogContents();
   gSwitchApp = false;
   checkCallbackAppLog();
 
   standardInit();
 
   let update = gUpdateManager.getUpdateAt(0);
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
+++ b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
@@ -238,17 +238,17 @@ function finishCheckUpdateApplied() {
 
   if (IS_WIN || IS_MACOSX) {
     let running = getPostUpdateFile(".running");
     logTestInfo("checking that the post update process running file exists. " +
                 "Path: " + running.path);
     do_check_true(running.exists());
   }
 
-  checkFilesAfterUpdateSuccess(getApplyDirFile, false, false);
+  checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
   gSwitchApp = true;
   checkUpdateLogContents();
   gSwitchApp = false;
   checkCallbackAppLog();
 
   standardInit();
 
   let update = gUpdateManager.getUpdateAt(0);
--- a/toolkit/mozapps/update/updater/updater.cpp
+++ b/toolkit/mozapps/update/updater/updater.cpp
@@ -464,17 +464,18 @@ static int ensure_remove(const NS_tchar 
   int rv = NS_tremove(path);
   if (rv)
     LOG(("ensure_remove: failed to remove file: " LOG_S ", rv: %d, err: %d",
          path, rv, errno));
   return rv;
 }
 
 // Remove the directory pointed to by path and all of its files and sub-directories.
-static int ensure_remove_recursive(const NS_tchar *path)
+static int ensure_remove_recursive(const NS_tchar *path,
+                                   bool continueEnumOnFailure = false)
 {
   // We use lstat rather than stat here so that we can successfully remove
   // symlinks.
   struct NS_tstat_t sInfo;
   int rv = NS_tlstat(path, &sInfo);
   if (rv) {
     // This error is benign
     return rv;
@@ -483,42 +484,42 @@ static int ensure_remove_recursive(const
     return ensure_remove(path);
   }
 
   NS_tDIR *dir;
   NS_tdirent *entry;
 
   dir = NS_topendir(path);
   if (!dir) {
-    LOG(("ensure_remove_recursive: path is not a directory: " LOG_S ", rv: %d, err: %d",
-         path, rv, errno));
+    LOG(("ensure_remove_recursive: unable to open directory: " LOG_S
+         ", rv: %d, err: %d", path, rv, errno));
     return rv;
   }
 
   while ((entry = NS_treaddir(dir)) != 0) {
     if (NS_tstrcmp(entry->d_name, NS_T(".")) &&
         NS_tstrcmp(entry->d_name, NS_T(".."))) {
       NS_tchar childPath[MAXPATHLEN];
       NS_tsnprintf(childPath, sizeof(childPath)/sizeof(childPath[0]),
                    NS_T("%s/%s"), path, entry->d_name);
       rv = ensure_remove_recursive(childPath);
-      if (rv) {
+      if (rv && !continueEnumOnFailure) {
         break;
       }
     }
   }
 
   NS_tclosedir(dir);
 
   if (rv == OK) {
     ensure_write_permissions(path);
     rv = NS_trmdir(path);
     if (rv) {
-      LOG(("ensure_remove_recursive: path is not a directory: " LOG_S ", rv: %d, err: %d",
-           path, rv, errno));
+      LOG(("ensure_remove_recursive: unable to remove directory: " LOG_S
+           ", rv: %d, err: %d", path, rv, errno));
     }
   }
   return rv;
 }
 
 static bool is_read_only(const NS_tchar *flags)
 {
   size_t length = NS_tstrlen(flags);
@@ -840,16 +841,83 @@ static int rename_file(const NS_tchar *s
     LOG(("rename_file: failed to rename file - src: " LOG_S ", " \
          "dst:" LOG_S ", err: %d", spath, dpath, errno));
     return WRITE_ERROR;
   }
 
   return OK;
 }
 
+#ifdef XP_WIN
+// Remove the directory pointed to by path and all of its files and
+// sub-directories. If a file is in use move it to the tobedeleted directory
+// and attempt to schedule removal of the file on reboot
+static int remove_recursive_on_reboot(const NS_tchar *path, const NS_tchar *deleteDir)
+{
+  struct NS_tstat_t sInfo;
+  int rv = NS_tlstat(path, &sInfo);
+  if (rv) {
+    // This error is benign
+    return rv;
+  }
+
+  if (!S_ISDIR(sInfo.st_mode)) {
+    NS_tchar tmpDeleteFile[MAXPATHLEN];
+    GetTempFileNameW(deleteDir, L"rep", 0, tmpDeleteFile);
+    NS_tremove(tmpDeleteFile);
+    rv = rename_file(path, tmpDeleteFile, false);
+    if (MoveFileEx(rv ? path : tmpDeleteFile, nullptr, MOVEFILE_DELAY_UNTIL_REBOOT)) {
+      LOG(("remove_recursive_on_reboot: file will be removed on OS reboot: "
+           LOG_S, rv ? path : tmpDeleteFile));
+    } else {
+      LOG(("remove_recursive_on_reboot: failed to schedule OS reboot removal of "
+           "file: " LOG_S, rv ? path : tmpDeleteFile));
+    }
+    return rv;
+  }
+
+  NS_tDIR *dir;
+  NS_tdirent *entry;
+
+  dir = NS_topendir(path);
+  if (!dir) {
+    LOG(("remove_recursive_on_reboot: unable to open directory: " LOG_S
+         ", rv: %d, err: %d",
+         path, rv, errno));
+    return rv;
+  }
+
+  while ((entry = NS_treaddir(dir)) != 0) {
+    if (NS_tstrcmp(entry->d_name, NS_T(".")) &&
+        NS_tstrcmp(entry->d_name, NS_T(".."))) {
+      NS_tchar childPath[MAXPATHLEN];
+      NS_tsnprintf(childPath, sizeof(childPath)/sizeof(childPath[0]),
+                   NS_T("%s/%s"), path, entry->d_name);
+      // There is no need to check the return value of this call since this
+      // function is only called after an update is successful and there is not
+      // much that can be done to recover if it isn't successful. There is also
+      // no need to log the value since it will have already been logged.
+      remove_recursive_on_reboot(childPath, deleteDir);
+    }
+  }
+
+  NS_tclosedir(dir);
+
+  if (rv == OK) {
+    ensure_write_permissions(path);
+    rv = NS_trmdir(path);
+    if (rv) {
+      LOG(("remove_recursive_on_reboot: unable to remove directory: " LOG_S
+           ", rv: %d, err: %d", path, rv, errno));
+    }
+  }
+  return rv;
+}
+#endif
+
 //-----------------------------------------------------------------------------
 
 // Create a backup of the specified file by renaming it.
 static int backup_create(const NS_tchar *path)
 {
   NS_tchar backup[MAXPATHLEN];
   NS_tsnprintf(backup, sizeof(backup)/sizeof(backup[0]),
                NS_T("%s") BACKUP_EXT, path);
@@ -2012,26 +2080,30 @@ ProcessReplaceRequest()
     int rv2 = rename_file(tmpDir, destDir, true);
     if (rv2) {
       LOG(("Moving tmpDir back to destDir failed, err: %d", rv2));
     }
     return rv;
   }
 
   LOG(("Now, remove the tmpDir"));
-  rv = ensure_remove_recursive(tmpDir);
+  rv = ensure_remove_recursive(tmpDir, true);
   if (rv) {
     LOG(("Removing tmpDir failed, err: %d", rv));
 #ifdef XP_WIN
-    if (MoveFileExW(tmpDir, nullptr, MOVEFILE_DELAY_UNTIL_REBOOT)) {
-      LOG(("tmpDir will be removed on OS reboot: " LOG_S, tmpDir));
-    } else {
-      LOG(("Failed to schedule OS reboot removal of directory: " LOG_S,
-           tmpDir));
+    NS_tchar deleteDir[MAXPATHLEN];
+    NS_tsnprintf(deleteDir, sizeof(deleteDir)/sizeof(deleteDir[0]),
+                 NS_T("%s\\%s"), destDir, DELETE_DIR);
+    // Attempt to remove the tobedeleted directory and then recreate it if it
+    // was successfully removed.
+    _wrmdir(deleteDir);
+    if (NS_taccess(deleteDir, F_OK)) {
+      NS_tmkdir(deleteDir, 0755);
     }
+    remove_recursive_on_reboot(tmpDir, deleteDir);
 #endif
   }
 
 #ifdef XP_MACOSX
   // On OS X, we we need to remove the staging directory after its Contents
   // directory has been moved.
   NS_tchar updatedAppDir[MAXPATHLEN];
   NS_tsnprintf(updatedAppDir, sizeof(updatedAppDir)/sizeof(updatedAppDir[0]),
@@ -2467,19 +2539,19 @@ int NS_main(int argc, NS_tchar **argv)
   if (pid > 0)
     waitpid(pid, nullptr, 0);
 #endif
 
   if (sReplaceRequest) {
 #ifdef XP_WIN
     // On Windows, the current working directory of the process should be changed
     // so that it's not locked.
-    NS_tchar tmpDir[MAXPATHLEN];
-    if (GetTempPathW(MAXPATHLEN, tmpDir)) {
-      NS_tchdir(tmpDir);
+    NS_tchar sysDir[MAX_PATH + 1] = { L'\0' };
+    if (GetSystemDirectoryW(sysDir, MAX_PATH + 1)) {
+      NS_tchdir(sysDir);
     }
 #endif
   }
 
   // The callback is the remaining arguments starting at callbackIndex.
   // The argument specified by callbackIndex is the callback executable and the
   // argument prior to callbackIndex is the working directory.
   const int callbackIndex = 6;
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -424,19 +424,20 @@ CopyUpdaterIntoUpdateDir(nsIFile *greDir
  */
 static void
 SwitchToUpdatedApp(nsIFile *greDir, nsIFile *updateDir,
                    nsIFile *appDir, int appArgc, char **appArgv)
 {
   nsresult rv;
 
   // Steps:
-  //  - copy updater into updates/0/MozUpdater/bgupdate/ dir
+  //  - copy updater into updates/0/MozUpdater/bgupdate/ dir on all platforms
+  //    except Windows
   //  - run updater with the correct arguments
-
+#ifndef XP_WIN
   nsCOMPtr<nsIFile> mozUpdaterDir;
   rv = updateDir->Clone(getter_AddRefs(mozUpdaterDir));
   if (NS_FAILED(rv)) {
     LOG(("failed cloning update dir\n"));
     return;
   }
 
   // Create a new directory named MozUpdater in the updates/0 directory to copy
@@ -449,16 +450,17 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIF
   mozUpdaterDir->Append(NS_LITERAL_STRING("bgupdate"));
   mozUpdaterDir->CreateUnique(nsIFile::DIRECTORY_TYPE, 0755);
 
   nsCOMPtr<nsIFile> updater;
   if (!CopyUpdaterIntoUpdateDir(greDir, appDir, mozUpdaterDir, updater)) {
     LOG(("failed copying updater\n"));
     return;
   }
+#endif
 
   // We need to use the value returned from XRE_GetBinaryPath when attempting
   // to restart the running application.
   nsCOMPtr<nsIFile> appFile;
 
 #if defined(XP_MACOSX)
   // On OS X we need to pass the location of the xulrunner-stub executable
   // rather than xulrunner-bin. See bug 349737.
@@ -468,25 +470,38 @@ SwitchToUpdatedApp(nsIFile *greDir, nsIF
 #endif
 
   if (!appFile)
     return;
 
 #ifdef XP_WIN
   nsAutoString appFilePathW;
   rv = appFile->GetPath(appFilePathW);
-  if (NS_FAILED(rv))
+  if (NS_FAILED(rv)) {
     return;
+  }
   NS_ConvertUTF16toUTF8 appFilePath(appFilePathW);
 
+  nsCOMPtr<nsIFile> updater;
+  rv = greDir->Clone(getter_AddRefs(updater));
+  if (NS_FAILED(rv)) {
+    return;
+  }
+
+  nsDependentCString leaf(kUpdaterBin);
+  rv = updater->AppendNative(leaf);
+  if (NS_FAILED(rv)) {
+    return;
+  }
+
   nsAutoString updaterPathW;
   rv = updater->GetPath(updaterPathW);
-  if (NS_FAILED(rv))
+  if (NS_FAILED(rv)) {
     return;
-
+  }
   NS_ConvertUTF16toUTF8 updaterPath(updaterPathW);
 #else
 
   nsAutoCString appFilePath;
 #if defined(MOZ_WIDGET_GONK)
   appFilePath.Assign(kB2GServiceArgv[0]);
   appArgc = kB2GServiceArgc;
   appArgv = const_cast<char**>(kB2GServiceArgv);
@@ -700,24 +715,25 @@ ApplyUpdate(nsIFile *greDir, nsIFile *up
             nsIFile *appDir, int appArgc, char **appArgv,
             bool restart, bool isOSUpdate, nsIFile *osApplyToDir,
             ProcessType *outpid)
 {
   nsresult rv;
 
   // Steps:
   //  - mark update as 'applying'
-  //  - copy updater into update dir
+  //  - copy updater into update dir on all platforms except Windows
   //  - run updater w/ appDir as the current working dir
-
+#ifndef XP_WIN
   nsCOMPtr<nsIFile> updater;
   if (!CopyUpdaterIntoUpdateDir(greDir, appDir, updateDir, updater)) {
     LOG(("failed copying updater\n"));
     return;
   }
+#endif
 
   // We need to use the value returned from XRE_GetBinaryPath when attempting
   // to restart the running application.
   nsCOMPtr<nsIFile> appFile;
 
 #if defined(XP_MACOSX)
   // On OS X we need to pass the location of the xulrunner-stub executable
   // rather than xulrunner-bin. See bug 349737.
@@ -727,27 +743,39 @@ ApplyUpdate(nsIFile *greDir, nsIFile *up
 #endif
 
   if (!appFile)
     return;
 
 #ifdef XP_WIN
   nsAutoString appFilePathW;
   rv = appFile->GetPath(appFilePathW);
-  if (NS_FAILED(rv))
+  if (NS_FAILED(rv)) {
     return;
+  }
   NS_ConvertUTF16toUTF8 appFilePath(appFilePathW);
 
+  nsCOMPtr<nsIFile> updater;
+  rv = greDir->Clone(getter_AddRefs(updater));
+  if (NS_FAILED(rv)) {
+    return;
+  }
+
+  nsDependentCString leaf(kUpdaterBin);
+  rv = updater->AppendNative(leaf);
+  if (NS_FAILED(rv)) {
+    return;
+  }
+
   nsAutoString updaterPathW;
   rv = updater->GetPath(updaterPathW);
-  if (NS_FAILED(rv))
+  if (NS_FAILED(rv)) {
     return;
-
+  }
   NS_ConvertUTF16toUTF8 updaterPath(updaterPathW);
-
 #else
   nsAutoCString appFilePath;
   rv = appFile->GetNativePath(appFilePath);
   if (NS_FAILED(rv))
     return;
   
   nsAutoCString updaterPath;
   rv = updater->GetNativePath(updaterPath);