diff options
-rw-r--r-- | chrome/renderer/devtools_agent.cc | 15 | ||||
-rw-r--r-- | chrome/renderer/devtools_agent.h | 2 | ||||
-rw-r--r-- | webkit/glue/devtools/debugger_agent_impl.cc | 8 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.cc | 16 | ||||
-rw-r--r-- | webkit/glue/webdevtoolsagent_impl.h | 1 |
5 files changed, 8 insertions, 34 deletions
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc index 57c2f20..5d5373a 100644 --- a/chrome/renderer/devtools_agent.cc +++ b/chrome/renderer/devtools_agent.cc @@ -8,18 +8,15 @@ #include "chrome/common/render_messages.h" #include "chrome/renderer/devtools_agent_filter.h" #include "chrome/renderer/render_view.h" -#include "grit/webkit_resources.h" #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h" #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsMessageData.h" #include "third_party/WebKit/WebKit/chromium/public/WebPoint.h" #include "third_party/WebKit/WebKit/chromium/public/WebString.h" #include "webkit/glue/devtools/devtools_message_data.h" -#include "webkit/glue/webkit_glue.h" using WebKit::WebDevToolsAgent; using WebKit::WebPoint; using WebKit::WebString; -using WebKit::WebCString; using WebKit::WebVector; using WebKit::WebView; @@ -82,18 +79,6 @@ void DevToolsAgent::runtimeFeatureStateChanged(const WebKit::WebString& feature, enabled)); } -WebCString DevToolsAgent::injectedScriptSource() { - base::StringPiece injectjsWebkit = - webkit_glue::GetDataResource(IDR_DEVTOOLS_INJECT_WEBKIT_JS); - return WebCString(injectjsWebkit.as_string().c_str()); -} - -WebCString DevToolsAgent::injectedScriptDispatcherSource() { - base::StringPiece injectDispatchjs = - webkit_glue::GetDataResource(IDR_DEVTOOLS_INJECT_DISPATCH_JS); - return WebCString(injectDispatchjs.as_string().c_str()); -} - // static DevToolsAgent* DevToolsAgent::FromHostId(int host_id) { std::map<int, DevToolsAgent*>::iterator it = diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h index 64302f9..4d05fe0 100644 --- a/chrome/renderer/devtools_agent.h +++ b/chrome/renderer/devtools_agent.h @@ -45,8 +45,6 @@ class DevToolsAgent : public WebKit::WebDevToolsAgentClient { virtual void forceRepaint(); virtual void runtimeFeatureStateChanged(const WebKit::WebString& feature, bool enabled); - virtual WebKit::WebCString injectedScriptSource(); - virtual WebKit::WebCString injectedScriptDispatcherSource(); // Returns agent instance for its host id. static DevToolsAgent* FromHostId(int host_id); diff --git a/webkit/glue/devtools/debugger_agent_impl.cc b/webkit/glue/devtools/debugger_agent_impl.cc index f58e558..b4b51a1 100644 --- a/webkit/glue/devtools/debugger_agent_impl.cc +++ b/webkit/glue/devtools/debugger_agent_impl.cc @@ -43,10 +43,12 @@ #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; @@ -130,6 +132,12 @@ 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 2e92587..a4fef52 100644 --- a/webkit/glue/webdevtoolsagent_impl.cc +++ b/webkit/glue/webdevtoolsagent_impl.cc @@ -323,21 +323,6 @@ 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"); @@ -393,7 +378,6 @@ 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 e5471cd..263b9d4 100644 --- a/webkit/glue/webdevtoolsagent_impl.h +++ b/webkit/glue/webdevtoolsagent_impl.h @@ -119,7 +119,6 @@ private: void disposeUtilityContext(); void unhideResourcesPanelIfNecessary(); - void compileUtilityScripts(); void initDevToolsAgentHost(); void resetInspectorFrontendProxy(); void setApuAgentEnabled(bool enabled); |