Bug 1532128 - layout: Make some global functions static. r=dholbert
authorChris Peterson <cpeterson@mozilla.com>
Fri, 22 Feb 2019 20:33:01 -0800
changeset 520409 70d011e850dac280855f30140fe846a87ab5a7c8
parent 520408 e13ad7558d5749edd36d607d39185321de17ebeb
child 520410 9387009d5ec9601fab0e9aba5813f865108b076e
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1532128
milestone67.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 1532128 - layout: Make some global functions static. r=dholbert clang's -Wmissing-prototypes option identifies global functions that can be made static (because they're only called from one compilation unit) or removed (if they're never called). layout/painting/FrameLayerBuilder.cpp:2593:6 [-Wmissing-prototypes] no previous prototype for function 'ReleaseLayerUserData' layout/painting/RetainedDisplayListBuilder.cpp:1084:6 [-Wmissing-prototypes] no previous prototype for function 'FindContainingBlocks' layout/style/FontFaceSet.cpp:423:6 [-Wmissing-prototypes] no previous prototype for function 'IsPdfJs' layout/svg/SVGObserverUtils.cpp:969:6 [-Wmissing-prototypes] no previous prototype for function 'DestroyFilterProperty' Differential Revision: https://phabricator.services.mozilla.com/D21851
layout/painting/FrameLayerBuilder.cpp
layout/painting/RetainedDisplayListBuilder.cpp
layout/style/FontFaceSet.cpp
layout/svg/SVGObserverUtils.cpp
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -2600,17 +2600,17 @@ already_AddRefed<PaintedLayer> Container
                           didResetScrollPositionForLayerPixelAlignment);
   PreparePaintedLayerForUse(layer, data, aAnimatedGeometryRoot, aReferenceFrame,
                             aTopLeft,
                             didResetScrollPositionForLayerPixelAlignment);
 
   return layer.forget();
 }
 
-void ReleaseLayerUserData(void* aData) {
+static void ReleaseLayerUserData(void* aData) {
   PaintedDisplayItemLayerUserData* userData =
       static_cast<PaintedDisplayItemLayerUserData*>(aData);
   userData->Release();
 }
 
 already_AddRefed<PaintedLayer> ContainerState::CreatePaintedLayer(
     PaintedLayerData* aData) {
   LayerManager::PaintedLayerCreationHint creationHint =
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -1080,17 +1080,18 @@ static void AddFramesForContainingBlock(
 // Placeholder descendants of aFrame don't contribute to aFrame's overflow area.
 // Find all the containing blocks that might own placeholders under us, walk
 // their OOF frames list, and manually invalidate any frames that are
 // descendants of a modified frame (us, or another frame we'll get to soon).
 // This is combined with the work required for MarkFrameForDisplayIfVisible,
 // so that we can avoid an extra ancestor walk, and we can reuse the flag
 // to detect when we've already visited an ancestor (and thus all further
 // ancestors must also be visited).
-void FindContainingBlocks(nsIFrame* aFrame, nsTArray<nsIFrame*>& aExtraFrames) {
+static void FindContainingBlocks(nsIFrame* aFrame,
+                                 nsTArray<nsIFrame*>& aExtraFrames) {
   for (nsIFrame* f = aFrame; f;
        f = nsLayoutUtils::GetParentOrPlaceholderForCrossDoc(f)) {
     if (f->ForceDescendIntoIfVisible()) return;
     f->SetForceDescendIntoIfVisible(true);
     CRR_LOG("Considering OOFs for %p\n", f);
 
     AddFramesForContainingBlock(f, f->GetChildList(nsIFrame::kFloatList),
                                 aExtraFrames);
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -415,17 +415,17 @@ bool FontFaceSet::HasRuleFontFace(FontFa
     if (mRuleFaces[i].mFontFace == aFontFace) {
       return true;
     }
   }
   return false;
 }
 #endif
 
-bool IsPdfJs(nsIPrincipal* aPrincipal) {
+static bool IsPdfJs(nsIPrincipal* aPrincipal) {
   if (!aPrincipal) {
     return false;
   }
   nsCOMPtr<nsIURI> uri;
   aPrincipal->GetURI(getter_AddRefs(uri));
   return uri && uri->GetSpecOrDefault().EqualsLiteral(
                     "resource://pdf.js/web/viewer.html");
 }
--- a/layout/svg/SVGObserverUtils.cpp
+++ b/layout/svg/SVGObserverUtils.cpp
@@ -961,17 +961,17 @@ void SVGRenderingObserver::DebugObserver
 
 typedef nsInterfaceHashtable<nsRefPtrHashKey<URLAndReferrerInfo>,
                              nsIMutationObserver>
     URIObserverHashtable;
 
 using PaintingPropertyDescriptor =
     const mozilla::FramePropertyDescriptor<nsSVGPaintingProperty>*;
 
-void DestroyFilterProperty(SVGFilterObserverListForCSSProp* aProp) {
+static void DestroyFilterProperty(SVGFilterObserverListForCSSProp* aProp) {
   // SVGFilterObserverListForCSSProp is cycle-collected, so dropping the last
   // reference doesn't necessarily destroy it. We need to tell it that the
   // frame has now become invalid.
   aProp->DetachFromFrame();
 
   aProp->Release();
 }