Merge mozilla-central and mozilla-inbound
authorEhsan Akhgari <ehsan@mozilla.com>
Wed, 21 Sep 2011 13:13:10 -0400
changeset 77276 f4ec1c8b2567a50a043798feeb5e3af2ddeee4e2
parent 77251 4ea7e20806667913ab2fc941b4d0605c53c263c2 (current diff)
parent 77275 f10597ebc79eeb1e6d5cf5f2d89d1d364cb654a3 (diff)
child 77277 16c9cfa0cf8401400e1f9acc9a42964b601c1261
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
milestone9.0a1
Merge mozilla-central and mozilla-inbound
--- a/browser/base/content/test/Makefile.in
+++ b/browser/base/content/test/Makefile.in
@@ -48,16 +48,18 @@ DIRS += \
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = \
 		test_feed_discovery.html \
 		feed_discovery.html \
 		test_bug395533.html \
 		bug395533-data.txt \
+		test_contextmenu.html \
+		subtst_contextmenu.html \
 		ctxmenu-image.png \
 		video.ogg \
 		test_offlineNotification.html \
 		offlineChild.html \
 		offlineChild.cacheManifest \
 		offlineChild.cacheManifest^headers^ \
 		offlineChild2.html \
 		offlineChild2.cacheManifest \
@@ -70,26 +72,16 @@ include $(topsrcdir)/config/rules.mk
 		bug364677-data.xml^headers^ \
 		test_offline_gzip.html \
 		gZipOfflineChild.html \
 		gZipOfflineChild.html^headers^ \
 		gZipOfflineChild.cacheManifest \
 		gZipOfflineChild.cacheManifest^headers^ \
 		$(NULL)
 
-ifeq (,$(filter gtk2,$(MOZ_WIDGET_TOOLKIT)))
-_TEST_FILES += \
-		test_contextmenu.html \
-		subtst_contextmenu.html \
-		$(NULL)
-
-else
-$(warning test_contextmenu.html disabled because of intermittent failures; bug 513558)
-endif
-
 # The following tests are disabled because they are unreliable:
 #   browser_bug423833.js is bug 428712
 #   browser_sanitize-download-history.js is bug 432425
 #
 # browser_sanitizeDialog_treeView.js is disabled until the tree view is added
 # back to the clear recent history dialog (santize.xul), if it ever is (bug
 # 480169)
 
--- a/browser/base/content/test/browser_sanitizeDialog.js
+++ b/browser/base/content/test/browser_sanitizeDialog.js
@@ -733,25 +733,30 @@ function blankSlate() {
  *       this is a problem only across different connections.
  */
 function waitForAsyncUpdates(aCallback, aScope, aArguments)
 {
   let scope = aScope || this;
   let args = aArguments || [];
   let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
                               .DBConnection;
-  db.createAsyncStatement("BEGIN EXCLUSIVE").executeAsync();
-  db.createAsyncStatement("COMMIT").executeAsync({
+  let begin = db.createAsyncStatement("BEGIN EXCLUSIVE");
+  begin.executeAsync();
+  begin.finalize();
+
+  let commit = db.createAsyncStatement("COMMIT");
+  commit.executeAsync({
     handleResult: function() {},
     handleError: function() {},
     handleCompletion: function(aReason)
     {
       aCallback.apply(scope, args);
     }
   });
+  commit.finalize();
 }
 
 /**
  * Ensures that the given pref is the expected value.
  *
  * @param aPrefName
  *        The pref's sub-branch under the privacy branch
  * @param aExpectedVal
--- a/browser/base/content/test/browser_sanitizeDialog_treeView.js
+++ b/browser/base/content/test/browser_sanitizeDialog_treeView.js
@@ -537,25 +537,30 @@ function blankSlate() {
  *       this is a problem only across different connections.
  */
 function waitForAsyncUpdates(aCallback, aScope, aArguments)
 {
   let scope = aScope || this;
   let args = aArguments || [];
   let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
                               .DBConnection;
-  db.createAsyncStatement("BEGIN EXCLUSIVE").executeAsync();
-  db.createAsyncStatement("COMMIT").executeAsync({
+  let begin = db.createAsyncStatement("BEGIN EXCLUSIVE");
+  begin.executeAsync();
+  begin.finalize();
+
+  let commit = db.createAsyncStatement("COMMIT");
+  commit.executeAsync({
     handleResult: function() {},
     handleError: function() {},
     handleCompletion: function(aReason)
     {
       aCallback.apply(scope, args);
     }
   });
+  commit.finalize();
 }
 
 /**
  * Checks to see if the download with the specified ID exists.
  *
  * @param  aID
  *         The ID of the download to check
  * @return True if the download exists, false otherwise
--- a/browser/components/places/tests/browser/head.js
+++ b/browser/components/places/tests/browser/head.js
@@ -62,18 +62,23 @@ function waitForClearHistory(aCallback) 
  *       this is a problem only across different connections.
  */
 function waitForAsyncUpdates(aCallback, aScope, aArguments)
 {
   let scope = aScope || this;
   let args = aArguments || [];
   let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
                               .DBConnection;
-  db.createAsyncStatement("BEGIN EXCLUSIVE").executeAsync();
-  db.createAsyncStatement("COMMIT").executeAsync({
+  let begin = db.createAsyncStatement("BEGIN EXCLUSIVE");
+  begin.executeAsync();
+  begin.finalize();
+
+  let commit = db.createAsyncStatement("COMMIT");
+  commit.executeAsync({
     handleResult: function() {},
     handleError: function() {},
     handleCompletion: function(aReason)
     {
       aCallback.apply(scope, args);
     }
   });
+  commit.finalize();
 }
--- a/browser/components/places/tests/unit/test_clearHistory_shutdown.js
+++ b/browser/components/places/tests/unit/test_clearHistory_shutdown.js
@@ -47,17 +47,16 @@ const URIS = [
 , "http://c.example3.com/"
 ];
 
 const TOPIC_CONNECTION_CLOSED = "places-connection-closed";
 
 let EXPECTED_NOTIFICATIONS = [
   "places-shutdown"
 , "places-will-close-connection"
-, "places-connection-closing"
 , "places-expiration-finished"
 , "places-connection-closed"
 ];
 
 const UNEXPECTED_NOTIFICATIONS = [
   "xpcom-shutdown"
 ];
 
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -1402,19 +1402,20 @@ ifneq ($(PREF_JS_EXPORTS),)
 ifeq (WINNT,$(OS_ARCH))
 PREF_PPFLAGS = --line-endings=crlf
 endif
 
 ifndef NO_DIST_INSTALL
 $(FINAL_TARGET)/$(PREF_DIR):
 	$(NSINSTALL) -D $@
 
-libs:: $(FINAL_TARGET)/$(PREF_DIR) $(PREF_JS_EXPORTS)
+libs:: $(FINAL_TARGET)/$(PREF_DIR)
+libs:: $(PREF_JS_EXPORTS)
 	$(EXIT_ON_ERROR)  \
-	for i in $(PREF_JS_EXPORTS); do \
+	for i in $^; do \
 	  dest=$(FINAL_TARGET)/$(PREF_DIR)/`basename $$i`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
 	done
 endif
 endif
 
 ################################################################################
@@ -1647,36 +1648,37 @@ ifndef NO_DIST_INSTALL
 	  $(JAR_MANIFEST)
 endif
 endif
 
 ifneq ($(DIST_FILES),)
 $(DIST)/bin:
 	$(NSINSTALL) -D $@
 
-libs:: $(DIST_FILES) $(DIST)/bin
+libs:: $(DIST)/bin
+libs:: $(DIST_FILES)
 	@$(EXIT_ON_ERROR) \
-	for f in $(DIST_FILES); do \
+	for f in $^; do \
 	  dest=$(FINAL_TARGET)/`basename $$f`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
 	    $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
-	    $(srcdir)/$$f > $$dest; \
+	    $$f > $$dest; \
 	done
 endif
 
 ifneq ($(DIST_CHROME_FILES),)
 libs:: $(DIST_CHROME_FILES)
 	@$(EXIT_ON_ERROR) \
-	for f in $(DIST_CHROME_FILES); do \
+	for f in $^; do \
 	  dest=$(FINAL_TARGET)/chrome/`basename $$f`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
 	    $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
-	    $(srcdir)/$$f > $$dest; \
+	    $$f > $$dest; \
 	done
 endif
 
 ifneq ($(XPI_PKGNAME),)
 libs realchrome::
 ifdef STRIP_XPI
 ifndef MOZ_DEBUG
 	@echo "Stripping $(XPI_PKGNAME) package directory..."
--- a/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
+++ b/gfx/cairo/libpixman/src/pixman-arm-neon-asm-bilinear.S
@@ -61,16 +61,17 @@
 .text
 .fpu neon
 .arch armv7a
 .object_arch armv4
 .eabi_attribute 10, 0
 .eabi_attribute 12, 0
 .arm
 .altmacro
+.p2align 2
 
 #include "pixman-arm-neon-asm.h"
 
 /*
  * Bilinear macros from pixman-arm-neon-asm.S
  */
 
 /* Supplementary macro for setting function attributes */
--- a/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
+++ b/gfx/cairo/libpixman/src/pixman-arm-neon-asm.S
@@ -42,16 +42,17 @@
     .text
     .fpu neon
     .arch armv7a
     .object_arch armv4
     .eabi_attribute 10, 0 /* suppress Tag_FP_arch */
     .eabi_attribute 12, 0 /* suppress Tag_Advanced_SIMD_arch */
     .arm
     .altmacro
+    .p2align 2
 
 #include "pixman-arm-neon-asm.h"
 
 /* Global configuration options and preferences */
 
 /*
  * The code can optionally make use of unaligned memory accesses to improve
  * performance of handling leading/trailing pixels for each scanline.
--- a/gfx/cairo/libpixman/src/pixman-arm-simd-asm.S
+++ b/gfx/cairo/libpixman/src/pixman-arm-simd-asm.S
@@ -30,16 +30,17 @@
 .section .note.GNU-stack,"",%progbits
 #endif
 
 	.text
 	.arch armv6
 	.object_arch armv4
 	.arm
 	.altmacro
+	.p2align 2
 
 /* Supplementary macro for setting function attributes */
 .macro pixman_asm_function fname
 	.func fname
 	.global fname
 #ifdef __ELF__
 	.hidden fname
 	.type fname, %function
--- a/js/src/config/rules.mk
+++ b/js/src/config/rules.mk
@@ -1402,19 +1402,20 @@ ifneq ($(PREF_JS_EXPORTS),)
 ifeq (WINNT,$(OS_ARCH))
 PREF_PPFLAGS = --line-endings=crlf
 endif
 
 ifndef NO_DIST_INSTALL
 $(FINAL_TARGET)/$(PREF_DIR):
 	$(NSINSTALL) -D $@
 
-libs:: $(FINAL_TARGET)/$(PREF_DIR) $(PREF_JS_EXPORTS)
+libs:: $(FINAL_TARGET)/$(PREF_DIR)
+libs:: $(PREF_JS_EXPORTS)
 	$(EXIT_ON_ERROR)  \
-	for i in $(PREF_JS_EXPORTS); do \
+	for i in $^; do \
 	  dest=$(FINAL_TARGET)/$(PREF_DIR)/`basename $$i`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(PREF_PPFLAGS) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) $$i > $$dest; \
 	done
 endif
 endif
 
 ################################################################################
@@ -1647,36 +1648,37 @@ ifndef NO_DIST_INSTALL
 	  $(JAR_MANIFEST)
 endif
 endif
 
 ifneq ($(DIST_FILES),)
 $(DIST)/bin:
 	$(NSINSTALL) -D $@
 
-libs:: $(DIST_FILES) $(DIST)/bin
+libs:: $(DIST)/bin
+libs:: $(DIST_FILES)
 	@$(EXIT_ON_ERROR) \
-	for f in $(DIST_FILES); do \
+	for f in $^; do \
 	  dest=$(FINAL_TARGET)/`basename $$f`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
 	    $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
-	    $(srcdir)/$$f > $$dest; \
+	    $$f > $$dest; \
 	done
 endif
 
 ifneq ($(DIST_CHROME_FILES),)
 libs:: $(DIST_CHROME_FILES)
 	@$(EXIT_ON_ERROR) \
-	for f in $(DIST_CHROME_FILES); do \
+	for f in $^; do \
 	  dest=$(FINAL_TARGET)/chrome/`basename $$f`; \
 	  $(RM) -f $$dest; \
 	  $(PYTHON) $(MOZILLA_DIR)/config/Preprocessor.py \
 	    $(XULAPP_DEFINES) $(DEFINES) $(ACDEFINES) $(XULPPFLAGS) \
-	    $(srcdir)/$$f > $$dest; \
+	    $$f > $$dest; \
 	done
 endif
 
 ifneq ($(XPI_PKGNAME),)
 libs realchrome::
 ifdef STRIP_XPI
 ifndef MOZ_DEBUG
 	@echo "Stripping $(XPI_PKGNAME) package directory..."
--- a/js/src/yarr/pcre/pcre_exec.cpp
+++ b/js/src/yarr/pcre/pcre_exec.cpp
@@ -40,17 +40,16 @@ POSSIBILITY OF SUCH DAMAGE.
 
 /* This module contains jsRegExpExecute(), the externally visible function
 that does pattern matching using an NFA algorithm, following the rules from
 the JavaScript specification. There are also some supporting functions. */
 
 #include "pcre_internal.h"
 
 #include <limits.h>
-#include "yarr/jswtfbridge.h"
 #include "yarr/ASCIICType.h"
 #include "jsarena.h"
 #include "jscntxt.h"
 
 using namespace WTF;
 
 #if !WTF_COMPILER_MSVC && !WTF_COMPILER_SUNPRO
 #define USE_COMPUTED_GOTO_FOR_MATCH_RECURSION
--- a/layout/reftests/svg/dynamic-clipPath-02.svg
+++ b/layout/reftests/svg/dynamic-clipPath-02.svg
@@ -24,14 +24,14 @@
     function startTest() {
       document.addEventListener("MozReftestInvalidate", doTest, false);
       // in case we're not gecko
       setTimeout(doTest, 5000);
     }
 
     function doTest() {
       var clip1 = document.getElementById("clip1");
-      clip1.setAttribute("clipPathUnits", "userSpaceOnUse");
+      clip1.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
 
       document.documentElement.removeAttribute("class");
     }
   </script>
 </svg>
--- a/layout/reftests/svg/dynamic-marker-03.svg
+++ b/layout/reftests/svg/dynamic-marker-03.svg
@@ -1,9 +1,8 @@
-<?xml version="1.0" encoding="Windows-1252"?>
 <!--
      Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <svg xmlns="http://www.w3.org/2000/svg" class="reftest-wait"
   onload="startTest()">
 
   <title>Testing that dynamic changes to preserveAspectRatio are reflected in the marker</title>
--- a/layout/reftests/svg/dynamic-mask-01.svg
+++ b/layout/reftests/svg/dynamic-mask-01.svg
@@ -1,38 +1,49 @@
-<?xml version="1.0" encoding="Windows-1252"?>
 <!--
      Any copyright is dedicated to the Public Domain.
      http://creativecommons.org/publicdomain/zero/1.0/
 -->
 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
      class="reftest-wait"
      onload="startTest()"
      xmlns:xlink="http://www.w3.org/1999/xlink">
   <title>Testing that dynamic changes to mask attributes are reflected in the mask</title>
 
   <defs>
     <mask id="mask1" width="1" height="1">
       <rect width="1" height="1" fill="white"/>
     </mask>
+    <mask id="mask2" width="1" height="1">
+      <rect width="1" height="1" fill="white"/>
+    </mask>
+    <mask id="mask3" width="1" height="1">
+      <rect width="1" height="1" fill="white"/>
+    </mask>
   </defs>
 
   <rect width="100%" height="100%" fill="lime"/>
 
   <g transform="scale(500)">
     <rect x=".2" y=".2" width=".2" height=".2" fill="red" mask="url(#mask1)"/>
+    <rect x=".4" y=".2" width=".2" height=".2" fill="red" mask="url(#mask2)"/>
+    <rect x=".2" y=".4" width=".2" height=".2" fill="red" mask="url(#mask3)" />
   </g>
 
   <script>
     function startTest() {
       document.addEventListener("MozReftestInvalidate", doTest, false);
       // in case we're not gecko
       setTimeout(doTest, 5000);
     }
 
     function doTest() {
       var mask1 = document.getElementById("mask1");
-      mask1.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
+      mask1.width.baseVal.value = 0;
+      var mask2 = document.getElementById("mask2");
+      mask2.height.baseVal.value = 0;
+      var mask3 = document.getElementById("mask3");
+      mask3.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE;
 
       document.documentElement.removeAttribute("class");
     }
   </script>
 </svg>
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -139,18 +139,17 @@ fails == inline-in-xul-basic-01.xul pass
 == invalid-text-01.svg pass.svg
 == linearGradient-basic-01.svg pass.svg
 == linearGradient-basic-02.svg pass.svg
 == markers-and-group-opacity-01.svg markers-and-group-opacity-01-ref.svg
 == marker-attribute-01.svg pass.svg
 == marker-viewBox-01.svg marker-viewBox-01-ref.svg
 == mask-basic-01.svg pass.svg
 == mask-containing-masked-content-01.svg pass.svg
-# Bug 456323
-# == mask-transformed-01.svg mask-transformed-01-ref.svg
+== mask-transformed-01.svg mask-transformed-01-ref.svg
 == nested-viewBox-01.svg pass.svg
 == nesting-invalid-01.svg nesting-invalid-01-ref.svg
 == objectBoundingBox-and-clipPath.svg pass.svg
 # Bug 588684
 random-if(gtk2Widget) == objectBoundingBox-and-fePointLight-01.svg objectBoundingBox-and-fePointLight-01-ref.svg
 random-if(gtk2Widget) == objectBoundingBox-and-fePointLight-02.svg objectBoundingBox-and-fePointLight-02-ref.svg
 == objectBoundingBox-and-mask.svg pass.svg
 == objectBoundingBox-and-mask-02.svg pass.svg
--- a/layout/svg/base/src/nsSVGMaskFrame.cpp
+++ b/layout/svg/base/src/nsSVGMaskFrame.cpp
@@ -76,23 +76,23 @@ nsSVGMaskFrame::ComputeMaskAlpha(nsSVGRe
     mask->mEnumAttributes[nsSVGMaskElement::MASKUNITS].GetAnimValue();
   gfxRect bbox;
   if (units == nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
     bbox = nsSVGUtils::GetBBox(aParent);
   }
 
   gfxRect maskArea = nsSVGUtils::GetRelativeRect(units,
     &mask->mLengthAttributes[nsSVGMaskElement::X], bbox, aParent);
-  maskArea.RoundOut();
 
   gfxContext *gfx = aContext->GetGfxContext();
 
   gfx->Save();
   nsSVGUtils::SetClipRect(gfx, aMatrix, maskArea);
   gfxRect clipExtents = gfx->GetClipExtents();
+  clipExtents.RoundOut();
   gfx->Restore();
 
 #ifdef DEBUG_tor
   fprintf(stderr, "clip extent: %f,%f %fx%f\n",
           clipExtents.X(), clipExtents.Y(),
           clipExtents.Width(), clipExtents.Height());
 #endif
 
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -470,22 +470,16 @@ var BrowserUI = {
       Elements.tabs.addEventListener("TabOpen", BrowserUI, true);
       Elements.tabs.addEventListener("TabRemove", BrowserUI, true);
 
       // Init the tool panel views
       ExtensionsView.init();
       DownloadsView.init();
       ConsoleView.init();
 
-      if (Services.prefs.getBoolPref("browser.tabs.remote")) {
-          // Pre-start the content process
-          Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime)
-                                           .ensureContentProcess();
-      }
-
 #ifdef MOZ_SERVICES_SYNC
       // Init the sync system
       WeaveGlue.init();
 #endif
 
       Services.prefs.addObserver("browser.ui.layout.tablet", BrowserUI, false);
       Services.obs.addObserver(BrowserSearch, "browser-search-engine-modified", false);
       messageManager.addMessageListener("Browser:MozApplicationManifest", OfflineApps);
--- a/netwerk/base/src/nsIOService.cpp
+++ b/netwerk/base/src/nsIOService.cpp
@@ -229,17 +229,17 @@ nsIOService::Init()
     }
     
     // Register for profile change notifications
     nsCOMPtr<nsIObserverService> observerService =
         mozilla::services::GetObserverService();
     if (observerService) {
         observerService->AddObserver(this, kProfileChangeNetTeardownTopic, PR_TRUE);
         observerService->AddObserver(this, kProfileChangeNetRestoreTopic, PR_TRUE);
-        observerService->AddObserver(this, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID, PR_TRUE);
+        observerService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, PR_TRUE);
         observerService->AddObserver(this, NS_NETWORK_LINK_TOPIC, PR_TRUE);
     }
     else
         NS_WARNING("failed to get observer service");
         
     NS_TIME_FUNCTION_MARK("Registered observers");
 
     // Get the allocator ready
@@ -964,17 +964,17 @@ nsIOService::Observe(nsISupports *subjec
         if (mOfflineForProfileChange) {
             mOfflineForProfileChange = PR_FALSE;
             if (!mManageOfflineStatus ||
                 NS_FAILED(TrackNetworkLinkStatusForOffline())) {
                 SetOffline(PR_FALSE);
             }
         } 
     }
-    else if (!strcmp(topic, NS_XPCOM_WILL_SHUTDOWN_OBSERVER_ID)) {
+    else if (!strcmp(topic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
         // Remember we passed XPCOM shutdown notification to prevent any
         // changes of the offline status from now. We must not allow going
         // online after this point.
         mShutdown = PR_TRUE;
 
         SetOffline(PR_TRUE);
 
         // Break circular reference.
--- a/other-licenses/android/APKOpen.cpp
+++ b/other-licenses/android/APKOpen.cpp
@@ -427,17 +427,17 @@ static void * mozload(const char * path,
 
   struct cdir_entry *entry = find_cdir_entry(cdir_start, cdir_entries, path);
   struct local_file_header *file = (struct local_file_header *)((char *)zip + letoh32(entry->offset));
   void * data = ((char *)&file->data) + letoh16(file->filename_size) + letoh16(file->extra_field_size);
   void * handle;
 
   if (extractLibs) {
     char fullpath[PATH_MAX];
-    snprintf(fullpath, PATH_MAX, "%s/%s", getenv("CACHE_PATH"), path + 4);
+    snprintf(fullpath, PATH_MAX, "%s/%s", getenv("CACHE_PATH"), path);
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "resolved %s to %s", path, fullpath);
     extractFile(fullpath, entry, data);
     handle = __wrap_dlopen(fullpath, RTLD_LAZY);
     if (!handle)
       __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't load %s because %s", fullpath, __wrap_dlerror());
 #ifdef DEBUG
     gettimeofday(&t1, 0);
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "%s: spent %d", path,
@@ -451,43 +451,43 @@ static void * mozload(const char * path,
 
   size_t offset = letoh32(entry->offset) + sizeof(*file) + letoh16(file->filename_size) + letoh16(file->extra_field_size);
   bool skipLibCache = false;
   int fd = zip_fd;
   void * buf = NULL;
   uint32_t lib_size = letoh32(entry->uncompressed_size);
   int cache_fd = 0;
   if (letoh16(file->compression) == DEFLATE) {
-    cache_fd = lookupLibCacheFd(path + 4);
+    cache_fd = lookupLibCacheFd(path);
     fd = cache_fd;
     if (fd < 0) {
       char fullpath[PATH_MAX];
-      snprintf(fullpath, PATH_MAX, "%s/%s", getenv("CACHE_PATH"), path + 4);
+      snprintf(fullpath, PATH_MAX, "%s/%s", getenv("CACHE_PATH"), path);
       fd = open(fullpath, O_RDWR);
       struct stat status;
       if (stat(fullpath, &status) ||
           status.st_size != lib_size ||
           apk_mtime > status.st_mtime) {
         unlink(fullpath);
         fd = -1;
       } else {
         cache_fd = fd;
-        addLibCacheFd(path + 4, fd);
+        addLibCacheFd(path, fd);
       }
     }
     if (fd < 0)
       fd = createAshmem(lib_size, path);
 #ifdef DEBUG
     else
-      __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Loading %s from cache", path + 4);
+      __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Loading %s from cache", path);
 #endif
     if (fd < 0) {
       __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't open " ASHMEM_NAME_DEF ", Error %d, %s, using a file", errno, strerror(errno));
       char fullpath[PATH_MAX];
-      snprintf(fullpath, PATH_MAX, "%s/%s", getenv("CACHE_PATH"), path + 4);
+      snprintf(fullpath, PATH_MAX, "%s/%s", getenv("CACHE_PATH"), path);
       fd = open(fullpath, O_RDWR | O_CREAT);
       if (fd < 0) {
         __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't create a file either, giving up");
         return NULL;
       }
       // we'd like to use fallocate here, but it doesn't exist currently?
       if (lseek(fd, lib_size - 1, SEEK_SET) == (off_t) - 1) {
          __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "seeking file failed");
@@ -495,37 +495,37 @@ static void * mozload(const char * path,
         return NULL;
       }
       if (write(fd, "", 1) != 1) {
         __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "writting one byte to the file failed");
         close(fd);
         return NULL;
       }
       skipLibCache = true;
-      addLibCacheFd(path + 4, fd);
+      addLibCacheFd(path, fd);
     }
     buf = mmap(NULL, lib_size,
                PROT_READ | PROT_WRITE,
                MAP_SHARED, fd, 0);
     if (buf == (void *)-1) {
       __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't mmap decompression buffer");
       close(fd);
       return NULL;
     }
 
     offset = 0;
 
     if (cache_fd < 0) {
       extractLib(entry, data, buf);
       if (!skipLibCache)
-        addLibCacheFd(path + 4, fd, lib_size, buf);
+        addLibCacheFd(path, fd, lib_size, buf);
     }
 
     // preload libxul, to avoid slowly demand-paging it
-    if (!strcmp(path, "lib/libxul.so"))
+    if (!strcmp(path, "libxul.so"))
       madvise(buf, entry->uncompressed_size, MADV_WILLNEED);
     data = buf;
   }
 
 #ifdef DEBUG
   __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Loading %s with len %d (0x%08x) and offset %d (0x%08x)", path, lib_size, lib_size, offset, offset);
 #endif
 
@@ -624,17 +624,17 @@ loadLibs(const char *apkName)
 
   struct cdir_entry *cdir_start = (struct cdir_entry *)((char *)zip + cdir_offset);
 
   lib_mapping = (struct mapping_info *)calloc(MAX_MAPPING_INFO, sizeof(*lib_mapping));
 #ifdef MOZ_CRASHREPORTER
   file_ids = (char *)extractBuf("lib.id", zip, cdir_start, cdir_entries);
 #endif
 
-#define MOZLOAD(name) mozload("lib/lib" name ".so", zip, cdir_start, cdir_entries)
+#define MOZLOAD(name) mozload("lib" name ".so", zip, cdir_start, cdir_entries)
   MOZLOAD("mozalloc");
   MOZLOAD("nspr4");
   MOZLOAD("plc4");
   MOZLOAD("plds4");
   MOZLOAD("mozsqlite3");
   MOZLOAD("nssutil3");
   MOZLOAD("nss3");
   MOZLOAD("ssl3");
--- a/services/sync/tests/unit/test_history_store.js
+++ b/services/sync/tests/unit/test_history_store.js
@@ -163,16 +163,17 @@ add_test(function test_null_title() {
 
 add_test(function test_invalid_records() {
   _("Make sure we handle invalid URLs in places databases gracefully.");
   let query = "INSERT INTO moz_places "
     + "(url, title, rev_host, visit_count, last_visit_date) "
     + "VALUES ('invalid-uri', 'Invalid URI', '.', 1, " + TIMESTAMP3 + ")";
   let stmt = PlacesUtils.history.DBConnection.createAsyncStatement(query);
   let result = Async.querySpinningly(stmt);
+  stmt.finalize();
   do_check_attribute_count(store.getAllIDs(), 4);
 
   _("Make sure we report records with invalid URIs.");
   let invalid_uri_guid = Utils.makeGUID();
   let failed = store.applyIncomingBatch([{
     id: invalid_uri_guid,
     histUri: ":::::::::::::::",
     title: "Doesn't have a valid URI",
--- a/services/sync/tests/unit/test_places_guid_downgrade.js
+++ b/services/sync/tests/unit/test_places_guid_downgrade.js
@@ -106,28 +106,30 @@ function test_history_guids() {
 
   stmt.params.guid = fxguid;
   let result = Async.querySpinningly(stmt, ["id"]);
   do_check_eq(result.length, 1);
 
   stmt.params.guid = tbguid;
   result = Async.querySpinningly(stmt, ["id"]);
   do_check_eq(result.length, 1);
+  stmt.finalize();
 
   _("History: Verify GUIDs weren't added to annotations.");
   stmt = PlacesUtils.history.DBConnection.createAsyncStatement(
     "SELECT a.content AS guid FROM moz_annos a WHERE guid = :guid");
 
   stmt.params.guid = fxguid;
   result = Async.querySpinningly(stmt, ["guid"]);
   do_check_eq(result.length, 0);
 
   stmt.params.guid = tbguid;
   result = Async.querySpinningly(stmt, ["guid"]);
   do_check_eq(result.length, 0);
+  stmt.finalize();
 }
 
 function test_bookmark_guids() {
   let engine = new BookmarksEngine();
   let store = engine._store;
 
   let fxid = PlacesUtils.bookmarks.insertBookmark(
     PlacesUtils.bookmarks.toolbarFolder,
@@ -151,28 +153,30 @@ function test_bookmark_guids() {
   let result = Async.querySpinningly(stmt, ["id"]);
   do_check_eq(result.length, 1);
   do_check_eq(result[0].id, fxid);
 
   stmt.params.guid = tbguid;
   result = Async.querySpinningly(stmt, ["id"]);
   do_check_eq(result.length, 1);
   do_check_eq(result[0].id, tbid);
+  stmt.finalize();
 
   _("Bookmarks: Verify GUIDs weren't added to annotations.");
   stmt = PlacesUtils.history.DBConnection.createAsyncStatement(
     "SELECT a.content AS guid FROM moz_items_annos a WHERE guid = :guid");
 
   stmt.params.guid = fxguid;
   result = Async.querySpinningly(stmt, ["guid"]);
   do_check_eq(result.length, 0);
 
   stmt.params.guid = tbguid;
   result = Async.querySpinningly(stmt, ["guid"]);
   do_check_eq(result.length, 0);
+  stmt.finalize();
 }
 
 function run_test() {
   setPlacesDatabase("places_v10_from_v11.sqlite");
 
   _("Verify initial setup: v11 database is available");
   test_initial_state();
   test_history_guids();
--- a/toolkit/components/alerts/test/test_alerts.html
+++ b/toolkit/components/alerts/test/test_alerts.html
@@ -17,61 +17,58 @@
 <br>If so, the test will finish once the notification disappears.
 
 <pre id="test">
 <script class="testbody" type="text/javascript">
 netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
 
 var observer = {
   observe: function (aSubject, aTopic, aData) {
-    if (aTopic == "alertclickcallback")
+    if (aTopic == "alertclickcallback") { 
       todo(false, "Did someone click the notification while running mochitests? (Please don't.)");
-    else
+    } else {
       is(aTopic, "alertfinished", "Checking the topic for a finished notification");
+    }
     is(aData, "foobarcookie", "Checking whether the alert cookie was passed correctly");
-
-    // finish(), yet let the test actually end first, to be safe.
-    SimpleTest.executeSoon(SimpleTest.finish);
+    SimpleTest.finish();
   }
 };
 
-const Cc = Components.classes;
-const Ci = Components.interfaces;
+function runTest() {
+  const Cc = Components.classes;
+  const Ci = Components.interfaces;
 
-var gNotificationIsAvailable;
+  if (!("@mozilla.org/alerts-service;1" in Cc)) {
+    todo(false, "Alerts service does not exist in this application");
+    return;
+  }
 
-if (!("@mozilla.org/alerts-service;1" in Cc)) {
-  todo(false, "Alerts service does not exist in this application");
-} else {
   ok(true, "Alerts service exists in this application");
 
   var notifier;
   try {
     notifier = Cc["@mozilla.org/alerts-service;1"].
                getService(Ci.nsIAlertsService);
     ok(true, "Alerts service is available");
   } catch (ex) {
-    todo(false, "Alerts service is not available. (Mac OS X without Growl?)", ex);
+    todo(false, 
+         "Alerts service is not available. (Mac OS X without Growl?)", ex);
+    return;
   }
 
-  if (notifier) {
-    try {
-      notifier.showAlertNotification(null, "Notification test",
-                                     "Surprise! I'm here to test notifications!",
-                                     false, "foobarcookie", observer);
-      ok(true, "showAlertNotification() succeeded");
-
-      gNotificationIsAvailable = true;
-    } catch (ex) {
-      todo(false, "showAlertNotification() failed. (Mac OS X without Growl?)", ex);
-    }
+  try {
+    SimpleTest.waitForExplicitFinish();
+    notifier.showAlertNotification(null, "Notification test",
+                                   "Surprise! I'm here to test notifications!",
+                                   false, "foobarcookie", observer);
+    ok(true, "showAlertNotification() succeeded.  Waiting for notification...");
+  } catch (ex) {
+    todo(false, "showAlertNotification() failed. (Mac OS X without Growl?)", ex);
+    SimpleTest.finish();
   }
 }
 
-if (gNotificationIsAvailable) {
-  // Wait for the (asynchronous) notification callback.
-  SimpleTest.waitForExplicitFinish();
-  ok(true, "Waiting for notification callback to be triggered...");
-}
+runTest();
+
 </script>
 </pre>
 </body>
 </html>
--- a/toolkit/components/places/nsNavHistory.cpp
+++ b/toolkit/components/places/nsNavHistory.cpp
@@ -5281,22 +5281,17 @@ nsNavHistory::Observe(nsISupports *aSubj
     (void)os->NotifyObservers(nsnull, TOPIC_PLACES_SHUTDOWN, nsnull);
   }
 
   else if (strcmp(aTopic, TOPIC_PROFILE_CHANGE) == 0) {
     // Fire internal shutdown notifications.
     nsCOMPtr<nsIObserverService> os = services::GetObserverService();
     if (os) {
       (void)os->RemoveObserver(this, TOPIC_PROFILE_CHANGE);
-      // Double notification allows to correctly enqueue tasks without the need
-      // to enqueue notification events to the main-thread.  There is no
-      // guarantee that the event loop will spin before xpcom-shutdown indeed,
-      // see bug 580892.
       (void)os->NotifyObservers(nsnull, TOPIC_PLACES_WILL_CLOSE_CONNECTION, nsnull);
-      (void)os->NotifyObservers(nsnull, TOPIC_PLACES_CONNECTION_CLOSING, nsnull);
     }
 
     // Operations that are unlikely to create issues to implementers should go
     // in profile teardown.  Any other thing that must run really late should be
     // here instead.
 
     // Don't even try to notify observers from this point on, the category
     // cache would init services that could try to use our APIs.
--- a/toolkit/components/places/nsNavHistory.h
+++ b/toolkit/components/places/nsNavHistory.h
@@ -104,19 +104,16 @@
 // APIs after this notification.  If you need to listen for Places shutdown
 // you should only use this notification, next ones are intended only for
 // internal Places use.
 #define TOPIC_PLACES_SHUTDOWN "places-shutdown"
 // For Internal use only.  Fired when connection is about to be closed, only
 // cleanup tasks should run at this stage, nothing should be added to the
 // database, nor APIs should be called.
 #define TOPIC_PLACES_WILL_CLOSE_CONNECTION "places-will-close-connection"
-// For Internal use only. Fired as the last notification before the connection
-// is gone.
-#define TOPIC_PLACES_CONNECTION_CLOSING "places-connection-closing"
 // Fired when the connection has gone, nothing will work from now on.
 #define TOPIC_PLACES_CONNECTION_CLOSED "places-connection-closed"
 
 // Fired when Places found a locked database while initing.
 #define TOPIC_DATABASE_LOCKED "places-database-locked"
 // Fired after Places inited.
 #define TOPIC_PLACES_INIT_COMPLETE "places-init-complete"
 
--- a/toolkit/components/places/tests/head_common.js
+++ b/toolkit/components/places/tests/head_common.js
@@ -596,25 +596,30 @@ function is_time_ordered(before, after) 
  *       complete.  Note that WAL makes so that writers don't block readers, but
  *       this is a problem only across different connections.
  */
 function waitForAsyncUpdates(aCallback, aScope, aArguments)
 {
   let scope = aScope || this;
   let args = aArguments || [];
   let db = DBConn();
-  db.createAsyncStatement("BEGIN EXCLUSIVE").executeAsync();
-  db.createAsyncStatement("COMMIT").executeAsync({
+  let begin = db.createAsyncStatement("BEGIN EXCLUSIVE");
+  begin.executeAsync();
+  begin.finalize();
+
+  let commit = db.createAsyncStatement("COMMIT");
+  commit.executeAsync({
     handleResult: function() {},
     handleError: function() {},
     handleCompletion: function(aReason)
     {
       aCallback.apply(scope, args);
     }
   });
+  commit.finalize();
 }
 
 /**
  * Tests if a given guid is valid for use in Places or not.
  *
  * @param aGuid
  *        The guid to test.
  * @param [optional] aStack
--- a/toolkit/crashreporter/client/Makefile.in
+++ b/toolkit/crashreporter/client/Makefile.in
@@ -49,16 +49,20 @@ MODULE = crashreporter
 
 # Don't use the STL wrappers in the crashreporter clients; they don't
 # link with -lmozalloc, and it really doesn't matter here anyway.
 STL_FLAGS =
 
 ifneq ($(OS_TARGET),Android)
 PROGRAM = crashreporter$(BIN_SUFFIX)
 DIST_PROGRAM = crashreporter$(BIN_SUFFIX)
+
+# Don't link the updater against libmozutils.
+MOZ_UTILS_LDFLAGS =
+MOZ_UTILS_PROGRAM_LDFLAGS =
 endif
 
 LOCAL_INCLUDES = -I$(srcdir)/../google-breakpad/src
 
 VPATH += $(topsrcdir)/build/
 
 CPPSRCS = \
   crashreporter.cpp \
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -265,16 +265,30 @@ DIST_FILES = \
   AndroidManifest.xml \
   chrome \
   components \
   defaults \
   modules \
   res \
   lib \
   lib.id \
+  libmozalloc.so \
+  libnspr4.so \
+  libplc4.so \
+  libplds4.so \
+  libmozsqlite3.so \
+  libnssutil3.so \
+  libnss3.so \
+  libssl3.so \
+  libsmime3.so \
+  libxul.so \
+  libxpcom.so \
+  libnssckbi.so \
+  libfreebl3.so \
+  libsoftokn3.so \
   extensions \
   application.ini \
   platform.ini \
   greprefs.js \
   browserconfig.properties \
   blocklist.xml \
   chrome.manifest \
   update.locale \
@@ -299,37 +313,35 @@ endif
 
 PKG_SUFFIX      = .apk
 INNER_MAKE_PACKAGE	= \
   make -C ../embedding/android gecko.ap_ && \
   cp ../embedding/android/gecko.ap_ $(_ABS_DIST) && \
   ( cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && \
     rm -rf lib && \
     mkdir -p lib/$(ABI_DIR) && \
-    cp lib*.so lib && \
-    mv lib/libmozutils.so lib/$(ABI_DIR) && \
+    mv libmozutils.so lib/$(ABI_DIR) && \
     rm -f lib.id && \
-    for SOMELIB in lib/*.so ; \
+    for SOMELIB in *.so ; \
     do \
       printf "`basename $$SOMELIB`:`$(_ABS_DIST)/host/bin/file_id $$SOMELIB`\n" >> lib.id ; \
     done && \
     unzip -o $(_ABS_DIST)/gecko.ap_ && \
     rm $(_ABS_DIST)/gecko.ap_ && \
     $(ZIP) -r9D $(_ABS_DIST)/gecko.ap_ $(DIST_FILES) -x $(NON_DIST_FILES) ) && \
   rm -f $(_ABS_DIST)/gecko.apk && \
   $(APKBUILDER) $(_ABS_DIST)/gecko.apk -v $(APKBUILDER_FLAGS) -z $(_ABS_DIST)/gecko.ap_ -f $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/classes.dex && \
   cp $(_ABS_DIST)/gecko.apk $(_ABS_DIST)/gecko-unsigned-unaligned.apk && \
   $(JARSIGNER) $(_ABS_DIST)/gecko.apk && \
   $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/gecko.apk $(PACKAGE)
 INNER_UNMAKE_PACKAGE	= \
   mkdir $(MOZ_PKG_DIR) && \
   cd $(MOZ_PKG_DIR) && \
   $(UNZIP) $(UNPACKAGE) && \
   mv lib/$(ABI_DIR)/*.so . && \
-  mv lib/*.so . && \
   rm -rf lib
 endif
 ifeq ($(MOZ_PKG_FORMAT),DMG)
 ifndef _APPNAME
 ifdef MOZ_DEBUG
 _APPNAME	= $(MOZ_APP_DISPLAYNAME)Debug.app
 else
 _APPNAME	= $(MOZ_APP_DISPLAYNAME).app
--- a/xpcom/io/nsLocalFileWin.cpp
+++ b/xpcom/io/nsLocalFileWin.cpp
@@ -250,16 +250,20 @@ static nsresult ConvertWinError(DWORD wi
         case ERROR_PATH_NOT_FOUND:
         case ERROR_INVALID_DRIVE:
             rv = NS_ERROR_FILE_NOT_FOUND;
             break;
         case ERROR_ACCESS_DENIED:
         case ERROR_NOT_SAME_DEVICE:
             rv = NS_ERROR_FILE_ACCESS_DENIED;
             break;
+        case ERROR_SHARING_VIOLATION: // CreateFile without sharing flags
+        case ERROR_LOCK_VIOLATION: // LockFile, LockFileEx
+            rv = NS_ERROR_FILE_IS_LOCKED;
+            break;
         case ERROR_NOT_ENOUGH_MEMORY:
         case ERROR_INVALID_BLOCK:
         case ERROR_INVALID_HANDLE:
         case ERROR_ARENA_TRASHED:
             rv = NS_ERROR_OUT_OF_MEMORY;
             break;
         case ERROR_CURRENT_DIRECTORY:
             rv = NS_ERROR_FILE_DIR_NOT_EMPTY;
@@ -797,42 +801,44 @@ nsLocalFile::ResolveAndStat()
 
     // slutty hack designed to work around bug 134796 until it is fixed
     nsAutoString nsprPath(mWorkingPath.get());
     if (mWorkingPath.Length() == 2 && mWorkingPath.CharAt(1) == L':') 
         nsprPath.AppendASCII("\\");
 
     // first we will see if the working path exists. If it doesn't then
     // there is nothing more that can be done
-    if (NS_FAILED(GetFileInfo(nsprPath, &mFileInfo64)))
-        return NS_ERROR_FILE_NOT_FOUND;
+    nsresult rv = GetFileInfo(nsprPath, &mFileInfo64);
+    if (NS_FAILED(rv))
+        return rv;
 
     // if this isn't a shortcut file or we aren't following symlinks then we're done 
     if (!mFollowSymlinks 
         || mFileInfo64.type != PR_FILE_FILE 
         || !IsShortcutPath(mWorkingPath))
     {
         mDirty = PR_FALSE;
         return NS_OK;
     }
 
     // we need to resolve this shortcut to what it points to, this will
     // set mResolvedPath. Even if it fails we need to have the resolved
     // path equal to working path for those functions that always use
     // the resolved path.
-    nsresult rv = ResolveShortcut();
+    rv = ResolveShortcut();
     if (NS_FAILED(rv))
     {
         mResolvedPath.Assign(mWorkingPath);
         return rv;
     }
 
     // get the details of the resolved path
-    if (NS_FAILED(GetFileInfo(mResolvedPath, &mFileInfo64)))
-        return NS_ERROR_FILE_NOT_FOUND;
+    rv = GetFileInfo(mResolvedPath, &mFileInfo64);
+    if (NS_FAILED(rv))
+        return rv;
 
     mDirty = PR_FALSE;
     return NS_OK;
 }
 
 
 //-----------------------------------------------------------------------------
 // nsLocalFile::nsIFile,nsILocalFile
@@ -2212,17 +2218,17 @@ nsLocalFile::Exists(PRBool *_retval)
     // Check we are correctly initialized.
     CHECK_mWorkingPath();
 
     NS_ENSURE_ARG(_retval);
     *_retval = PR_FALSE;
 
     MakeDirty();
     nsresult rv = ResolveAndStat();
-    *_retval = NS_SUCCEEDED(rv);
+    *_retval = NS_SUCCEEDED(rv) || rv == NS_ERROR_FILE_IS_LOCKED;
 
     return NS_OK;
 }
 
 NS_IMETHODIMP
 nsLocalFile::IsWritable(PRBool *aIsWritable)
 {
     // Check we are correctly initialized.