| 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 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class DevToolsHttpHandlerDelegate; | 15 class DevToolsHttpHandlerDelegate; |
| 16 | 16 |
| 17 // This class is used for managing DevTools remote debugging server. | 17 // This class is used for managing DevTools remote debugging server. |
| 18 // Clients can connect to the specified ip:port and start debugging | 18 // Clients can connect to the specified ip:port and start debugging |
| 19 // this browser. | 19 // this browser. |
| 20 class DevToolsHttpHandler { | 20 class DevToolsHttpHandler { |
| 21 public: | 21 public: |
| 22 // Returns frontend resource id for the given resource |name|. |
| 23 CONTENT_EXPORT static int GetFrontendResourceId( |
| 24 const std::string& name); |
| 25 |
| 22 // Takes ownership over |delegate|. | 26 // Takes ownership over |delegate|. |
| 23 CONTENT_EXPORT static DevToolsHttpHandler* Start( | 27 CONTENT_EXPORT static DevToolsHttpHandler* Start( |
| 24 const std::string& ip, | 28 const std::string& ip, |
| 25 int port, | 29 int port, |
| 26 const std::string& frontend_url, | 30 const std::string& frontend_url, |
| 27 DevToolsHttpHandlerDelegate* delegate); | 31 DevToolsHttpHandlerDelegate* delegate); |
| 28 | 32 |
| 29 // Called from the main thread in order to stop protocol handler. | 33 // Called from the main thread in order to stop protocol handler. |
| 30 // Automatically destroys the handler instance. | 34 // Automatically destroys the handler instance. |
| 31 virtual void Stop() = 0; | 35 virtual void Stop() = 0; |
| 32 | 36 |
| 33 protected: | 37 protected: |
| 34 virtual ~DevToolsHttpHandler() {} | 38 virtual ~DevToolsHttpHandler() {} |
| 35 }; | 39 }; |
| 36 | 40 |
| 37 } // namespace content | 41 } // namespace content |
| 38 | 42 |
| 39 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ | 43 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_HTTP_HANDLER_H_ |
| OLD | NEW |