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

Side by Side Diff: Source/core/frame/EventHandlerRegistry.cpp

Issue 1166623002: Oilpan: Remove a visitor parameter from isHeapObjectAlive (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/frame/EventHandlerRegistry.h" 6 #include "core/frame/EventHandlerRegistry.h"
7 7
8 #include "core/events/ThreadLocalEventNames.h" 8 #include "core/events/ThreadLocalEventNames.h"
9 #include "core/frame/LocalDOMWindow.h" 9 #include "core/frame/LocalDOMWindow.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 203
204 void EventHandlerRegistry::clearWeakMembers(Visitor* visitor) 204 void EventHandlerRegistry::clearWeakMembers(Visitor* visitor)
205 { 205 {
206 Vector<EventTarget*> deadTargets; 206 Vector<EventTarget*> deadTargets;
207 for (size_t i = 0; i < EventHandlerClassCount; ++i) { 207 for (size_t i = 0; i < EventHandlerClassCount; ++i) {
208 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); 208 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
209 const EventTargetSet* targets = &m_targets[handlerClass]; 209 const EventTargetSet* targets = &m_targets[handlerClass];
210 for (const auto& eventTarget : *targets) { 210 for (const auto& eventTarget : *targets) {
211 Node* node = eventTarget.key->toNode(); 211 Node* node = eventTarget.key->toNode();
212 LocalDOMWindow* window = eventTarget.key->toDOMWindow(); 212 LocalDOMWindow* window = eventTarget.key->toDOMWindow();
213 if (node && !visitor->isHeapObjectAlive(node)) { 213 if (node && !Heap::isHeapObjectAlive(node)) {
214 deadTargets.append(node); 214 deadTargets.append(node);
215 } else if (window && !visitor->isHeapObjectAlive(window)) { 215 } else if (window && !Heap::isHeapObjectAlive(window)) {
216 deadTargets.append(window); 216 deadTargets.append(window);
217 } 217 }
218 } 218 }
219 } 219 }
220 for (size_t i = 0; i < deadTargets.size(); ++i) 220 for (size_t i = 0; i < deadTargets.size(); ++i)
221 didRemoveAllEventHandlers(*deadTargets[i]); 221 didRemoveAllEventHandlers(*deadTargets[i]);
222 } 222 }
223 223
224 void EventHandlerRegistry::documentDetached(Document& document) 224 void EventHandlerRegistry::documentDetached(Document& document)
225 { 225 {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 ASSERT(window->frame()); 265 ASSERT(window->frame());
266 ASSERT(window->frame()->host()); 266 ASSERT(window->frame()->host());
267 ASSERT(window->frame()->host() == &m_frameHost); 267 ASSERT(window->frame()->host() == &m_frameHost);
268 } 268 }
269 } 269 }
270 } 270 }
271 #endif // ENABLE(ASSERT) 271 #endif // ENABLE(ASSERT)
272 } 272 }
273 273
274 } // namespace blink 274 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698