Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(667)

Unified Diff: Source/core/dom/ChildListMutationScope.h

Issue 51273002: Have ChildFrameDisconnector / ChildListMutationScope deal with references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/CharacterData.cpp ('k') | Source/core/dom/ChildListMutationScope.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/ChildListMutationScope.h
diff --git a/Source/core/dom/ChildListMutationScope.h b/Source/core/dom/ChildListMutationScope.h
index 442df97e19be2b6a4e27fc04675a07d4c861c282..d847d826a6d7a8591d23f3a654adffca344d35f1 100644
--- a/Source/core/dom/ChildListMutationScope.h
+++ b/Source/core/dom/ChildListMutationScope.h
@@ -45,7 +45,7 @@ class MutationObserverInterestGroup;
// ChildListMutationAccumulator is not meant to be used directly; ChildListMutationScope is the public interface.
class ChildListMutationAccumulator : public RefCounted<ChildListMutationAccumulator> {
public:
- static PassRefPtr<ChildListMutationAccumulator> getOrCreate(Node*);
+ static PassRefPtr<ChildListMutationAccumulator> getOrCreate(Node&);
~ChildListMutationAccumulator();
void childAdded(PassRefPtr<Node>);
@@ -75,22 +75,22 @@ private:
class ChildListMutationScope {
WTF_MAKE_NONCOPYABLE(ChildListMutationScope);
public:
- explicit ChildListMutationScope(Node* target)
+ explicit ChildListMutationScope(Node& target)
{
- if (target->document().hasMutationObserversOfType(MutationObserver::ChildList))
+ if (target.document().hasMutationObserversOfType(MutationObserver::ChildList))
m_accumulator = ChildListMutationAccumulator::getOrCreate(target);
}
- void childAdded(Node* child)
+ void childAdded(Node& child)
{
if (m_accumulator && m_accumulator->hasObservers())
- m_accumulator->childAdded(child);
+ m_accumulator->childAdded(PassRefPtr<Node>(child));
}
- void willRemoveChild(Node* child)
+ void willRemoveChild(Node& child)
{
if (m_accumulator && m_accumulator->hasObservers())
- m_accumulator->willRemoveChild(child);
+ m_accumulator->willRemoveChild(PassRefPtr<Node>(child));
}
private:
« no previous file with comments | « Source/core/dom/CharacterData.cpp ('k') | Source/core/dom/ChildListMutationScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698