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_BROWSER_DEBUGGER_DEVTOOLS_BROWSER_TARGET_H_ | |
6 #define CONTENT_BROWSER_DEBUGGER_DEVTOOLS_BROWSER_TARGET_H_ | |
7 | |
8 #include <map> | |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | |
12 | |
13 namespace base { | |
14 | |
15 class DictionaryValue; | |
16 class Value; | |
17 | |
18 } // namespace base | |
19 | |
20 namespace content { | |
21 | |
22 // This class handles the "Browser" target for remote debugging. | |
23 class DevToolsBrowserTarget { | |
24 public: | |
25 class Handler { | |
26 public: | |
27 // |return_value| ownership is transferred to the caller. | |
28 virtual base::Value* OnProtocolCommand( | |
29 int connection_id, | |
pfeldman
2012/12/14 10:39:33
I don't think it needs connection_id
bulach
2012/12/14 16:03:52
Done.
| |
30 int request_id, | |
pfeldman
2012/12/14 10:39:33
Handler should not need request_id as well - Brows
bulach
2012/12/14 16:03:52
Done.
| |
31 const std::string& method, | |
32 const base::DictionaryValue* params) = 0; | |
33 | |
pfeldman
2012/12/14 10:39:33
protected:
virtual ~Handler() {}
bulach
2012/12/14 16:03:52
has to be public now that ownership is properly tr
| |
34 }; | |
35 | |
36 explicit DevToolsBrowserTarget(int connection_id); | |
37 ~DevToolsBrowserTarget(); | |
38 | |
39 int connection_id() const { return connection_id_; } | |
40 | |
41 // Takes ownership of |handler|. | |
pfeldman
2012/12/14 10:39:33
Not according to the code.
bulach
2012/12/14 16:03:52
argh! :) my bad, forgot to update when moving from
| |
42 void RegisterHandler(const std::string& domain, Handler* handler); | |
43 | |
44 base::Value* OnWebSocketMessage(int connection_id, | |
pfeldman
2012/12/14 10:39:33
No need for connection_id
bulach
2012/12/14 16:03:52
Done.
| |
45 const std::string& data); | |
46 | |
47 private: | |
48 const int connection_id_; | |
49 | |
50 typedef std::map<std::string, Handler*> HandlersMap; | |
51 HandlersMap handlers_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(DevToolsBrowserTarget); | |
54 }; | |
55 | |
56 } // namespace content | |
57 | |
58 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_BROWSER_TARGET_H_ | |
OLD | NEW |