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

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

Issue 1042853004: [DevTools] Event Listeners Sidebar shows window listeners (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed test Created 5 years, 8 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 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);

Powered by Google App Engine
This is Rietveld 408576698