summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 14:26:40 +0000
committeryurys@google.com <yurys@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-01 14:26:40 +0000
commit24b3b4de275cd9d9970c2f14d47ada7612043b06 (patch)
tree5b1b9da85194666ca1ffb9b13c7672c5724e7129 /chrome
parentb4a2a3064c780cb1a092b192c8badb884eb1544d (diff)
downloadchromium_src-24b3b4de275cd9d9970c2f14d47ada7612043b06.zip
chromium_src-24b3b4de275cd9d9970c2f14d47ada7612043b06.tar.gz
chromium_src-24b3b4de275cd9d9970c2f14d47ada7612043b06.tar.bz2
1. Supported removal of breakpoints from UI.
2. Fixed bug in resume debugger functionality. 3. Implemented pause in debugger. 4. Removed deprecated messages and their handlers. Review URL: http://codereview.chromium.org/60012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12952 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/devtools_agent.cc68
-rw-r--r--chrome/renderer/devtools_agent.h11
-rw-r--r--chrome/renderer/devtools_client.cc6
-rw-r--r--chrome/renderer/devtools_client.h1
-rw-r--r--chrome/renderer/devtools_messages_internal.h22
5 files changed, 1 insertions, 107 deletions
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc
index d08b0c7..7497cc6 100644
--- a/chrome/renderer/devtools_agent.cc
+++ b/chrome/renderer/devtools_agent.cc
@@ -29,8 +29,7 @@
DevToolsAgent::DevToolsAgent(int routing_id,
RenderView* view,
MessageLoop* view_loop)
- : debugger_(NULL),
- routing_id_(routing_id),
+ : routing_id_(routing_id),
view_(view),
view_loop_(view_loop),
channel_(NULL),
@@ -84,10 +83,6 @@ bool DevToolsAgent::OnMessageReceived(const IPC::Message& message) {
IPC_BEGIN_MESSAGE_MAP(DevToolsAgent, message)
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Attach, OnAttach)
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_Detach, OnDetach)
- IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DebugAttach, OnDebugAttach)
- IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DebugDetach, OnDebugDetach)
- IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DebugBreak, OnDebugBreak)
- IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DebugCommand, OnDebugCommand)
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_RpcMessage, OnRpcMessage)
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_DebuggerCommand,
OnDebuggerCommand)
@@ -103,10 +98,6 @@ void DevToolsAgent::OnFilterRemoved() {
channel_ = NULL;
}
-void DevToolsAgent::DebuggerOutput(const std::wstring& out) {
- Send(DevToolsClientMsg_DebuggerOutput(out));
-}
-
void DevToolsAgent::EvaluateScript(const std::wstring& script) {
DCHECK(MessageLoop::current() == view_loop_);
// view_ may have been cleared after this method execution was scheduled.
@@ -124,63 +115,6 @@ void DevToolsAgent::OnDetach() {
this, &DevToolsAgent::Detach));
}
-void DevToolsAgent::OnDebugAttach() {
- DCHECK(MessageLoop::current() == io_loop_);
- if (!debugger_) {
- debugger_ = new DebuggerBridge(this);
- }
-
- debugger_->Attach();
-
- Send(DevToolsClientMsg_DidDebugAttach());
-
- // TODO(yurys): remove this macros once plugins available on other platforms
-#if defined(OS_WIN)
- // Tell the plugin host to stop accepting messages in order to avoid
- // hangs while the renderer is paused.
- // TODO(yurys): It might be an improvement to add more plumbing to do this
- // when the renderer is actually paused vs. just the debugger being attached.
- // http://code.google.com/p/chromium/issues/detail?id=7556
- PluginChannelHost::SetListening(false);
-#endif // OS_WIN
-}
-
-void DevToolsAgent::OnDebugDetach() {
- DCHECK(MessageLoop::current() == io_loop_);
- if (debugger_)
- debugger_->Detach();
- // TODO(yurys): remove this macros once plugins available on other platforms
-#if defined(OS_WIN)
- PluginChannelHost::SetListening(true);
-#endif // OS_WIN
-}
-
-void DevToolsAgent::OnDebugBreak(bool force) {
- DCHECK(MessageLoop::current() == io_loop_);
- // Set the debug break flag in the V8 engine.
- debugger_->Break(force);
-
- // If a forced break has been requested make sure that it will occour by
- // running some JavaScript in the renderer.
- if (force && view_loop_) {
- view_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &DevToolsAgent::EvaluateScript,
- std::wstring(L"javascript:void(0)")));
- }
-}
-
-void DevToolsAgent::OnDebugCommand(const std::wstring& cmd) {
- DCHECK(MessageLoop::current() == io_loop_);
- if (!debugger_) {
- NOTREACHED();
- std::wstring msg =
- StringPrintf(L"before attach, ignored command (%S)", cmd.c_str());
- DebuggerOutput(msg);
- } else {
- debugger_->Command(cmd);
- }
-}
-
void DevToolsAgent::SendMessageToClient(const std::string& raw_msg) {
Send(DevToolsClientMsg_RpcMessage(raw_msg));
}
diff --git a/chrome/renderer/devtools_agent.h b/chrome/renderer/devtools_agent.h
index c5866e5..24bba31 100644
--- a/chrome/renderer/devtools_agent.h
+++ b/chrome/renderer/devtools_agent.h
@@ -12,7 +12,6 @@
#include "base/scoped_ptr.h"
#include "chrome/common/ipc_channel_proxy.h"
#include "chrome/renderer/devtools_messages.h"
-#include "webkit/glue/debugger_bridge.h"
#include "webkit/glue/webdevtoolsagent_delegate.h"
class MessageLoop;
@@ -24,7 +23,6 @@ class WebDevToolsAgent;
// go through browser process. On the renderer side of the tools UI there's
// a corresponding ToolsClient object.
class DevToolsAgent : public IPC::ChannelProxy::MessageFilter,
- public DebuggerBridge::Delegate,
public WebDevToolsAgentDelegate {
public:
// DevToolsAgent is a field of the RenderView. The view is supposed to remove
@@ -52,9 +50,6 @@ class DevToolsAgent : public IPC::ChannelProxy::MessageFilter,
virtual bool OnMessageReceived(const IPC::Message& message);
virtual void OnFilterRemoved();
- // Debugger::Delegate callback method to handle debugger output.
- void DebuggerOutput(const std::wstring& out);
-
void Attach();
void Detach();
void DispatchRpcMessage(const std::string& raw_msg);
@@ -68,16 +63,10 @@ class DevToolsAgent : public IPC::ChannelProxy::MessageFilter,
// handle debug messages even when v8 is stopped.
void OnAttach();
void OnDetach();
- void OnDebugAttach();
- void OnDebugDetach();
- void OnDebugBreak(bool force);
- void OnDebugCommand(const std::wstring& cmd);
void OnRpcMessage(const std::string& raw_msg);
void OnDebuggerCommand(const std::string& command);
void OnInspectElement(int x, int y);
- scoped_refptr<DebuggerBridge> debugger_;
-
int routing_id_; // View routing id that we can access from IO thread.
RenderView* view_;
MessageLoop* view_loop_;
diff --git a/chrome/renderer/devtools_client.cc b/chrome/renderer/devtools_client.cc
index 240fda3..a8a9fbb 100644
--- a/chrome/renderer/devtools_client.cc
+++ b/chrome/renderer/devtools_client.cc
@@ -30,7 +30,6 @@ bool DevToolsClient::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(DevToolsClient, message)
- IPC_MESSAGE_HANDLER(DevToolsClientMsg_DidDebugAttach, DidDebugAttach)
IPC_MESSAGE_HANDLER(DevToolsClientMsg_RpcMessage, OnRpcMessage)
IPC_MESSAGE_UNHANDLED(handled = false);
IPC_END_MESSAGE_MAP()
@@ -38,11 +37,6 @@ bool DevToolsClient::OnMessageReceived(const IPC::Message& message) {
return handled;
}
-void DevToolsClient::DidDebugAttach() {
- DCHECK(RenderThread::current()->message_loop() == MessageLoop::current());
- // TODO(yurys): delegate to JS frontend.
-}
-
void DevToolsClient::SendMessageToAgent(const std::string& raw_msg) {
Send(DevToolsAgentMsg_RpcMessage(raw_msg));
}
diff --git a/chrome/renderer/devtools_client.h b/chrome/renderer/devtools_client.h
index 6e85845..2a6bb9e 100644
--- a/chrome/renderer/devtools_client.h
+++ b/chrome/renderer/devtools_client.h
@@ -38,7 +38,6 @@ class DevToolsClient : public WebDevToolsClientDelegate {
virtual void SendDebuggerCommandToAgent(const std::string& command);
private:
- void DidDebugAttach();
void OnRpcMessage(const std::string& raw_msg);
// Sends message to DevToolsAgent.
diff --git a/chrome/renderer/devtools_messages_internal.h b/chrome/renderer/devtools_messages_internal.h
index fe4ffde..b0e0a8a 100644
--- a/chrome/renderer/devtools_messages_internal.h
+++ b/chrome/renderer/devtools_messages_internal.h
@@ -48,14 +48,6 @@
// browser.
IPC_BEGIN_MESSAGES(DevToolsClient)
- // Response message for DevToolsAgentMsg_DebugAttach.
- IPC_MESSAGE_CONTROL0(DevToolsClientMsg_DidDebugAttach)
-
- // WebKit and JavaScript error messages to log to the console
- // or debugger UI.
- IPC_MESSAGE_CONTROL1(DevToolsClientMsg_DebuggerOutput,
- std::wstring /* msg */)
-
// Sends glue-level Rpc message to the client.
IPC_MESSAGE_CONTROL1(DevToolsClientMsg_RpcMessage,
std::string /* raw_msg */)
@@ -74,20 +66,6 @@ IPC_BEGIN_MESSAGES(DevToolsAgent)
// Tells agent that there is no longer a client host connected to it.
IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_Detach)
- // Initialize the V8 debugger in the renderer.
- IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_DebugAttach)
-
- // Shutdown the V8 debugger in the renderer.
- IPC_MESSAGE_CONTROL0(DevToolsAgentMsg_DebugDetach)
-
- // Break V8 execution.
- IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DebugBreak,
- bool /* force */)
-
- // Send a command to the V8 debugger.
- IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_DebugCommand,
- std::wstring /* cmd */)
-
// Sends glue-level Rpc message to the agent.
IPC_MESSAGE_CONTROL1(DevToolsAgentMsg_RpcMessage,
std::string /* raw_msg */)