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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2513483002: DevTools: introduce perf monitor actions w/ time budget for violations that are event handlers. (Closed)
Patch Set: expose locations instead of functions Created 4 years, 1 month 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/core/events/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index dc84b28122107b6c925182a3e8f6b5ff1ced7ac1..cf2b87da879835989831f7119d8f6b10982154eb 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -117,15 +117,6 @@ void reportBlockedEvent(ExecutionContext* context,
EventListener::JSEventListenerType)
return;
- V8AbstractEventListener* v8Listener =
- V8AbstractEventListener::cast(registeredListener->listener());
- v8::HandleScope handles(v8Listener->isolate());
- v8::Local<v8::Context> v8Context = toV8Context(context, v8Listener->world());
- if (v8Context.IsEmpty())
- return;
- v8::Context::Scope contextScope(v8Context);
- v8::Local<v8::Object> handler = v8Listener->getListenerObject(context);
-
String messageText = String::format(
"Handling of '%s' input event was delayed for %ld ms due to main thread "
"being busy. "
@@ -133,14 +124,9 @@ void reportBlockedEvent(ExecutionContext* context,
"responsive.",
event->type().getString().utf8().data(), lround(delayedSeconds * 1000));
- v8::Local<v8::Function> function =
- eventListenerEffectiveFunction(v8Listener->isolate(), handler);
- std::unique_ptr<SourceLocation> location =
- SourceLocation::fromFunction(function);
-
PerformanceMonitor::reportGenericViolation(
context, PerformanceMonitor::kBlockedEvent, messageText, delayedSeconds,
- location.get());
+ getFunctionLocation(context, registeredListener->listener()).get());
registeredListener->setBlockedEventWarningEmitted();
}
@@ -698,6 +684,7 @@ bool EventTarget::fireEventListeners(Event* event,
InspectorInstrumentation::NativeBreakpoint nativeBreakpoint(context, this,
event);
+ PerformanceMonitor::HandlerCall handlerCall(context, listener);
// To match Mozilla, the AT_TARGET phase fires both capturing and bubbling
// event listeners, even though that violates some versions of the DOM spec.
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptEventListener.cpp ('k') | third_party/WebKit/Source/core/frame/DOMTimer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698