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 #include "content/browser/debugger/devtools_browser_target.h" | |
| 6 | |
| 7 namespace content { | |
| 8 | |
| 9 DevToolsBrowserTarget::DevToolsBrowserTarget(int connection_id) | |
| 10 : connection_id_(connection_id) { | |
| 11 } | |
| 12 | |
| 13 DevToolsBrowserTarget::~DevToolsBrowserTarget() { | |
| 14 } | |
| 15 | |
| 16 int DevToolsBrowserTarget::connection_id() const { | |
|
pfeldman
2012/12/12 20:17:12
could live in .h
bulach
2012/12/13 17:36:23
Done.
| |
| 17 return connection_id_; | |
| 18 } | |
| 19 | |
| 20 void DevToolsBrowserTarget::RegisterHandler(Handler* handler) { | |
| 21 handlers_.push_back(handler); | |
|
pfeldman
2012/12/12 20:17:12
Make handlers a map? handlers_[handler->domain()]
bulach
2012/12/13 17:36:23
Done.
| |
| 22 } | |
| 23 | |
| 24 void DevToolsBrowserTarget::OnWebSocketMessage(int connection_id, | |
| 25 const std::string& data, | |
| 26 DevToolsServerSender* sender) { | |
| 27 for (ScopedVector<Handler>::iterator handler = handlers_.begin(); | |
|
pfeldman
2012/12/12 20:17:12
// base::JSONReader::Read(data) into DictionaryVal
bulach
2012/12/13 17:36:23
Done.
| |
| 28 handler != handlers_.end(); ++handler) { | |
| 29 if ((*handler)->OnWebSocketMessage(connection_id, data, sender)) { | |
|
pfeldman
2012/12/12 20:17:12
handler->OnProtocolCommand(const std::string& meth
bulach
2012/12/13 17:36:23
Done.
| |
| 30 break; | |
| 31 } | |
| 32 } | |
| 33 } | |
| 34 | |
| 35 } // namespace content | |
| OLD | NEW |