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

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

Issue 2873713002: [DevTools] added creation stack for event listeners without scheduled stack
Patch Set: Created 3 years, 7 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
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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return AddEventListenerInternal(event_type, listener, options); 283 return AddEventListenerInternal(event_type, listener, options);
284 } 284 }
285 285
286 bool EventTarget::AddEventListenerInternal( 286 bool EventTarget::AddEventListenerInternal(
287 const AtomicString& event_type, 287 const AtomicString& event_type,
288 EventListener* listener, 288 EventListener* listener,
289 const AddEventListenerOptionsResolved& options) { 289 const AddEventListenerOptionsResolved& options) {
290 if (!listener) 290 if (!listener)
291 return false; 291 return false;
292 292
293 probe::AsyncTaskScheduled(GetExecutionContext(), event_type, listener);
294
293 V8DOMActivityLogger* activity_logger = 295 V8DOMActivityLogger* activity_logger =
294 V8DOMActivityLogger::CurrentActivityLoggerIfIsolatedWorld(); 296 V8DOMActivityLogger::CurrentActivityLoggerIfIsolatedWorld();
295 if (activity_logger) { 297 if (activity_logger) {
296 Vector<String> argv; 298 Vector<String> argv;
297 argv.push_back(ToNode() ? ToNode()->nodeName() : InterfaceName()); 299 argv.push_back(ToNode() ? ToNode()->nodeName() : InterfaceName());
298 argv.push_back(event_type); 300 argv.push_back(event_type);
299 activity_logger->LogEvent("blinkAddEventListener", argv.size(), 301 activity_logger->LogEvent("blinkAddEventListener", argv.size(),
300 argv.data()); 302 argv.data());
301 } 303 }
302 304
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
702 704
703 // If stopImmediatePropagation has been called, we just break out 705 // If stopImmediatePropagation has been called, we just break out
704 // immediately, without handling any more events on this target. 706 // immediately, without handling any more events on this target.
705 if (event->ImmediatePropagationStopped()) 707 if (event->ImmediatePropagationStopped())
706 break; 708 break;
707 709
708 event->SetHandlingPassive(EventPassiveMode(registered_listener)); 710 event->SetHandlingPassive(EventPassiveMode(registered_listener));
709 bool passive_forced = registered_listener.PassiveForcedForDocumentTarget(); 711 bool passive_forced = registered_listener.PassiveForcedForDocumentTarget();
710 712
711 probe::UserCallback probe(context, nullptr, event->type(), false, this); 713 probe::UserCallback probe(context, nullptr, event->type(), false, this);
714 probe::AsyncTask async_task(context, listener, "Event Listener called");
712 715
713 // To match Mozilla, the AT_TARGET phase fires both capturing and bubbling 716 // To match Mozilla, the AT_TARGET phase fires both capturing and bubbling
714 // event listeners, even though that violates some versions of the DOM spec. 717 // event listeners, even though that violates some versions of the DOM spec.
715 listener->handleEvent(context, event); 718 listener->handleEvent(context, event);
716 fired_listener = true; 719 fired_listener = true;
717 720
718 // If we're about to report this event listener as blocking, make sure it 721 // If we're about to report this event listener as blocking, make sure it
719 // wasn't removed while handling the event. 722 // wasn't removed while handling the event.
720 if (should_report_blocked_event && i > 0 && 723 if (should_report_blocked_event && i > 0 &&
721 entry[i - 1].Listener() == listener && !entry[i - 1].Passive() && 724 entry[i - 1].Listener() == listener && !entry[i - 1].Passive() &&
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
775 // they have one less listener to invoke. 778 // they have one less listener to invoke.
776 if (d->firing_event_iterators) { 779 if (d->firing_event_iterators) {
777 for (const auto& iterator : *d->firing_event_iterators) { 780 for (const auto& iterator : *d->firing_event_iterators) {
778 iterator.iterator = 0; 781 iterator.iterator = 0;
779 iterator.end = 0; 782 iterator.end = 0;
780 } 783 }
781 } 784 }
782 } 785 }
783 786
784 } // namespace blink 787 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698