summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 12:47:13 +0000
committeryurys@chromium.org <yurys@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 12:47:13 +0000
commitd4d415edb34c9159422d57653f8c79eb87ce771c (patch)
treea724f5424d109e2b6e548110ba0a0b617fc482b9
parent161c5ccadb26629f9f8b526f5a6f607e56b2fbde (diff)
downloadchromium_src-d4d415edb34c9159422d57653f8c79eb87ce771c.zip
chromium_src-d4d415edb34c9159422d57653f8c79eb87ce771c.tar.gz
chromium_src-d4d415edb34c9159422d57653f8c79eb87ce771c.tar.bz2
Add implementation for WebDevToolsAgentClient::debuggerScriptSource.
To be able to stop on top-level breakpoints We need to enable javascript debugger before any scripts are executed. That's why DebuggerScript.js contents should be retrieved synchronously. Review URL: http://codereview.chromium.org/2609001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49045 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/devtools_agent.cc10
-rw-r--r--chrome/renderer/devtools_agent.h1
-rw-r--r--webkit/support/platform_support_win.cc1
-rw-r--r--webkit/tools/test_shell/test_shell_devtools_agent.cc6
-rw-r--r--webkit/tools/test_shell/test_shell_devtools_agent.h1
-rw-r--r--webkit/tools/test_shell/test_shell_win.cc1
6 files changed, 18 insertions, 2 deletions
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc
index a7f02de..a1e2e8e 100644
--- a/chrome/renderer/devtools_agent.cc
+++ b/chrome/renderer/devtools_agent.cc
@@ -30,7 +30,7 @@ namespace {
class WebKitClientMessageLoopImpl
: public WebDevToolsAgentClient::WebKitClientMessageLoop {
-public:
+ public:
WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { }
virtual ~WebKitClientMessageLoopImpl() {
message_loop_ = NULL;
@@ -44,7 +44,7 @@ public:
virtual void quitNow() {
message_loop_->QuitNow();
}
-private:
+ private:
MessageLoop* message_loop_;
};
@@ -124,6 +124,12 @@ WebCString DevToolsAgent::injectedScriptDispatcherSource() {
return WebCString(injectDispatchjs.as_string().c_str());
}
+WebCString DevToolsAgent::debuggerScriptSource() {
+ base::StringPiece debuggerScriptjs =
+ webkit_glue::GetDataResource(IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS);
+ return WebCString(debuggerScriptjs.as_string().c_str());
+}
+
WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
DevToolsAgent::createClientMessageLoop() {
return new WebKitClientMessageLoopImpl();
diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h
index 8ae9099..23fa10c 100644
--- a/chrome/renderer/devtools_agent.h
+++ b/chrome/renderer/devtools_agent.h
@@ -47,6 +47,7 @@ class DevToolsAgent : public WebKit::WebDevToolsAgentClient {
bool enabled);
virtual WebKit::WebCString injectedScriptSource();
virtual WebKit::WebCString injectedScriptDispatcherSource();
+ virtual WebKit::WebCString debuggerScriptSource();
virtual WebKit::WebDevToolsAgentClient::WebKitClientMessageLoop*
createClientMessageLoop();
virtual bool exposeV8DebuggerProtocol();
diff --git a/webkit/support/platform_support_win.cc b/webkit/support/platform_support_win.cc
index a7c264b..a08efe6 100644
--- a/webkit/support/platform_support_win.cc
+++ b/webkit/support/platform_support_win.cc
@@ -114,6 +114,7 @@ base::StringPiece GetDataResource(int resource_id) {
case IDR_MEDIA_VOLUME_SLIDER_THUMB:
case IDR_DEVTOOLS_INJECT_WEBKIT_JS:
case IDR_DEVTOOLS_INJECT_DISPATCH_JS:
+ case IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS:
return NetResourceProvider(resource_id);
default:
diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.cc b/webkit/tools/test_shell/test_shell_devtools_agent.cc
index eeec750..d2035f8 100644
--- a/webkit/tools/test_shell/test_shell_devtools_agent.cc
+++ b/webkit/tools/test_shell/test_shell_devtools_agent.cc
@@ -72,6 +72,12 @@ WebCString TestShellDevToolsAgent::injectedScriptDispatcherSource() {
return WebCString(injectDispatchjs.as_string().c_str());
}
+WebCString TestShellDevToolsAgent::debuggerScriptSource() {
+ base::StringPiece debuggerScriptjs =
+ webkit_glue::GetDataResource(IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS);
+ return WebCString(debuggerScriptjs.as_string().c_str());
+}
+
void TestShellDevToolsAgent::AsyncCall(const TestShellDevToolsCallArgs &args) {
MessageLoop::current()->PostDelayedTask(
FROM_HERE,
diff --git a/webkit/tools/test_shell/test_shell_devtools_agent.h b/webkit/tools/test_shell/test_shell_devtools_agent.h
index 6bde4ca..7c5a2e3 100644
--- a/webkit/tools/test_shell/test_shell_devtools_agent.h
+++ b/webkit/tools/test_shell/test_shell_devtools_agent.h
@@ -35,6 +35,7 @@ class TestShellDevToolsAgent : public WebKit::WebDevToolsAgentClient {
bool enabled);
virtual WebKit::WebCString injectedScriptSource();
virtual WebKit::WebCString injectedScriptDispatcherSource();
+ virtual WebKit::WebCString debuggerScriptSource();
void AsyncCall(const TestShellDevToolsCallArgs& args);
diff --git a/webkit/tools/test_shell/test_shell_win.cc b/webkit/tools/test_shell/test_shell_win.cc
index 8380451..841d724 100644
--- a/webkit/tools/test_shell/test_shell_win.cc
+++ b/webkit/tools/test_shell/test_shell_win.cc
@@ -784,6 +784,7 @@ base::StringPiece GetDataResource(int resource_id) {
case IDR_MEDIA_VOLUME_SLIDER_THUMB:
case IDR_DEVTOOLS_INJECT_WEBKIT_JS:
case IDR_DEVTOOLS_INJECT_DISPATCH_JS:
+ case IDR_DEVTOOLS_DEBUGGER_SCRIPT_JS:
return NetResourceProvider(resource_id);
default: