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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptEventListener.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/bindings/core/v8/ScriptEventListener.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptEventListener.cpp
index bea689d209f431c190aadf7a1f775c4a778ded85..80aa44dd7260023439ec109d05cb3663f05c7b95 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptEventListener.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptEventListener.cpp
@@ -30,8 +30,10 @@
#include "bindings/core/v8/ScriptEventListener.h"
+#include "bindings/core/v8/ScheduledAction.h"
#include "bindings/core/v8/ScriptController.h"
#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/SourceLocation.h"
#include "bindings/core/v8/V8AbstractEventListener.h"
#include "bindings/core/v8/V8Binding.h"
#include "bindings/core/v8/WindowProxy.h"
@@ -144,4 +146,17 @@ void getFunctionLocation(v8::Local<v8::Function> function,
columnNumber = function->GetScriptColumnNumber();
}
+std::unique_ptr<SourceLocation> getFunctionLocation(
+ ExecutionContext* executionContext,
+ EventListener* listener) {
+ v8::Isolate* isolate = toIsolate(executionContext);
+ v8::HandleScope handleScope(isolate);
+ v8::Local<v8::Object> handler =
+ eventListenerHandler(executionContext, listener);
+ if (handler.IsEmpty())
+ return nullptr;
+ return SourceLocation::fromFunction(
+ eventListenerEffectiveFunction(isolate, handler));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698