Merging m-c to accessibility
authorMarco Zehe <marco.zehe@googlemail.com>
Thu, 12 Jan 2012 11:04:21 +0100
changeset 84277 b3b1353ad67758903838bfea7823881faba97850
parent 84276 90a2cc46965d1a0e4e6f651f7417e9ad45d806a6 (current diff)
parent 84273 8ffdb4c7404a88ee124e0f5461a9ce563bc49ee1 (diff)
child 84278 cab1a867f0bd72ffc26b010ea58564218b6a2b31
push id21837
push usermzehe@mozilla.com
push dateThu, 12 Jan 2012 12:53:18 +0000
treeherdermozilla-central@b3b1353ad677 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merging m-c to accessibility
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -114,16 +114,41 @@
 //needed for resetting of image service color
 #include "nsLayoutCID.h"
 
 #include "nsCSSParser.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
+namespace {
+
+class CharSetChangingRunnable : public nsRunnable
+{
+public:
+  CharSetChangingRunnable(nsPresContext* aPresContext,
+                          const nsCString& aCharSet)
+    : mPresContext(aPresContext),
+      mCharSet(aCharSet)
+  {
+  }
+
+  NS_IMETHOD Run()
+  {
+    mPresContext->DoChangeCharSet(mCharSet);
+    return NS_OK;
+  }
+
+private:
+  nsRefPtr<nsPresContext> mPresContext;
+  nsCString mCharSet;
+};
+
+} // anonymous namespace
+
 static nscolor
 MakeColorPref(const nsString& aColor)
 {
   nscolor color;
   nsCSSParser parser;
   nsresult rv =
     parser.ParseColorString(aColor, nsnull, 0, &color);
   if (NS_FAILED(rv)) {
@@ -1067,17 +1092,25 @@ nsPresContext::DestroyImageLoaders()
   // want those pointers to outlive the destruction of the frame arena.
   for (PRUint32 i = 0; i < IMAGE_LOAD_TYPE_COUNT; ++i) {
     mImageLoaders[i].Enumerate(destroy_loads, nsnull);
     mImageLoaders[i].Clear();
   }
 }
 
 void
-nsPresContext::UpdateCharSet(const nsAFlatCString& aCharSet)
+nsPresContext::DoChangeCharSet(const nsCString& aCharSet)
+{
+  UpdateCharSet(aCharSet);
+  mDeviceContext->FlushFontCache();
+  RebuildAllStyleData(NS_STYLE_HINT_REFLOW);
+}
+
+void
+nsPresContext::UpdateCharSet(const nsCString& aCharSet)
 {
   if (mLangService) {
     NS_IF_RELEASE(mLanguage);
     mLanguage = mLangService->LookupCharSet(aCharSet.get()).get();  // addrefs
     // this will be a language group (or script) code rather than a true language code
 
     // bug 39570: moved from nsLanguageAtomService::LookupCharSet()
     if (mLanguage == nsGkAtoms::Unicode) {
@@ -1107,20 +1140,19 @@ nsPresContext::UpdateCharSet(const nsAFl
 }
 
 NS_IMETHODIMP
 nsPresContext::Observe(nsISupports* aSubject, 
                         const char* aTopic,
                         const PRUnichar* aData)
 {
   if (!nsCRT::strcmp(aTopic, "charset")) {
-    UpdateCharSet(NS_LossyConvertUTF16toASCII(aData));
-    mDeviceContext->FlushFontCache();
-    RebuildAllStyleData(NS_STYLE_HINT_REFLOW);
-    return NS_OK;
+    nsRefPtr<CharSetChangingRunnable> runnable =
+      new CharSetChangingRunnable(this, NS_LossyConvertUTF16toASCII(aData));
+    return NS_DispatchToCurrentThread(runnable);
   }
 
   NS_WARNING("unrecognized topic in nsPresContext::Observe");
   return NS_ERROR_FAILURE;
 }
 
 static nsPresContext*
 GetParentPresContext(nsPresContext* aPresContext)
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -1004,18 +1004,22 @@ protected:
   static NS_HIDDEN_(int) PrefChangedCallback(const char*, void*);
 
   NS_HIDDEN_(void) UpdateAfterPreferencesChanged();
   static NS_HIDDEN_(void) PrefChangedUpdateTimerCallback(nsITimer *aTimer, void *aClosure);
 
   NS_HIDDEN_(void) GetUserPreferences();
   NS_HIDDEN_(void) GetFontPreferences();
 
-  NS_HIDDEN_(void) UpdateCharSet(const nsAFlatCString& aCharSet);
+  NS_HIDDEN_(void) UpdateCharSet(const nsCString& aCharSet);
 
+public:
+  void DoChangeCharSet(const nsCString& aCharSet);
+
+protected:
   void InvalidateThebesLayers();
   void AppUnitsPerDevPixelChanged();
 
   bool MayHavePaintEventListener();
 
   void HandleRebuildUserFontSet() {
     mPostedFlushUserFontSet = false;
     FlushUserFontSet();
--- a/mozglue/android/APKOpen.cpp
+++ b/mozglue/android/APKOpen.cpp
@@ -447,17 +447,17 @@ static void * mozload(const char * path,
     }
 
     // preload libxul, to avoid slowly demand-paging it
     if (!strcmp(path, "libxul.so"))
       madvise(buf, s.GetUncompressedSize(), MADV_WILLNEED);
   }
 
 #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);
+  __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Loading %s with len %d (0x%08x)", path, lib_size, lib_size);
 #endif
 
   handle = moz_mapped_dlopen(path, RTLD_LAZY, fd, buf,
                              lib_size, 0);
   if (!handle)
     __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't load %s because %s", path, __wrap_dlerror());
 
   if (buf)
--- a/mozglue/linker/Zip.h
+++ b/mozglue/linker/Zip.h
@@ -4,16 +4,18 @@
 
 #ifndef Zip_h
 #define Zip_h
 
 #include <cstring>
 #include <stdint.h>
 #include <vector>
 #include "Utils.h"
+/* Until RefPtr.h stops using JS_Assert */
+#undef DEBUG
 #include "mozilla/RefPtr.h"
 
 /**
  * Forward declaration
  */
 class ZipCollection;
 
 /**
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -621,17 +621,17 @@ ParseManifest(NSLocationType type, FileL
       if (directive->contentflags &&
           (CheckFlag(kPlatform, wtoken, platform) ||
            CheckFlag(kContentAccessible, wtoken, contentAccessible)))
         continue;
 
       bool xpcNativeWrappers = true; // Dummy for CheckFlag.
       if (CheckFlag(kXPCNativeWrappers, wtoken, xpcNativeWrappers)) {
         LogMessageWithContext(file, line,
-                              "Warning: Ignoring obsolete chrome registration modifier '%s'.",
+                              "Ignoring obsolete chrome registration modifier '%s'.",
                               token);
         continue;
       }
 
       LogMessageWithContext(file, line,
                             "Unrecognized chrome manifest modifier '%s'.",
                             token);
       ok = false;