summaryrefslogtreecommitdiffstats
path: root/webkit/glue
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/glue')
-rw-r--r--webkit/glue/devtools/debugger_agent_impl.cc8
-rw-r--r--webkit/glue/webdevtoolsagent_impl.cc16
-rw-r--r--webkit/glue/webdevtoolsagent_impl.h1
3 files changed, 17 insertions, 8 deletions
diff --git a/webkit/glue/devtools/debugger_agent_impl.cc b/webkit/glue/devtools/debugger_agent_impl.cc
index b4b51a1..f58e558 100644
--- a/webkit/glue/devtools/debugger_agent_impl.cc
+++ b/webkit/glue/devtools/debugger_agent_impl.cc
@@ -43,12 +43,10 @@
#include "V8Proxy.h"
#undef LOG
-#include "grit/webkit_resources.h"
#include "third_party/WebKit/WebKit/chromium/src/WebViewImpl.h"
#include "webkit/glue/devtools/debugger_agent_impl.h"
#include "webkit/glue/devtools/debugger_agent_manager.h"
#include "webkit/glue/webdevtoolsagent_impl.h"
-#include "webkit/glue/webkit_glue.h"
using WebCore::DOMWindow;
using WebCore::Document;
@@ -132,12 +130,6 @@ void DebuggerAgentImpl::createUtilityContext(Frame* frame, v8::Persistent<v8::Co
// Give the code running in the new context a way to get access to the
// original context.
global->Set(v8::String::New("contentWindow"), windowGlobal);
-
- // Inject javascript into the context.
- base::StringPiece injectjsWebkit = webkit_glue::GetDataResource(IDR_DEVTOOLS_INJECT_WEBKIT_JS);
- v8::Script::Compile(v8::String::New(injectjsWebkit.as_string().c_str()))->Run();
- base::StringPiece injectDispatchjs = webkit_glue::GetDataResource(IDR_DEVTOOLS_INJECT_DISPATCH_JS);
- v8::Script::Compile(v8::String::New(injectDispatchjs.as_string().c_str()))->Run();
}
String DebuggerAgentImpl::executeUtilityFunction(
diff --git a/webkit/glue/webdevtoolsagent_impl.cc b/webkit/glue/webdevtoolsagent_impl.cc
index a4fef52..2e92587 100644
--- a/webkit/glue/webdevtoolsagent_impl.cc
+++ b/webkit/glue/webdevtoolsagent_impl.cc
@@ -323,6 +323,21 @@ void WebDevToolsAgentImpl::sendRpcMessage(const WebKit::WebDevToolsMessageData&
m_client->sendMessageToFrontend(data);
}
+void WebDevToolsAgentImpl::compileUtilityScripts()
+{
+ v8::HandleScope handleScope;
+ v8::Context::Scope contextScope(m_utilityContext);
+ // Inject javascript into the context.
+ WebCString injectedScriptJs = m_client->injectedScriptSource();
+ v8::Script::Compile(v8::String::New(
+ injectedScriptJs.data(),
+ injectedScriptJs.length()))->Run();
+ WebCString injectDispatchJs = m_client->injectedScriptDispatcherSource();
+ v8::Script::Compile(v8::String::New(
+ injectDispatchJs.data(),
+ injectDispatchJs.length()))->Run();
+}
+
void WebDevToolsAgentImpl::initDevToolsAgentHost()
{
BoundObject devtoolsAgentHost(m_utilityContext, this, "DevToolsAgentHost");
@@ -378,6 +393,7 @@ void WebDevToolsAgentImpl::resetInspectorFrontendProxy()
{
disposeUtilityContext();
m_debuggerAgentImpl->createUtilityContext(m_webViewImpl->page()->mainFrame(), &m_utilityContext);
+ compileUtilityScripts();
initDevToolsAgentHost();
v8::HandleScope scope;
diff --git a/webkit/glue/webdevtoolsagent_impl.h b/webkit/glue/webdevtoolsagent_impl.h
index 263b9d4..e5471cd 100644
--- a/webkit/glue/webdevtoolsagent_impl.h
+++ b/webkit/glue/webdevtoolsagent_impl.h
@@ -119,6 +119,7 @@ private:
void disposeUtilityContext();
void unhideResourcesPanelIfNecessary();
+ void compileUtilityScripts();
void initDevToolsAgentHost();
void resetInspectorFrontendProxy();
void setApuAgentEnabled(bool enabled);