OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_PUBLIC_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ | |
6 #define CONTENT_PUBLIC_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback_forward.h" | |
11 | |
12 namespace net { | |
13 class URLRequestContextGetter; | |
14 } | |
15 | |
16 namespace content { | |
17 | |
18 class DevToolsHttpHandlerDelegate; | |
19 | |
20 // This class controls Developer Tools remote debugging server. | |
21 class DevToolsServer { | |
22 public: | |
23 // A callback being called each time the server restarts. | |
24 // The delegate instance is deleted on server stop, so the creator must | |
25 // provide the new instance on each call. | |
26 typedef base::Callback<content::DevToolsHttpHandlerDelegate*(void)> | |
27 DelegateCreator; | |
28 | |
29 // Returns the singleton instance (and initializes it if necessary). | |
30 static DevToolsServer* GetInstance(); | |
31 | |
32 // Initializes the server. Must be called prior to the first call of |Start|. | |
33 virtual void Init(const std::string& frontend_version, | |
34 net::URLRequestContextGetter* url_request_context, | |
35 const DelegateCreator& delegate_creator) = 0; | |
36 | |
37 // Opens linux abstract socket to be ready for remote debugging. | |
38 virtual void Start() = 0; | |
39 | |
40 // Closes debugging socket, stops debugging. | |
41 virtual void Stop() = 0; | |
42 | |
43 virtual bool IsInitialized() const = 0; | |
44 | |
45 virtual bool IsStarted() const = 0; | |
46 | |
47 protected: | |
48 virtual ~DevToolsServer() {} | |
49 }; | |
50 | |
51 } // namespace content | |
52 | |
53 #endif // CONTENT_PUBLIC_BROWSER_ANDROID_DEVTOOLS_SERVER_H_ | |
OLD | NEW |