Bug 1405785, part 1 - Rename nsSVGRenderingObserver::Start/StopListening. r=longsonr

MozReview-Commit-ID: GF9xP8mvuCC
This commit is contained in:
Jonathan Watt 2017-09-14 09:47:19 +01:00
Родитель 3251040469
Коммит bd85d1e036
3 изменённых файлов: 14 добавлений и 14 удалений

Просмотреть файл

@ -62,7 +62,7 @@ public:
MOZ_ASSERT(mDocWrapper, "Need a non-null SVG document wrapper"); MOZ_ASSERT(mDocWrapper, "Need a non-null SVG document wrapper");
MOZ_ASSERT(mVectorImage, "Need a non-null VectorImage"); MOZ_ASSERT(mVectorImage, "Need a non-null VectorImage");
StartListening(); StartObserving();
Element* elem = GetTarget(); Element* elem = GetTarget();
MOZ_ASSERT(elem, "no root SVG node for us to observe"); MOZ_ASSERT(elem, "no root SVG node for us to observe");
@ -79,7 +79,7 @@ public:
protected: protected:
virtual ~SVGRootRenderingObserver() virtual ~SVGRootRenderingObserver()
{ {
StopListening(); StopObserving();
} }
virtual Element* GetTarget() override virtual Element* GetTarget() override

Просмотреть файл

@ -25,7 +25,7 @@ using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
void void
nsSVGRenderingObserver::StartListening() nsSVGRenderingObserver::StartObserving()
{ {
Element* target = GetTarget(); Element* target = GetTarget();
if (target) { if (target) {
@ -34,7 +34,7 @@ nsSVGRenderingObserver::StartListening()
} }
void void
nsSVGRenderingObserver::StopListening() nsSVGRenderingObserver::StopObserving()
{ {
Element* target = GetTarget(); Element* target = GetTarget();
@ -108,7 +108,7 @@ void
nsSVGRenderingObserver::NotifyEvictedFromRenderingObserverList() nsSVGRenderingObserver::NotifyEvictedFromRenderingObserverList()
{ {
mInObserverList = false; // We've been removed from rendering-obs. list. 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 void
@ -184,12 +184,12 @@ nsSVGIDRenderingObserver::nsSVGIDRenderingObserver(nsIURI* aURI,
{ {
// Start watching the target element // Start watching the target element
mObservedElementTracker.Reset(aObservingContent, aURI, true, aReferenceImage); mObservedElementTracker.Reset(aObservingContent, aURI, true, aReferenceImage);
StartListening(); StartObserving();
} }
nsSVGIDRenderingObserver::~nsSVGIDRenderingObserver() nsSVGIDRenderingObserver::~nsSVGIDRenderingObserver()
{ {
StopListening(); StopObserving();
} }
void void
@ -246,7 +246,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsSVGFilterReference)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsSVGFilterReference) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsSVGFilterReference)
tmp->StopListening(); tmp->StopObserving();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mObservedElementTracker); NS_IMPL_CYCLE_COLLECTION_UNLINK(mObservedElementTracker);
NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_UNLINK_END

Просмотреть файл

@ -40,8 +40,8 @@ class nsSVGFilterChainObserver;
* "GetTarget()" to specify the piece of SVG content that they'd like to * "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 * 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 * when that content gets re-rendered. They also need to implement a
* constructor and destructor, which should call StartListening and * constructor and destructor, which should call StartObserving and
* StopListening, respectively. * StopObserving, respectively.
*/ */
class nsSVGRenderingObserver : public nsStubMutationObserver class nsSVGRenderingObserver : public nsStubMutationObserver
{ {
@ -84,8 +84,8 @@ public:
protected: protected:
// Non-virtual protected methods // Non-virtual protected methods
void StartListening(); void StartObserving();
void StopListening(); void StopObserving();
// Virtual protected methods // Virtual protected methods
virtual void DoUpdate() = 0; // called when the referenced resource changes. virtual void DoUpdate() = 0; // called when the referenced resource changes.
@ -138,9 +138,9 @@ protected:
{} {}
protected: protected:
virtual void ElementChanged(Element* aFrom, Element* aTo) override { 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); IDTracker::ElementChanged(aFrom, aTo);
mOwningObserver->StartListening(); // start observing the new element mOwningObserver->StartObserving(); // start observing the new element
mOwningObserver->DoUpdate(); mOwningObserver->DoUpdate();
} }
/** /**