Chromium Code Reviews| Index: Source/core/inspector/InjectedScript.cpp |
| diff --git a/Source/core/inspector/InjectedScript.cpp b/Source/core/inspector/InjectedScript.cpp |
| index d3191984f52a56d211456af04daf61352165009c..106496c9aebd3609484908b1c88c832ee913c44b 100644 |
| --- a/Source/core/inspector/InjectedScript.cpp |
| +++ b/Source/core/inspector/InjectedScript.cpp |
| @@ -257,6 +257,21 @@ Node* InjectedScript::nodeForObjectId(const String& objectId) |
| return InjectedScriptHost::scriptValueAsNode(scriptState(), resultValue); |
| } |
| +EventTarget* InjectedScript::eventTargetForObjectId(const String& objectId) |
| +{ |
| + if (isEmpty() || !canAccessInspectedWindow()) |
| + return nullptr; |
| + |
| + ScriptFunctionCall function(injectedScriptObject(), "findObjectById"); |
|
pfeldman
2015/04/10 08:45:11
Just use InjectedScript::findObjectById, there is
kozy
2015/04/13 14:26:53
Done.
|
| + function.appendArgument(objectId); |
| + |
| + bool hadException = false; |
| + ScriptValue resultValue = callFunctionWithEvalEnabled(function, hadException); |
| + ASSERT(!hadException); |
| + |
| + return InjectedScriptHost::scriptValueAsEventTarget(scriptState(), resultValue); |
| +} |
| + |
| void InjectedScript::releaseObject(const String& objectId) |
| { |
| RefPtr<JSONValue> parsedObjectId = parseJSON(objectId); |