Bug 1247098 - Mark nsIPresShell::GetResolution and nsPresContext::IsRootContentDocument as const; r?tnikkel
MozReview-Commit-ID: 5IXm4EUy7IN
--- 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;