Bug 1247098 - Mark nsIPresShell::GetResolution and nsPresContext::IsRootContentDocument as const; r?tnikkel draft
authorJamie Nicol <jnicol@mozilla.com>
Wed, 24 Feb 2016 14:57:43 +0000
changeset 334139 7ba57b131dc9b5f967738ce7eed0c58a7e77de15
parent 334101 d848a5628d801a460a7244cbcdea22d328d8b310
child 334140 5db72e964989713952134640ee636906026ed978
push id11457
push userbmo:jnicol@mozilla.com
push dateWed, 24 Feb 2016 15:41:38 +0000
reviewerstnikkel
bugs1247098
milestone47.0a1
Bug 1247098 - Mark nsIPresShell::GetResolution and nsPresContext::IsRootContentDocument as const; r?tnikkel MozReview-Commit-ID: 5IXm4EUy7IN
layout/base/nsIPresShell.h
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -1395,17 +1395,17 @@ public:
    * allocate more or fewer pixels for rescalable content by a factor
    * of |resolution| in both dimensions.  Return NS_OK iff the
    * resolution bounds are sane, and the resolution of this was
    * actually updated.
    *
    * The resolution defaults to 1.0.
    */
   virtual nsresult SetResolution(float aResolution) = 0;
-  float GetResolution() { return mResolution.valueOr(1.0); }
+  float GetResolution() const { return mResolution.valueOr(1.0); }
   virtual float GetCumulativeResolution() = 0;
 
   /**
    * Calculate the cumulative scale resolution from this document up to
    * but not including the root document.
    */
   virtual float GetCumulativeNonRootScaleResolution() = 0;
 
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -2851,17 +2851,17 @@ nsPresContext::SizeOfExcludingThis(Mallo
   return mPropertyTable.SizeOfExcludingThis(aMallocSizeOf) +
          mLangGroupFontPrefs.SizeOfExcludingThis(aMallocSizeOf);
 
   // Measurement of other members may be added later if DMD finds it is
   // worthwhile.
 }
 
 bool
-nsPresContext::IsRootContentDocument()
+nsPresContext::IsRootContentDocument() const
 {
   // We are a root content document if: we are not a resource doc, we are
   // not chrome, and we either have no parent or our parent is chrome.
   if (mDocument->IsResourceDoc()) {
     return false;
   }
   if (IsChrome()) {
     return false;
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -1007,17 +1007,17 @@ public:
     PropertyTable()->DeleteAllFor(aFrame);
   }
 
   virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
   virtual size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const {
     return aMallocSizeOf(this) + SizeOfExcludingThis(aMallocSizeOf);
   }
 
-  bool IsRootContentDocument();
+  bool IsRootContentDocument() const;
   bool IsCrossProcessRootContentDocument();
 
   bool IsGlyph() const {
     return mIsGlyph;
   }
 
   void SetIsGlyph(bool aValue) {
     mIsGlyph = aValue;