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

Unified Diff: third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp

Issue 1463433002: Use RefPtr for MutationObserver in MutationObserverInterestGroup. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the test Created 5 years, 1 month 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
Index: third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp
diff --git a/third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp b/third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp
index 689d0f4466328615c24dabccf1b453df224db152..26e0a7e0bca99000af3a4c38442ccc6911b5e29a 100644
--- a/third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp
+++ b/third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.cpp
@@ -39,7 +39,7 @@ namespace blink {
PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> MutationObserverInterestGroup::createIfNeeded(Node& target, MutationObserver::MutationType type, MutationRecordDeliveryOptions oldValueFlag, const QualifiedName* attributeName)
{
ASSERT((type == MutationObserver::Attributes && attributeName) || !attributeName);
- WillBeHeapHashMap<RawPtrWillBeMember<MutationObserver>, MutationRecordDeliveryOptions> observers;
+ WillBeHeapHashMap<RefPtrWillBeMember<MutationObserver>, MutationRecordDeliveryOptions> observers;
target.getRegisteredMutationObserversOfType(observers, type, attributeName);
if (observers.isEmpty())
return nullptr;
@@ -47,7 +47,7 @@ PassOwnPtrWillBeRawPtr<MutationObserverInterestGroup> MutationObserverInterestGr
return adoptPtrWillBeNoop(new MutationObserverInterestGroup(observers, oldValueFlag));
}
-MutationObserverInterestGroup::MutationObserverInterestGroup(WillBeHeapHashMap<RawPtrWillBeMember<MutationObserver>, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions oldValueFlag)
+MutationObserverInterestGroup::MutationObserverInterestGroup(WillBeHeapHashMap<RefPtrWillBeMember<MutationObserver>, MutationRecordDeliveryOptions>& observers, MutationRecordDeliveryOptions oldValueFlag)
: m_oldValueFlag(oldValueFlag)
{
ASSERT(!observers.isEmpty());
@@ -68,7 +68,7 @@ void MutationObserverInterestGroup::enqueueMutationRecord(PassRefPtrWillBeRawPtr
RefPtrWillBeRawPtr<MutationRecord> mutation = prpMutation;
RefPtrWillBeRawPtr<MutationRecord> mutationWithNullOldValue = nullptr;
for (auto& iter : m_observers) {
- MutationObserver* observer = iter.key;
+ MutationObserver* observer = iter.key.get();
if (hasOldValue(iter.value)) {
observer->enqueueMutationRecord(mutation);
continue;
« no previous file with comments | « third_party/WebKit/Source/core/dom/MutationObserverInterestGroup.h ('k') | third_party/WebKit/Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698