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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp

Issue 2873713002: [DevTools] added creation stack for event listeners without scheduled stack
Patch Set: added a test 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
index ad844fa998c4c7a6487405d239eace46c462ff04..3b207e40739c8a899e235344eb256e638836b882 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
@@ -39,6 +39,7 @@
#include "core/dom/ExecutionContext.h"
#include "core/events/BeforeUnloadEvent.h"
#include "core/events/Event.h"
+#include "core/probe/CoreProbes.h"
#include "core/workers/WorkerGlobalScope.h"
#include "platform/InstanceCounters.h"
#include "platform/bindings/V8PrivateProperty.h"
@@ -60,9 +61,12 @@ V8AbstractEventListener::V8AbstractEventListener(bool is_attribute,
else
worker_global_scope_ =
ToWorkerGlobalScope(CurrentExecutionContext(isolate));
+ probe::AsyncTaskScheduled(CurrentExecutionContext(isolate), "Event Listener",
dgozman 2017/05/10 18:36:30 Can we have an event name? I really liked it. E.g.
kozy 2017/05/10 21:24:01 Done.
+ this);
}
V8AbstractEventListener::~V8AbstractEventListener() {
+ probe::AsyncTaskCanceled(CurrentExecutionContext(isolate_), this);
dgozman 2017/05/10 18:36:30 I am worried CurrentExecutionContext() could be wr
kozy 2017/05/10 21:24:00 Done.
DCHECK(listener_.IsEmpty());
if (IsMainThread())
InstanceCounters::DecrementCounter(
@@ -142,6 +146,8 @@ void V8AbstractEventListener::InvokeEventHandler(
event_symbol.Set(global, js_event);
try_catch.Reset();
+ probe::AsyncTask async_task(ExecutionContext::From(script_state), this,
+ "Event Listener called", true, true);
return_value = CallListenerFunction(script_state, js_event, event);
if (try_catch.HasCaught())
event->target()->UncaughtExceptionInEventHandler();

Powered by Google App Engine
This is Rietveld 408576698