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

Unified Diff: inspector/InspectorBackend.cpp

Issue 542055: DevTools: injected script per context(WebCore part) (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/WebCore/
Patch Set: '' Created 10 years, 11 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
« no previous file with comments | « inspector/InspectorBackend.h ('k') | inspector/InspectorBackend.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: inspector/InspectorBackend.cpp
===================================================================
--- inspector/InspectorBackend.cpp (revision 53180)
+++ inspector/InspectorBackend.cpp (working copy)
@@ -40,6 +40,7 @@
#include "Frame.h"
#include "FrameLoader.h"
#include "HTMLFrameOwnerElement.h"
+#include "InjectedScriptHost.h"
#include "InspectorClient.h"
#include "InspectorController.h"
#include "InspectorDOMAgent.h"
@@ -256,13 +257,31 @@
}
#endif
-void InspectorBackend::dispatchOnInjectedScript(long callId, const String& methodName, const String& arguments, bool async)
+void InspectorBackend::setInjectedScriptSource(const String& source)
{
+ if (m_inspectorController)
+ m_inspectorController->injectedScriptHost()->setInjectedScriptSource(source);
+}
+
+void InspectorBackend::dispatchOnInjectedScript(long callId, long injectedScriptId, const String& methodName, const String& arguments, bool async)
+{
InspectorFrontend* frontend = inspectorFrontend();
if (!frontend)
return;
- ScriptFunctionCall function(m_inspectorController->m_scriptState, m_inspectorController->m_injectedScriptObj, "dispatch");
+ // FIXME: explicitly pass injectedScriptId along with node id to the frontend.
+ bool injectedScriptIdIsNodeId = injectedScriptId <= 0;
+
+ ScriptObject injectedScript;
+ if (injectedScriptIdIsNodeId)
+ injectedScript = m_inspectorController->injectedScriptForNodeId(-injectedScriptId);
+ else
+ injectedScript = m_inspectorController->injectedScriptHost()->injectedScriptForId(injectedScriptId);
+
+ if (injectedScript.hasNoValue())
+ return;
+
+ ScriptFunctionCall function(injectedScript.scriptState(), injectedScript, "dispatch");
function.appendArgument(methodName);
function.appendArgument(arguments);
if (async)
@@ -274,7 +293,7 @@
if (hadException)
frontend->didDispatchOnInjectedScript(callId, "", true);
else
- frontend->didDispatchOnInjectedScript(callId, result.toString(m_inspectorController->m_scriptState), false);
+ frontend->didDispatchOnInjectedScript(callId, result.toString(injectedScript.scriptState()), false);
}
void InspectorBackend::getChildNodes(long callId, long nodeId)
@@ -371,10 +390,11 @@
m_inspectorController->deleteCookie(cookieName, domain);
}
-void InspectorBackend::releaseWrapperObjectGroup(const String& objectGroup)
+void InspectorBackend::releaseWrapperObjectGroup(long injectedScriptId, const String& objectGroup)
{
- if (m_inspectorController)
- m_inspectorController->releaseWrapperObjectGroup(objectGroup);
+ if (!m_inspectorController)
+ return;
+ m_inspectorController->injectedScriptHost()->releaseWrapperObjectGroup(injectedScriptId, objectGroup);
}
void InspectorBackend::didEvaluateForTestInFrontend(long callId, const String& jsonResult)
« no previous file with comments | « inspector/InspectorBackend.h ('k') | inspector/InspectorBackend.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698