| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Defines the Chrome Extensions Debugger API functions for attaching debugger | 5 // Defines the Chrome Extensions Debugger API functions for attaching debugger |
| 6 // to the page. | 6 // to the page. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ |
| 9 #define CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 class DevToolsAgentHost; | 28 class DevToolsAgentHost; |
| 29 class WebContents; | 29 class WebContents; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace extensions { | 32 namespace extensions { |
| 33 class ExtensionDevToolsClientHost; | 33 class ExtensionDevToolsClientHost; |
| 34 | 34 |
| 35 class DebuggerFunction : public ChromeAsyncExtensionFunction { | 35 class DebuggerFunction : public ChromeAsyncExtensionFunction { |
| 36 protected: | 36 protected: |
| 37 DebuggerFunction(); | 37 DebuggerFunction(); |
| 38 virtual ~DebuggerFunction(); | 38 ~DebuggerFunction() override; |
| 39 | 39 |
| 40 void FormatErrorMessage(const std::string& format); | 40 void FormatErrorMessage(const std::string& format); |
| 41 | 41 |
| 42 bool InitAgentHost(); | 42 bool InitAgentHost(); |
| 43 bool InitClientHost(); | 43 bool InitClientHost(); |
| 44 | 44 |
| 45 Debuggee debuggee_; | 45 Debuggee debuggee_; |
| 46 scoped_refptr<content::DevToolsAgentHost> agent_host_; | 46 scoped_refptr<content::DevToolsAgentHost> agent_host_; |
| 47 ExtensionDevToolsClientHost* client_host_; | 47 ExtensionDevToolsClientHost* client_host_; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 // Implements the debugger.attach() extension function. | 50 // Implements the debugger.attach() extension function. |
| 51 class DebuggerAttachFunction : public DebuggerFunction { | 51 class DebuggerAttachFunction : public DebuggerFunction { |
| 52 public: | 52 public: |
| 53 DECLARE_EXTENSION_FUNCTION("debugger.attach", DEBUGGER_ATTACH) | 53 DECLARE_EXTENSION_FUNCTION("debugger.attach", DEBUGGER_ATTACH) |
| 54 | 54 |
| 55 DebuggerAttachFunction(); | 55 DebuggerAttachFunction(); |
| 56 | 56 |
| 57 protected: | 57 protected: |
| 58 virtual ~DebuggerAttachFunction(); | 58 ~DebuggerAttachFunction() override; |
| 59 | 59 |
| 60 // ExtensionFunction: | 60 // ExtensionFunction: |
| 61 virtual bool RunAsync() override; | 61 bool RunAsync() override; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 // Implements the debugger.detach() extension function. | 64 // Implements the debugger.detach() extension function. |
| 65 class DebuggerDetachFunction : public DebuggerFunction { | 65 class DebuggerDetachFunction : public DebuggerFunction { |
| 66 public: | 66 public: |
| 67 DECLARE_EXTENSION_FUNCTION("debugger.detach", DEBUGGER_DETACH) | 67 DECLARE_EXTENSION_FUNCTION("debugger.detach", DEBUGGER_DETACH) |
| 68 | 68 |
| 69 DebuggerDetachFunction(); | 69 DebuggerDetachFunction(); |
| 70 | 70 |
| 71 protected: | 71 protected: |
| 72 virtual ~DebuggerDetachFunction(); | 72 ~DebuggerDetachFunction() override; |
| 73 | 73 |
| 74 // ExtensionFunction: | 74 // ExtensionFunction: |
| 75 virtual bool RunAsync() override; | 75 bool RunAsync() override; |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 // Implements the debugger.sendCommand() extension function. | 78 // Implements the debugger.sendCommand() extension function. |
| 79 class DebuggerSendCommandFunction : public DebuggerFunction { | 79 class DebuggerSendCommandFunction : public DebuggerFunction { |
| 80 public: | 80 public: |
| 81 DECLARE_EXTENSION_FUNCTION("debugger.sendCommand", DEBUGGER_SENDCOMMAND) | 81 DECLARE_EXTENSION_FUNCTION("debugger.sendCommand", DEBUGGER_SENDCOMMAND) |
| 82 | 82 |
| 83 DebuggerSendCommandFunction(); | 83 DebuggerSendCommandFunction(); |
| 84 void SendResponseBody(base::DictionaryValue* result); | 84 void SendResponseBody(base::DictionaryValue* result); |
| 85 | 85 |
| 86 protected: | 86 protected: |
| 87 virtual ~DebuggerSendCommandFunction(); | 87 ~DebuggerSendCommandFunction() override; |
| 88 | 88 |
| 89 // ExtensionFunction: | 89 // ExtensionFunction: |
| 90 virtual bool RunAsync() override; | 90 bool RunAsync() override; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 // Implements the debugger.getTargets() extension function. | 93 // Implements the debugger.getTargets() extension function. |
| 94 class DebuggerGetTargetsFunction : public DebuggerFunction { | 94 class DebuggerGetTargetsFunction : public DebuggerFunction { |
| 95 public: | 95 public: |
| 96 DECLARE_EXTENSION_FUNCTION("debugger.getTargets", DEBUGGER_ATTACH) | 96 DECLARE_EXTENSION_FUNCTION("debugger.getTargets", DEBUGGER_ATTACH) |
| 97 | 97 |
| 98 DebuggerGetTargetsFunction(); | 98 DebuggerGetTargetsFunction(); |
| 99 | 99 |
| 100 protected: | 100 protected: |
| 101 virtual ~DebuggerGetTargetsFunction(); | 101 ~DebuggerGetTargetsFunction() override; |
| 102 | 102 |
| 103 // ExtensionFunction: | 103 // ExtensionFunction: |
| 104 virtual bool RunAsync() override; | 104 bool RunAsync() override; |
| 105 | 105 |
| 106 private: | 106 private: |
| 107 void SendTargetList(const std::vector<DevToolsTargetImpl*>& target_list); | 107 void SendTargetList(const std::vector<DevToolsTargetImpl*>& target_list); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace extensions | 110 } // namespace extensions |
| 111 | 111 |
| 112 #endif // CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ | 112 #endif // CHROME_BROWSER_EXTENSIONS_API_DEBUGGER_DEBUGGER_API_H_ |
| OLD | NEW |