Bug 1405785, part 1 - Rename nsSVGRenderingObserver::Start/StopListening. r=longsonr
authorJonathan Watt <jwatt@jwatt.org>
Thu, 14 Sep 2017 09:47:19 +0100
changeset 384674 f46ed2816658cc8d4140e8ca50770d10cfe31a34
parent 384673 490c3f1fd1e998b4ffe8fd3f09c76abdfb9689b3
child 384675 0f1d6c8dc9929899d86ecd2f2d0d40662c83175b
push id32634
push userkwierso@gmail.com
push dateFri, 06 Oct 2017 19:55:44 +0000
treeherdermozilla-central@2d7b8b5dd174 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslongsonr
bugs1405785
milestone58.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 1405785, part 1 - Rename nsSVGRenderingObserver::Start/StopListening. r=longsonr MozReview-Commit-ID: GF9xP8mvuCC
image/VectorImage.cpp
layout/svg/SVGObserverUtils.cpp
layout/svg/SVGObserverUtils.h
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -57,34 +57,34 @@ public:
     : nsSVGRenderingObserver()
     , mDocWrapper(aDocWrapper)
     , mVectorImage(aVectorImage)
     , mHonoringInvalidations(true)
   {
     MOZ_ASSERT(mDocWrapper, "Need a non-null SVG document wrapper");
     MOZ_ASSERT(mVectorImage, "Need a non-null VectorImage");
 
-    StartListening();
+    StartObserving();
     Element* elem = GetTarget();
     MOZ_ASSERT(elem, "no root SVG node for us to observe");
 
     SVGObserverUtils::AddRenderingObserver(elem, this);
     mInObserverList = true;
   }
 
 
   void ResumeHonoringInvalidations()
   {
     mHonoringInvalidations = true;
   }
 
 protected:
   virtual ~SVGRootRenderingObserver()
   {
-    StopListening();
+    StopObserving();
   }
 
   virtual Element* GetTarget() override
   {
     return mDocWrapper->GetRootSVGElem();
   }
 
   virtual void DoUpdate() override
--- a/layout/svg/SVGObserverUtils.cpp
+++ b/layout/svg/SVGObserverUtils.cpp
@@ -20,26 +20,26 @@
 #include "SVGGeometryElement.h"
 #include "SVGUseElement.h"
 #include "ImageLoader.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 void
-nsSVGRenderingObserver::StartListening()
+nsSVGRenderingObserver::StartObserving()
 {
   Element* target = GetTarget();
   if (target) {
     target->AddMutationObserver(this);
   }
 }
 
 void
-nsSVGRenderingObserver::StopListening()
+nsSVGRenderingObserver::StopObserving()
 {
   Element* target = GetTarget();
 
   if (target) {
     target->RemoveMutationObserver(this);
     if (mInObserverList) {
       SVGObserverUtils::RemoveRenderingObserver(target, this);
       mInObserverList = false;
@@ -103,17 +103,17 @@ nsSVGRenderingObserver::InvalidateViaRef
   mInObserverList = false;
   DoUpdate();
 }
 
 void
 nsSVGRenderingObserver::NotifyEvictedFromRenderingObserverList()
 {
   mInObserverList = false; // We've been removed from rendering-obs. list.
-  StopListening();            // Remove ourselves from mutation-obs. list.
+  StopObserving();            // Remove ourselves from mutation-obs. list.
 }
 
 void
 nsSVGRenderingObserver::AttributeChanged(nsIDocument* aDocument,
                                          dom::Element* aElement,
                                          int32_t aNameSpaceID,
                                          nsIAtom* aAttribute,
                                          int32_t aModType,
@@ -179,22 +179,22 @@ nsSVGRenderingObserver::ContentRemoved(n
 
 nsSVGIDRenderingObserver::nsSVGIDRenderingObserver(nsIURI* aURI,
                                                    nsIContent* aObservingContent,
                                                    bool aReferenceImage)
   : mObservedElementTracker(this)
 {
   // Start watching the target element
   mObservedElementTracker.Reset(aObservingContent, aURI, true, aReferenceImage);
-  StartListening();
+  StartObserving();
 }
 
 nsSVGIDRenderingObserver::~nsSVGIDRenderingObserver()
 {
-  StopListening();
+  StopObserving();
 }
 
 void
 nsSVGIDRenderingObserver::DoUpdate()
 {
   if (mObservedElementTracker.get() && mInObserverList) {
     SVGObserverUtils::RemoveRenderingObserver(mObservedElementTracker.get(), this);
     mInObserverList = false;
@@ -241,17 +241,17 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGFi
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsSVGFilterReference)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsSVGFilterReference)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mObservedElementTracker)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsSVGFilterReference)
-  tmp->StopListening();
+  tmp->StopObserving();
   NS_IMPL_CYCLE_COLLECTION_UNLINK(mObservedElementTracker);
 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGFilterReference)
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsSVGIDRenderingObserver)
   NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
   NS_INTERFACE_MAP_ENTRY(nsISVGFilterReference)
 NS_INTERFACE_MAP_END
--- a/layout/svg/SVGObserverUtils.h
+++ b/layout/svg/SVGObserverUtils.h
@@ -35,18 +35,18 @@ class nsSVGFilterChainObserver;
 /*
  * This interface allows us to be notified when a piece of SVG content is
  * re-rendered.
  *
  * Concrete implementations of this interface need to implement
  * "GetTarget()" to specify the piece of SVG content that they'd like to
  * monitor, and they need to implement "DoUpdate" to specify how we'll react
  * when that content gets re-rendered. They also need to implement a
- * constructor and destructor, which should call StartListening and
- * StopListening, respectively.
+ * constructor and destructor, which should call StartObserving and
+ * StopObserving, respectively.
  */
 class nsSVGRenderingObserver : public nsStubMutationObserver
 {
 
 protected:
   virtual ~nsSVGRenderingObserver()
     {}
 
@@ -79,18 +79,18 @@ public:
   nsIFrame* GetReferencedFrame(mozilla::LayoutFrameType aFrameType, bool* aOK);
 
   Element* GetReferencedElement();
 
   virtual bool ObservesReflow() { return true; }
 
 protected:
   // Non-virtual protected methods
-  void StartListening();
-  void StopListening();
+  void StartObserving();
+  void StopObserving();
 
   // Virtual protected methods
   virtual void DoUpdate() = 0; // called when the referenced resource changes.
 
   // This is an internally-used version of GetReferencedElement that doesn't
   // forcibly add us as an observer. (whereas GetReferencedElement does)
   virtual Element* GetTarget() = 0;
 
@@ -133,19 +133,19 @@ protected:
   class ElementTracker final : public IDTracker
   {
   public:
     explicit ElementTracker(nsSVGIDRenderingObserver* aOwningObserver)
       : mOwningObserver(aOwningObserver)
     {}
   protected:
     virtual void ElementChanged(Element* aFrom, Element* aTo) override {
-      mOwningObserver->StopListening(); // stop observing the old element
+      mOwningObserver->StopObserving(); // stop observing the old element
       IDTracker::ElementChanged(aFrom, aTo);
-      mOwningObserver->StartListening(); // start observing the new element
+      mOwningObserver->StartObserving(); // start observing the new element
       mOwningObserver->DoUpdate();
     }
     /**
      * Override IsPersistent because we want to keep tracking the element
      * for the ID even when it changes.
      */
     virtual bool IsPersistent() override { return true; }
   private: