From 14bd3b14f60343740a21e2ce5ae1f35644f7f4ac Mon Sep 17 00:00:00 2001 From: "yurys@chromium.org" Date: Sun, 31 Jan 2010 08:31:08 +0000 Subject: Revert "DevTools: load injected script using WebKit API" TBR=pfeldman Review URL: http://codereview.chromium.org/558064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37660 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/devtools/debugger_agent_impl.cc | 8 ++++++++ webkit/glue/webdevtoolsagent_impl.cc | 16 ---------------- webkit/glue/webdevtoolsagent_impl.h | 1 - 3 files changed, 8 insertions(+), 17 deletions(-) (limited to 'webkit') 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::PersistentSet(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); -- cgit v1.1