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

Side by Side Diff: Source/core/events/EventTarget.cpp

Issue 145133008: DevTools: Make getEventListeners() of Console API work for window. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed Created 6 years, 11 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/events/EventTarget.h ('k') | Source/core/inspector/InjectedScriptHost.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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 if (!d) 356 if (!d)
357 return emptyVector; 357 return emptyVector;
358 358
359 EventListenerVector* listenerVector = d->eventListenerMap.find(eventType); 359 EventListenerVector* listenerVector = d->eventListenerMap.find(eventType);
360 if (!listenerVector) 360 if (!listenerVector)
361 return emptyVector; 361 return emptyVector;
362 362
363 return *listenerVector; 363 return *listenerVector;
364 } 364 }
365 365
366 Vector<AtomicString> EventTarget::eventTypes()
367 {
368 EventTargetData* d = eventTargetData();
369 return d ? d->eventListenerMap.eventTypes() : Vector<AtomicString>();
370 }
371
366 void EventTarget::removeAllEventListeners() 372 void EventTarget::removeAllEventListeners()
367 { 373 {
368 EventTargetData* d = eventTargetData(); 374 EventTargetData* d = eventTargetData();
369 if (!d) 375 if (!d)
370 return; 376 return;
371 d->eventListenerMap.clear(); 377 d->eventListenerMap.clear();
372 InspectorInstrumentation::didRemoveAllEventListeners(this); 378 InspectorInstrumentation::didRemoveAllEventListeners(this);
373 379
374 // Notify firing events planning to invoke the listener at 'index' that 380 // Notify firing events planning to invoke the listener at 'index' that
375 // they have one less listener to invoke. 381 // they have one less listener to invoke.
376 if (d->firingEventIterators) { 382 if (d->firingEventIterators) {
377 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 383 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
378 d->firingEventIterators->at(i).iterator = 0; 384 d->firingEventIterators->at(i).iterator = 0;
379 d->firingEventIterators->at(i).end = 0; 385 d->firingEventIterators->at(i).end = 0;
380 } 386 }
381 } 387 }
382 } 388 }
383 389
384 } // namespace WebCore 390 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/events/EventTarget.h ('k') | Source/core/inspector/InjectedScriptHost.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698