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

Unified Diff: Source/core/inspector/InjectedScript.cpp

Issue 1268353005: [DevTools] Support JQuery event listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 5 years, 4 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: Source/core/inspector/InjectedScript.cpp
diff --git a/Source/core/inspector/InjectedScript.cpp b/Source/core/inspector/InjectedScript.cpp
index c6c60548a54dcdbbea5484f9db9625c0ce8680f7..20d7f2b21089794f079a6fd6e40a024182510607 100644
--- a/Source/core/inspector/InjectedScript.cpp
+++ b/Source/core/inspector/InjectedScript.cpp
@@ -424,6 +424,18 @@ void InjectedScript::setCustomObjectFormatterEnabled(bool enabled)
makeCall(function, &result);
}
+v8::Local<v8::Array> InjectedScript::frameworkUserEventListeners(v8::Local<v8::Value> object)
+{
+ v8::Local<v8::Value> result = callMethod("frameworkUserEventListeners", object);
+ return !result.IsEmpty() ? result.As<v8::Array>() : v8::Local<v8::Array>();
+}
+
+v8::Local<v8::Set> InjectedScript::frameworkInternalEventHandlers(v8::Local<v8::Value> object)
+{
+ v8::Local<v8::Value> result = callMethod("frameworkInternalEventHandlers", object);
+ return !result.IsEmpty() ? result.As<v8::Set>() : v8::Local<v8::Set>();
+}
+
void InjectedScript::initialize(ScriptValue injectedScriptObject, InspectedStateAccessCheck accessCheck)
{
m_injectedScriptObject = injectedScriptObject;
@@ -538,5 +550,14 @@ void InjectedScript::makeCallWithExceptionDetails(ScriptFunctionCall& function,
}
}
+v8::Local<v8::Value> InjectedScript::callMethod(String methodName, v8::Local<v8::Value> argument)
+{
+ ScriptFunctionCall function(injectedScriptObject(), methodName);
+ function.appendArgument(argument);
+ bool hadException = false;
+ ScriptValue result = callFunctionWithEvalEnabled(function, hadException);
+ return !hadException ? result.v8Value() : v8::Local<v8::Value>();
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698