Chromium Code Reviews| 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) |