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 #ifndef CHROME_BROWSER_ANDROID_DEV_TOOLS_SERVER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ |
6 #define CHROME_BROWSER_ANDROID_DEV_TOOLS_SERVER_H_ | 6 #define CHROME_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 | 14 |
15 namespace devtools_http_handler { | |
16 class DevToolsHttpHandler; | |
17 } | |
18 | |
19 // This class controls Developer Tools remote debugging server. | 15 // This class controls Developer Tools remote debugging server. |
20 class DevToolsServer { | 16 class DevToolsServer { |
21 public: | 17 public: |
22 explicit DevToolsServer(const std::string& socket_name_prefix); | 18 explicit DevToolsServer(const std::string& socket_name_prefix); |
23 ~DevToolsServer(); | 19 ~DevToolsServer(); |
24 | 20 |
25 // Opens linux abstract socket to be ready for remote debugging. | 21 // Opens linux abstract socket to be ready for remote debugging. |
26 void Start(bool allow_debug_permission); | 22 void Start(bool allow_debug_permission); |
27 | 23 |
28 // Closes debugging socket, stops debugging. | 24 // Closes debugging socket, stops debugging. |
29 void Stop(); | 25 void Stop(); |
30 | 26 |
31 bool IsStarted() const; | 27 bool IsStarted() const; |
32 | 28 |
33 private: | 29 private: |
34 std::string socket_name_; | 30 std::string socket_name_; |
35 std::unique_ptr<devtools_http_handler::DevToolsHttpHandler> | 31 bool is_started_; |
36 devtools_http_handler_; | |
37 | 32 |
38 DISALLOW_COPY_AND_ASSIGN(DevToolsServer); | 33 DISALLOW_COPY_AND_ASSIGN(DevToolsServer); |
39 }; | 34 }; |
40 | 35 |
41 bool RegisterDevToolsServer(JNIEnv* env); | 36 bool RegisterDevToolsServer(JNIEnv* env); |
42 | 37 |
43 #endif // CHROME_BROWSER_ANDROID_DEV_TOOLS_SERVER_H_ | 38 #endif // CHROME_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ |
OLD | NEW |