Chromium Code Reviews| 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 "base/memory/scoped_vector.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 class DevToolsServerSender; | |
| 13 | |
| 14 // This class bridges DevTools remote debugging server with the trace | |
| 15 // infrastructure. | |
| 16 class DevToolsBrowserTarget { | |
| 17 public: | |
| 18 class Handler { | |
| 19 public: | |
| 20 virtual bool OnWebSocketMessage(int connection_id, | |
|
pfeldman
2012/12/12 20:17:12
Value* OnProtocolCommand(const std::string& method
bulach
2012/12/13 17:36:23
Done.
| |
| 21 const std::string& data, | |
| 22 DevToolsServerSender* sender) = 0; | |
| 23 | |
| 24 }; | |
| 25 | |
| 26 explicit DevToolsBrowserTarget(int connection_id); | |
| 27 ~DevToolsBrowserTarget(); | |
| 28 | |
| 29 int connection_id() const; | |
| 30 void RegisterHandler(Handler* handler); | |
|
pfeldman
2012/12/12 20:17:12
You should comment that it takes ownership.
bulach
2012/12/13 17:36:23
Done.
| |
| 31 | |
| 32 void OnWebSocketMessage(int connection_id, | |
| 33 const std::string& data, | |
| 34 DevToolsServerSender* sender); | |
| 35 | |
| 36 private: | |
| 37 const int connection_id_; | |
| 38 | |
| 39 ScopedVector<Handler> handlers_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(DevToolsBrowserTarget); | |
| 42 }; | |
| 43 | |
| 44 } // namespace content | |
| 45 | |
| 46 #endif // CONTENT_BROWSER_DEBUGGER_DEVTOOLS_BROWSER_TARGET_H_ | |
| OLD | NEW |