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

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

Issue 334283004: Rename DOMWindow to LocalDOMWindow (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 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
« no previous file with comments | « Source/core/frame/DeviceSingleWindowEventController.cpp ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/DOMWindow.h" 9 #include "core/frame/LocalDOMWindow.h"
10 #include "core/frame/LocalFrame.h" 10 #include "core/frame/LocalFrame.h"
11 #include "core/html/HTMLFrameOwnerElement.h" 11 #include "core/html/HTMLFrameOwnerElement.h"
12 #include "core/page/Page.h" 12 #include "core/page/Page.h"
13 #include "core/page/scrolling/ScrollingCoordinator.h" 13 #include "core/page/scrolling/ScrollingCoordinator.h"
14 14
15 namespace WebCore { 15 namespace WebCore {
16 16
17 EventHandlerRegistry::EventHandlerRegistry(FrameHost& frameHost) 17 EventHandlerRegistry::EventHandlerRegistry(FrameHost& frameHost)
18 : m_frameHost(frameHost) 18 : m_frameHost(frameHost)
19 { 19 {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 } 183 }
184 184
185 void EventHandlerRegistry::clearWeakMembers(Visitor* visitor) 185 void EventHandlerRegistry::clearWeakMembers(Visitor* visitor)
186 { 186 {
187 Vector<EventTarget*> deadTargets; 187 Vector<EventTarget*> deadTargets;
188 for (size_t i = 0; i < EventHandlerClassCount; ++i) { 188 for (size_t i = 0; i < EventHandlerClassCount; ++i) {
189 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); 189 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
190 const EventTargetSet* targets = &m_targets[handlerClass]; 190 const EventTargetSet* targets = &m_targets[handlerClass];
191 for (EventTargetSet::const_iterator it = targets->begin(); it != targets ->end(); ++it) { 191 for (EventTargetSet::const_iterator it = targets->begin(); it != targets ->end(); ++it) {
192 Node* node = it->key->toNode(); 192 Node* node = it->key->toNode();
193 DOMWindow* window = it->key->toDOMWindow(); 193 LocalDOMWindow* window = it->key->toDOMWindow();
194 if (node && !visitor->isAlive(node)) { 194 if (node && !visitor->isAlive(node)) {
195 deadTargets.append(node); 195 deadTargets.append(node);
196 } else if (window && !visitor->isAlive(window)) { 196 } else if (window && !visitor->isAlive(window)) {
197 deadTargets.append(window); 197 deadTargets.append(window);
198 } 198 }
199 } 199 }
200 } 200 }
201 for (size_t i = 0; i < deadTargets.size(); ++i) 201 for (size_t i = 0; i < deadTargets.size(); ++i)
202 didRemoveAllEventHandlers(*deadTargets[i]); 202 didRemoveAllEventHandlers(*deadTargets[i]);
203 } 203 }
(...skipping 29 matching lines...) Expand all
233 { 233 {
234 #if ASSERT_ENABLED 234 #if ASSERT_ENABLED
235 for (size_t i = 0; i < EventHandlerClassCount; ++i) { 235 for (size_t i = 0; i < EventHandlerClassCount; ++i) {
236 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); 236 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
237 const EventTargetSet* targets = &m_targets[handlerClass]; 237 const EventTargetSet* targets = &m_targets[handlerClass];
238 for (EventTargetSet::const_iterator iter = targets->begin(); iter != tar gets->end(); ++iter) { 238 for (EventTargetSet::const_iterator iter = targets->begin(); iter != tar gets->end(); ++iter) {
239 if (Node* node = iter->key->toNode()) { 239 if (Node* node = iter->key->toNode()) {
240 // See the comment for |documentDetached| if either of these ass ertions fails. 240 // See the comment for |documentDetached| if either of these ass ertions fails.
241 ASSERT(node->document().frameHost()); 241 ASSERT(node->document().frameHost());
242 ASSERT(node->document().frameHost() == &m_frameHost); 242 ASSERT(node->document().frameHost() == &m_frameHost);
243 } else if (DOMWindow* window = iter->key->toDOMWindow()) { 243 } else if (LocalDOMWindow* window = iter->key->toDOMWindow()) {
244 // If any of these assertions fail, DOMWindow failed to unregist er its handlers 244 // If any of these assertions fail, LocalDOMWindow failed to unr egister its handlers
245 // properly. 245 // properly.
246 ASSERT(window->frame()); 246 ASSERT(window->frame());
247 ASSERT(window->frame()->host()); 247 ASSERT(window->frame()->host());
248 ASSERT(window->frame()->host() == &m_frameHost); 248 ASSERT(window->frame()->host() == &m_frameHost);
249 } 249 }
250 } 250 }
251 } 251 }
252 #endif // ASSERT_ENABLED 252 #endif // ASSERT_ENABLED
253 } 253 }
254 254
255 } // namespace WebCore 255 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/DeviceSingleWindowEventController.cpp ('k') | Source/core/frame/Frame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698