Bug 1519001 - Rename some style sheet accessors on nsLayoutStylesheetCache to indicate they can return null r=xidorn
authorCameron McCormack <cam@mcc.id.au>
Fri, 11 Jan 2019 03:12:05 +0000
changeset 510532 45d4ae4551a1e07cb5fa97d8405e6f9badcf7554
parent 510531 0117afe25cfe6a78af26a2a352cc60bf5cbbc1e4
child 510533 fb705f84a7921bd5a77108b99e2ffab51a53c09b
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1519001
milestone66.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 1519001 - Rename some style sheet accessors on nsLayoutStylesheetCache to indicate they can return null r=xidorn Differential Revision: https://phabricator.services.mozilla.com/D16150
dom/ipc/ContentParent.cpp
layout/base/nsDocumentViewer.cpp
layout/style/nsLayoutStylesheetCache.cpp
layout/style/nsLayoutStylesheetCache.h
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -2492,17 +2492,17 @@ void ContentParent::InitInternal(Process
   // This is only implemented (returns a non-empty list) by MacOSX and Linux
   // at present.
   nsTArray<SystemFontListEntry> fontList;
   gfxPlatform::GetPlatform()->ReadSystemFontList(&fontList);
   nsTArray<LookAndFeelInt> lnfCache = LookAndFeel::GetIntCache();
 
   // Content processes have no permission to access profile directory, so we
   // send the file URL instead.
-  StyleSheet* ucs = nsLayoutStylesheetCache::Singleton()->UserContentSheet();
+  StyleSheet* ucs = nsLayoutStylesheetCache::Singleton()->GetUserContentSheet();
   if (ucs) {
     SerializeURI(ucs->GetSheetURI(), xpcomInit.userContentSheetURL());
   } else {
     SerializeURI(nullptr, xpcomInit.userContentSheetURL());
   }
 
   // 1. Build ContentDeviceData first, as it may affect some gfxVars.
   gfxPlatform::GetPlatform()->BuildContentDeviceData(
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -2294,22 +2294,19 @@ UniquePtr<ServoStyleSet> nsDocumentViewe
   // different sets for different media
 
   UniquePtr<ServoStyleSet> styleSet = MakeUnique<ServoStyleSet>();
 
   // The document will fill in the document sheets when we create the presshell
   auto cache = nsLayoutStylesheetCache::Singleton();
 
   // Handle the user sheets.
-  StyleSheet* sheet = nullptr;
-  if (nsContentUtils::IsInChromeDocshell(aDocument)) {
-    sheet = cache->UserChromeSheet();
-  } else {
-    sheet = cache->UserContentSheet();
-  }
+  StyleSheet* sheet = nsContentUtils::IsInChromeDocshell(aDocument)
+                          ? cache->GetUserChromeSheet()
+                          : cache->GetUserContentSheet();
 
   if (sheet) {
     styleSet->AppendStyleSheet(SheetType::User, sheet);
   }
 
   // Append chrome sheets (scrollbars + forms).
   sheet = cache->ScrollbarsSheet();
   if (sheet) {
--- a/layout/style/nsLayoutStylesheetCache.cpp
+++ b/layout/style/nsLayoutStylesheetCache.cpp
@@ -54,21 +54,21 @@ nsresult nsLayoutStylesheetCache::Observ
     if (lazy_ && !m##identifier_##Sheet) {                                     \
       LoadSheetURL(url_, &m##identifier_##Sheet, eAgentSheetFeatures, eCrash); \
     }                                                                          \
     return m##identifier_##Sheet;                                              \
   }
 #include "mozilla/UserAgentStyleSheetList.h"
 #undef STYLE_SHEET
 
-StyleSheet* nsLayoutStylesheetCache::UserContentSheet() {
+StyleSheet* nsLayoutStylesheetCache::GetUserContentSheet() {
   return mUserContentSheet;
 }
 
-StyleSheet* nsLayoutStylesheetCache::UserChromeSheet() {
+StyleSheet* nsLayoutStylesheetCache::GetUserChromeSheet() {
   return mUserChromeSheet;
 }
 
 StyleSheet* nsLayoutStylesheetCache::ChromePreferenceSheet(
     nsPresContext* aPresContext) {
   if (!mChromePreferenceSheet) {
     BuildPreferenceSheet(&mChromePreferenceSheet, aPresContext);
   }
--- a/layout/style/nsLayoutStylesheetCache.h
+++ b/layout/style/nsLayoutStylesheetCache.h
@@ -38,18 +38,18 @@ class nsLayoutStylesheetCache final : pu
 
   static nsLayoutStylesheetCache* Singleton();
 
 #define STYLE_SHEET(identifier_, url_, lazy_) \
   mozilla::StyleSheet* identifier_##Sheet();
 #include "mozilla/UserAgentStyleSheetList.h"
 #undef STYLE_SHEET
 
-  mozilla::StyleSheet* UserContentSheet();
-  mozilla::StyleSheet* UserChromeSheet();
+  mozilla::StyleSheet* GetUserContentSheet();
+  mozilla::StyleSheet* GetUserChromeSheet();
   mozilla::StyleSheet* ChromePreferenceSheet(nsPresContext* aPresContext);
   mozilla::StyleSheet* ContentPreferenceSheet(nsPresContext* aPresContext);
 
   static void InvalidatePreferenceSheets();
 
   static void Shutdown();
 
   static void SetUserContentCSSURL(nsIURI* aURI);