Chromium Code Reviews| Index: content/browser/debugger/devtools_browser_target.cc |
| diff --git a/content/browser/debugger/devtools_browser_target.cc b/content/browser/debugger/devtools_browser_target.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a1267f6d34c97fd2b3f3d66a7429133a4b895649 |
| --- /dev/null |
| +++ b/content/browser/debugger/devtools_browser_target.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/browser/debugger/devtools_browser_target.h" |
| + |
| +namespace content { |
| + |
| +DevToolsBrowserTarget::DevToolsBrowserTarget(int connection_id) |
| + : connection_id_(connection_id) { |
| +} |
| + |
| +DevToolsBrowserTarget::~DevToolsBrowserTarget() { |
| +} |
| + |
| +int DevToolsBrowserTarget::connection_id() const { |
|
pfeldman
2012/12/12 20:17:12
could live in .h
bulach
2012/12/13 17:36:23
Done.
|
| + return connection_id_; |
| +} |
| + |
| +void DevToolsBrowserTarget::RegisterHandler(Handler* handler) { |
| + 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.
|
| +} |
| + |
| +void DevToolsBrowserTarget::OnWebSocketMessage(int connection_id, |
| + const std::string& data, |
| + DevToolsServerSender* sender) { |
| + 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.
|
| + handler != handlers_.end(); ++handler) { |
| + 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.
|
| + break; |
| + } |
| + } |
| +} |
| + |
| +} // namespace content |