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

Unified Diff: third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp

Issue 1397073002: [Oilpan] Create UnsafePtr to store on-heap pointers in Vector (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
diff --git a/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp b/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
index 8c3098603fd1650e68f676ec24e1f0fdeb5d8720..7ff8413b6beefb08e991bb8edecef9b9affad00e 100644
--- a/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
+++ b/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
@@ -235,7 +235,11 @@ DEFINE_TRACE(EventHandlerRegistry)
void EventHandlerRegistry::clearWeakMembers(Visitor* visitor)
{
+#if ENABLE(OILPAN)
+ Vector<UnsafePtr<EventTarget>> deadTargets;
+#else
Vector<EventTarget*> deadTargets;
+#endif
for (size_t i = 0; i < EventHandlerClassCount; ++i) {
EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
const EventTargetSet* targets = &m_targets[handlerClass];
@@ -258,7 +262,11 @@ void EventHandlerRegistry::documentDetached(Document& document)
// Remove all event targets under the detached document.
for (size_t handlerClassIndex = 0; handlerClassIndex < EventHandlerClassCount; ++handlerClassIndex) {
EventHandlerClass handlerClass = static_cast<EventHandlerClass>(handlerClassIndex);
+#if ENABLE(OILPAN)
+ Vector<UnsafePtr<EventTarget>> targetsToRemove;
+#else
Vector<EventTarget*> targetsToRemove;
+#endif
const EventTargetSet* targets = &m_targets[handlerClass];
for (const auto& eventTarget : *targets) {
if (Node* node = eventTarget.key->toNode()) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | third_party/WebKit/Source/platform/heap/Handle.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698