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

Unified Diff: third_party/WebKit/Source/core/events/EventDispatcher.cpp

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure Created 4 years, 8 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
Index: third_party/WebKit/Source/core/events/EventDispatcher.cpp
diff --git a/third_party/WebKit/Source/core/events/EventDispatcher.cpp b/third_party/WebKit/Source/core/events/EventDispatcher.cpp
index 5a51d615ecd92049c55572114884d12089032dcd..d2f5343c18aaecfc2b8c9272dbcf82f05aa8760a 100644
--- a/third_party/WebKit/Source/core/events/EventDispatcher.cpp
+++ b/third_party/WebKit/Source/core/events/EventDispatcher.cpp
@@ -73,15 +73,15 @@ void EventDispatcher::dispatchSimulatedClick(Node& node, Event* underlyingEvent,
// This persistent vector doesn't cause leaks, because added Nodes are removed
// before dispatchSimulatedClick() returns. This vector is here just to prevent
// the code from running into an infinite recursion of dispatchSimulatedClick().
- DEFINE_STATIC_LOCAL(Persistent<HeapHashSet<Member<Node>>>, nodesDispatchingSimulatedClicks, (new HeapHashSet<Member<Node>>()));
+ DEFINE_STATIC_LOCAL(HeapHashSet<Member<Node>>, nodesDispatchingSimulatedClicks, (new HeapHashSet<Member<Node>>));
if (isDisabledFormControl(&node))
return;
- if (nodesDispatchingSimulatedClicks->contains(&node))
+ if (nodesDispatchingSimulatedClicks.contains(&node))
return;
- nodesDispatchingSimulatedClicks->add(&node);
+ nodesDispatchingSimulatedClicks.add(&node);
if (mouseEventOptions == SendMouseOverUpDownEvents)
EventDispatcher(node, MouseEvent::create(EventTypeNames::mouseover, node.document().domWindow(), underlyingEvent, creationScope)).dispatch();
@@ -98,7 +98,7 @@ void EventDispatcher::dispatchSimulatedClick(Node& node, Event* underlyingEvent,
// always send click
EventDispatcher(node, MouseEvent::create(EventTypeNames::click, node.document().domWindow(), underlyingEvent, creationScope)).dispatch();
- nodesDispatchingSimulatedClicks->remove(&node);
+ nodesDispatchingSimulatedClicks.remove(&node);
}
DispatchEventResult EventDispatcher::dispatch()

Powered by Google App Engine
This is Rietveld 408576698