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

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

Issue 328513004: Introduce use counters for Blink specific editing event usage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-06-11T11:21:22 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
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/frame/UseCounter.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 18 matching lines...) Expand all
29 * 29 *
30 */ 30 */
31 31
32 #include "config.h" 32 #include "config.h"
33 #include "core/events/EventTarget.h" 33 #include "core/events/EventTarget.h"
34 34
35 #include "RuntimeEnabledFeatures.h" 35 #include "RuntimeEnabledFeatures.h"
36 #include "bindings/v8/ExceptionState.h" 36 #include "bindings/v8/ExceptionState.h"
37 #include "core/dom/ExceptionCode.h" 37 #include "core/dom/ExceptionCode.h"
38 #include "core/dom/NoEventDispatchAssertion.h" 38 #include "core/dom/NoEventDispatchAssertion.h"
39 #include "core/editing/Editor.h"
39 #include "core/events/Event.h" 40 #include "core/events/Event.h"
40 #include "core/inspector/InspectorInstrumentation.h" 41 #include "core/inspector/InspectorInstrumentation.h"
41 #include "core/frame/DOMWindow.h" 42 #include "core/frame/DOMWindow.h"
42 #include "wtf/StdLibExtras.h" 43 #include "wtf/StdLibExtras.h"
43 #include "wtf/Vector.h" 44 #include "wtf/Vector.h"
44 45
45 using namespace WTF; 46 using namespace WTF;
46 47
47 namespace WebCore { 48 namespace WebCore {
48 49
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 271
271 if (listenersVector) { 272 if (listenersVector) {
272 fireEventListeners(event, d, *listenersVector); 273 fireEventListeners(event, d, *listenersVector);
273 } else if (legacyListenersVector) { 274 } else if (legacyListenersVector) {
274 AtomicString unprefixedTypeName = event->type(); 275 AtomicString unprefixedTypeName = event->type();
275 event->setType(legacyTypeName); 276 event->setType(legacyTypeName);
276 fireEventListeners(event, d, *legacyListenersVector); 277 fireEventListeners(event, d, *legacyListenersVector);
277 event->setType(unprefixedTypeName); 278 event->setType(unprefixedTypeName);
278 } 279 }
279 280
281 Editor::countEvent(executionContext(), event);
280 countLegacyEvents(legacyTypeName, listenersVector, legacyListenersVector); 282 countLegacyEvents(legacyTypeName, listenersVector, legacyListenersVector);
281 return !event->defaultPrevented(); 283 return !event->defaultPrevented();
282 } 284 }
283 285
284 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList enerVector& entry) 286 void EventTarget::fireEventListeners(Event* event, EventTargetData* d, EventList enerVector& entry)
285 { 287 {
286 RefPtrWillBeRawPtr<EventTarget> protect(this); 288 RefPtrWillBeRawPtr<EventTarget> protect(this);
287 289
288 // Fire all listeners registered for this event. Don't fire listeners remove d 290 // Fire all listeners registered for this event. Don't fire listeners remove d
289 // during event dispatch. Also, don't fire event listeners added during even t 291 // during event dispatch. Also, don't fire event listeners added during even t
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 // they have one less listener to invoke. 372 // they have one less listener to invoke.
371 if (d->firingEventIterators) { 373 if (d->firingEventIterators) {
372 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) { 374 for (size_t i = 0; i < d->firingEventIterators->size(); ++i) {
373 d->firingEventIterators->at(i).iterator = 0; 375 d->firingEventIterators->at(i).iterator = 0;
374 d->firingEventIterators->at(i).end = 0; 376 d->firingEventIterators->at(i).end = 0;
375 } 377 }
376 } 378 }
377 } 379 }
378 380
379 } // namespace WebCore 381 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/Editor.cpp ('k') | Source/core/frame/UseCounter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698