Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(645)

Side by Side Diff: content/browser/android/devtools_server.h

Issue 10540094: Add RemoteDebuggingController.java and its (native) dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_BROWSER_ANDROID_DEVTOOLS_SERVER_H_
6 #define CONTENT_BROWSER_ANDROID_DEVTOOLS_SERVER_H_
John Grabowski 2012/06/11 20:17:02 Does ContentShell support the devtools?
mnaganov (inactive) 2012/06/11 21:32:44 Chromium's content_shell supports it. I haven't lo
John Grabowski 2012/06/11 23:17:14 Thanks for the note. In our internal repo, it loo
Philippe 2012/06/13 15:21:12 Is that reasonable if externally we move it to con
John Grabowski 2012/06/13 19:54:10 Reasonable? Perhaps, but I still think we should
mnaganov (inactive) 2012/06/18 10:18:54 I think, the TODO doesn't imply that the target wi
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/callback_forward.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/singleton.h"
14
15 namespace content {
16 class DevToolsHttpHandler;
17 class DevToolsHttpHandlerDelegate;
18 }
19
20 namespace net {
21 class URLRequestContextGetter;
22 };
23
24 // This class controls Chrome Developer Tools remote debugging server.
John Grabowski 2012/06/11 20:17:02 namespace content {
Philippe 2012/06/13 15:21:12 Done.
25 class DevToolsServer {
26 public:
27 // A callback being called each time the server restarts.
28 // The delegate instance is deleted on server stop, so the creator must
29 // provide the new instance on each call.
30 typedef base::Callback<content::DevToolsHttpHandlerDelegate*(void)>
31 DelegateCreator;
32
33 // Returns the singleton instance (and initializes it if necessary).
34 static DevToolsServer* GetInstance();
35
36 // Initializes the server. Must be called prior to the first call of |Start|.
37 void Init(const std::string& frontend_version,
38 net::URLRequestContextGetter* url_request_context,
39 const DelegateCreator& delegate_creator);
40
41 // Opens linux abstract socket to be ready for remote debugging.
42 void Start();
43
44 // Closes debugging socket, stops debugging.
45 void Stop();
46
47 bool is_initialized() const {
48 return !frontend_url_.empty() && url_request_context_;
49 }
50
51 bool is_started() const {
52 return protocol_handler_;
53 }
54
55 private:
56 // Obtain an instance via GetInstance().
57 DevToolsServer();
58 friend struct DefaultSingletonTraits<DevToolsServer>;
59 virtual ~DevToolsServer();
60
61 content::DevToolsHttpHandler* protocol_handler_;
62 std::string frontend_url_;
63 net::URLRequestContextGetter* url_request_context_;
64 DelegateCreator delegate_creator_;
65
66 DISALLOW_COPY_AND_ASSIGN(DevToolsServer);
67 };
68
69 #endif // CONTENT_BROWSER_ANDROID_DEVTOOLS_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698