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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp

Issue 1949793002: Emit a console warning when blocking event listener is delayed for too long (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 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/core/inspector/InspectorDOMDebuggerAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
index 743c452559ad8112d1288fccab97a26c37f742b3..328319a95f53cd52516f211d98a3c497736dd51e 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMDebuggerAgent.cpp
@@ -57,6 +57,14 @@ static const char instrumentationEventCategoryType[] = "instrumentation:";
const uint32_t inheritableDOMBreakpointTypesMask = (1 << SubtreeModified);
const int domBreakpointDerivedTypeShift = 16;
+void getFunctionLocation(v8::Local<v8::Function> function, String& scriptId, int& lineNumber, int& columnNumber)
+{
+ int scriptIdValue = function->ScriptId();
+ scriptId = String::number(scriptIdValue);
+ lineNumber = function->GetScriptLineNumber();
+ columnNumber = function->GetScriptColumnNumber();
+}
+
} // namespace
namespace blink {
@@ -111,6 +119,25 @@ void InspectorDOMDebuggerAgent::eventListenersInfoForTarget(v8::Isolate* isolate
}
}
+v8::Local<v8::Function> InspectorDOMDebuggerAgent::eventListenerEffectiveFunction(v8::Isolate* isolate, v8::Local<v8::Object> handler)
+{
+ v8::Local<v8::Function> function;
pfeldman 2016/05/04 22:58:01 Is this change related? Extract?
+ if (handler->IsFunction()) {
+ function = handler.As<v8::Function>();
+ } else if (handler->IsObject()) {
+ v8::Local<v8::Value> property;
+ // Try the "handleEvent" method (EventListener interface).
+ if (handler->Get(handler->CreationContext(), v8AtomicString(isolate, "handleEvent")).ToLocal(&property) && property->IsFunction())
+ function = property.As<v8::Function>();
+ // Fall back to the "constructor" property.
+ else if (handler->Get(handler->CreationContext(), v8AtomicString(isolate, "constructor")).ToLocal(&property) && property->IsFunction())
+ function = property.As<v8::Function>();
+ }
+ if (!function.IsEmpty())
+ return getBoundFunction(function);
+ return v8::Local<v8::Function>();
+}
+
InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent(v8::Isolate* isolate, InspectorDOMAgent* domAgent, V8InspectorSession* v8Session)
: InspectorBaseAgent<InspectorDOMDebuggerAgent, protocol::Frontend::DOMDebugger>("DOMDebugger")
, m_isolate(isolate)

Powered by Google App Engine
This is Rietveld 408576698