| Index: Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| diff --git a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| index 91ce8b8bfea0cb01c69d9956479c9dc6e640d601..a64d92af4eeaad96b541ecc97bf3c68ef0bb58d5 100644
|
| --- a/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| +++ b/Source/bindings/core/v8/custom/V8InjectedScriptHostCustom.cpp
|
| @@ -54,6 +54,7 @@
|
| #include "bindings/core/v8/V8ScriptRunner.h"
|
| #include "core/events/EventTarget.h"
|
| #include "core/frame/LocalDOMWindow.h"
|
| +#include "core/inspector/EventListenerInfo.h"
|
| #include "core/inspector/InjectedScript.h"
|
| #include "core/inspector/InjectedScriptHost.h"
|
| #include "core/inspector/InspectorDOMAgent.h"
|
| @@ -80,6 +81,23 @@ ScriptValue InjectedScriptHost::nodeAsScriptValue(ScriptState* scriptState, Node
|
| return ScriptValue(scriptState, toV8(node, scriptState->context()->Global(), isolate));
|
| }
|
|
|
| +EventTarget* InjectedScriptHost::scriptValueAsEventTarget(ScriptState* scriptState, ScriptValue value)
|
| +{
|
| + ScriptState::Scope scope(scriptState);
|
| + if (!value.isObject() || value.isNull())
|
| + return nullptr;
|
| + v8::Isolate* isolate = scriptState->isolate();
|
| + EventTarget* target = V8EventTarget::toImplWithTypeCheck(isolate, v8::Local<v8::Object>::Cast(value.v8Value()));
|
| +
|
| + // We need to handle a LocalDOMWindow specially, because a LocalDOMWindow wrapper exists on a prototype chain.
|
| + if (!target)
|
| + target = toDOMWindow(isolate, v8::Local<v8::Object>::Cast(value.v8Value()));
|
| +
|
| + if (!target || !target->executionContext())
|
| + return nullptr;
|
| + return target;
|
| +}
|
| +
|
| void V8InjectedScriptHost::inspectedObjectMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
|
| {
|
| if (info.Length() < 1)
|
|
|