Home | History | Annotate | Download | only in debugger
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 // A part of browser-side server debugger exposed to DebuggerWrapper.
      6 
      7 #ifndef CHROME_BROWSER_DEBUGGER_DEBUGGER_HOST_H_
      8 #define CHROME_BROWSER_DEBUGGER_DEBUGGER_HOST_H_
      9 #pragma once
     10 
     11 #include <string>
     12 
     13 #include "base/basictypes.h"
     14 #include "base/memory/ref_counted.h"
     15 
     16 class ListValue;
     17 
     18 class DebuggerHost : public base::RefCountedThreadSafe<DebuggerHost> {
     19  public:
     20   DebuggerHost() {}
     21   virtual ~DebuggerHost() {}
     22 
     23   // call before other methods
     24   virtual void Start() = 0;
     25 
     26   // A message from the V8 debugger in the renderer being debugged via
     27   // RenderViewHost
     28   virtual void DebugMessage(const std::wstring& msg) = 0;
     29   // We've been successfully attached to a renderer.
     30   virtual void OnDebugAttach() = 0;
     31   // The renderer we're attached to is gone.
     32   virtual void OnDebugDisconnect() = 0;
     33 
     34   virtual void DidDisconnect() = 0;
     35   virtual void DidConnect() {}
     36   virtual void ProcessCommand(const std::wstring& data) {}
     37 
     38   // Handles messages from debugger UI.
     39   virtual void OnDebuggerHostMsg(const ListValue* args) {}
     40 
     41   // Shows the debugger UI and returns true if it has any.
     42   virtual bool ShowWindow() { return false; }
     43 
     44  private:
     45 
     46   DISALLOW_COPY_AND_ASSIGN(DebuggerHost);
     47 };
     48 
     49 #endif  // CHROME_BROWSER_DEBUGGER_DEBUGGER_HOST_H_
     50