Chromium Code Reviews| Index: Source/core/inspector/InjectedScript.cpp | 
| diff --git a/Source/core/inspector/InjectedScript.cpp b/Source/core/inspector/InjectedScript.cpp | 
| index c6c60548a54dcdbbea5484f9db9625c0ce8680f7..0b03039933ce386c3db31bc89baa1ef913181b16 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) | 
| +{ | 
| + ScriptValue result = callMethod("frameworkUserEventListeners", object); | 
| + return !result.isEmpty() ? result.v8Value().As<v8::Array>() : v8::Local<v8::Array>(); | 
| +} | 
| + | 
| +v8::Local<v8::Set> InjectedScript::frameworkInternalEventHandlers(v8::Local<v8::Value> object) | 
| +{ | 
| + ScriptValue result = callMethod("frameworkInternalEventHandlers", object); | 
| + return !result.isEmpty() ? result.v8Value().As<v8::Set>() : v8::Local<v8::Set>(); | 
| +} | 
| + | 
| void InjectedScript::initialize(ScriptValue injectedScriptObject, InspectedStateAccessCheck accessCheck) | 
| { | 
| m_injectedScriptObject = injectedScriptObject; | 
| @@ -538,5 +550,16 @@ void InjectedScript::makeCallWithExceptionDetails(ScriptFunctionCall& function, | 
| } | 
| } | 
| +ScriptValue InjectedScript::callMethod(String methodName, v8::Local<v8::Value> argument) | 
| +{ | 
| + ScriptFunctionCall function(injectedScriptObject(), methodName); | 
| + function.appendArgument(argument); | 
| + bool hadException = false; | 
| + ScriptValue result = callFunctionWithEvalEnabled(function, hadException); | 
| + if (!hadException && !result.isEmpty()) | 
| 
 
yurys
2015/08/14 17:24:20
Can we simply return result.v8Value()?
 
kozy
2015/08/14 18:15:45
Done.
 
 | 
| + return result; | 
| + return ScriptValue(); | 
| +} | 
| + | 
| } // namespace blink |