Bug 1357307 - Make sure gfxPrefs instance is created before accessing it. r=milan
☠☠ backed out by 6efe7915f97b ☠ ☠
authorvincentliu <vliu@mozilla.com>
Mon, 24 Apr 2017 14:10:17 +0800
changeset 354518 9f2fe5e3f78c8174fab116ebc9091d0e357fb121
parent 354517 7457db3be2751899c296052079dc5e6ebecc284d
child 354519 89407b3607a2feedd46b2d13717724bc5f41b33b
push id89477
push uservliu@mozilla.com
push dateMon, 24 Apr 2017 06:11:19 +0000
treeherdermozilla-inbound@9f2fe5e3f78c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmilan
bugs1357307
milestone55.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
Bug 1357307 - Make sure gfxPrefs instance is created before accessing it. r=milan
widget/nsXPLookAndFeel.cpp
--- a/widget/nsXPLookAndFeel.cpp
+++ b/widget/nsXPLookAndFeel.cpp
@@ -14,16 +14,17 @@
 #include "nsFont.h"
 #include "mozilla/dom/ContentChild.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/ServoStyleSet.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/widget/WidgetMessageUtils.h"
 
 #include "gfxPlatform.h"
+#include "gfxPrefs.h"
 #include "qcms.h"
 
 #ifdef DEBUG
 #include "nsSize.h"
 #endif
 
 using namespace mozilla;
 
@@ -815,16 +816,18 @@ nsXPLookAndFeel::GetColorImpl(ColorID aI
   }
 
   if (sUseNativeColors && aUseStandinsForNativeColors) {
     aResult = GetStandinForNativeColor(aID);
     return NS_OK;
   }
 
   if (sUseNativeColors && NS_SUCCEEDED(NativeGetColor(aID, aResult))) {
+    MOZ_ASSERT(NS_IsMainThread());
+    gfxPrefs::GetSingleton();
     if ((gfxPlatform::GetCMSMode() == eCMSMode_All) &&
          !IsSpecialColor(aID, aResult)) {
       qcms_transform *transform = gfxPlatform::GetCMSInverseRGBTransform();
       if (transform) {
         uint8_t color[3];
         color[0] = NS_GET_R(aResult);
         color[1] = NS_GET_G(aResult);
         color[2] = NS_GET_B(aResult);