diff options
author | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-31 08:31:08 +0000 |
---|---|---|
committer | yurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-31 08:31:08 +0000 |
commit | 14bd3b14f60343740a21e2ce5ae1f35644f7f4ac (patch) | |
tree | 95ae9e2142ad8ca5a8137569880dccde052d96af /webkit | |
parent | b281b6c0ffcafa4d54737315793db39105bddb6a (diff) | |
download | chromium_src-14bd3b14f60343740a21e2ce5ae1f35644f7f4ac.zip chromium_src-14bd3b14f60343740a21e2ce5ae1f35644f7f4ac.tar.gz chromium_src-14bd3b14f60343740a21e2ce5ae1f35644f7f4ac.tar.bz2 |
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
Diffstat (limited to 'webkit')
-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 |
3 files changed, 8 insertions, 17 deletions
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); |