Index: Source/core/inspector/InjectedScript.cpp |
diff --git a/Source/core/inspector/InjectedScript.cpp b/Source/core/inspector/InjectedScript.cpp |
index c6c60548a54dcdbbea5484f9db9625c0ce8680f7..1558957d766cecb18b4e8ab9f167d5e4caf03d92 100644 |
--- a/Source/core/inspector/InjectedScript.cpp |
+++ b/Source/core/inspector/InjectedScript.cpp |
@@ -35,6 +35,7 @@ |
#include "bindings/core/v8/ScriptFunctionCall.h" |
#include "bindings/core/v8/V8Binding.h" |
+#include "bindings/core/v8/V8Node.h" |
yurys
2015/08/12 21:56:03
Please don't add dependencies on Blink concepts in
|
#include "core/inspector/InjectedScriptHost.h" |
#include "core/inspector/InspectorInstrumentation.h" |
#include "core/inspector/InspectorTraceEvents.h" |
@@ -334,6 +335,36 @@ void InjectedScript::releaseObject(const String& objectId) |
m_native->unbind(boundId); |
} |
+v8::MaybeLocal<v8::Array> InjectedScript::frameworkEventListeners(v8::Local<v8::Value> object) |
+{ |
+ v8::Isolate* isolate = injectedScriptObject().isolate(); |
+ if (!object.IsEmpty() && V8Node::hasInstance(object, isolate)) { |
yurys
2015/08/12 21:56:03
prefer early return
|
+ ScriptFunctionCall function(injectedScriptObject(), "frameworkEventListeners"); |
+ function.appendArgument(object); |
+ bool hadException = false; |
+ ScriptValue result = callFunctionWithEvalEnabled(function, hadException); |
+ if (!hadException && !result.isEmpty()) |
+ return result.v8Value().As<v8::Array>(); |
+ } |
+ return v8::MaybeLocal<v8::Array>(); |
+} |
+ |
+ |
+v8::MaybeLocal<v8::Set> InjectedScript::frameworkEventHandlers(v8::Local<v8::Value> object) |
yurys
2015/08/12 21:56:03
Please use Local<> instead as the exception is not
|
+{ |
+ v8::Isolate* isolate = injectedScriptObject().isolate(); |
+ if (!object.IsEmpty() && V8Node::hasInstance(object, isolate)) { |
+ ScriptFunctionCall function(injectedScriptObject(), "frameworkEventHandlers"); |
yurys
2015/08/12 21:56:03
Please extract common code into a method.
|
+ function.appendArgument(object); |
+ bool hadException = false; |
+ ScriptValue result = callFunctionWithEvalEnabled(function, hadException); |
+ if (!hadException && !result.isEmpty()) |
+ return result.v8Value().As<v8::Set>(); |
+ } |
+ return v8::MaybeLocal<v8::Set>(); |
+} |
+ |
+ |
PassRefPtr<Array<CallFrame>> InjectedScript::wrapCallFrames(v8::Local<v8::Object> callFrames, int asyncOrdinal) |
{ |
ASSERT(!isEmpty()); |