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