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
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc
index d08b0c7..7497cc63 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 @@
   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 @@
   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 @@
       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));
 }