| Index: ui/devtools/devtools_client.cc
|
| diff --git a/ui/devtools/devtools_client.cc b/ui/devtools/devtools_client.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..30c869db1696df36e279c25e489bc5fe3f131a7d
|
| --- /dev/null
|
| +++ b/ui/devtools/devtools_client.cc
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 2016 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 "ui/devtools/devtools_client.h"
|
| +
|
| +#include "ui/devtools/devtools_server.h"
|
| +#include "ui/devtools/Protocol.h"
|
| +
|
| +namespace ui {
|
| +namespace devtools {
|
| +
|
| +UiDevToolsClient::UiDevToolsClient(String name, UiDevToolsServer* server)
|
| + : name_(name), connected_client_id(-1), dispatcher_(this), server_(server) {
|
| + DCHECK(server_);
|
| +}
|
| +
|
| +UiDevToolsClient::~UiDevToolsClient() {}
|
| +
|
| +void UiDevToolsClient::AddDOMBackend(
|
| + std::unique_ptr<protocol::DOM::Backend> dom_backend) {
|
| + dom_backend_ = std::move(dom_backend);
|
| + protocol::DOM::Dispatcher::wire(&dispatcher_, dom_backend_.get());
|
| +}
|
| +
|
| +void UiDevToolsClient::sendProtocolResponse(int callId, const String& message) {
|
| + server_->SendOverWebSocket(connected_client_id, message);
|
| +}
|
| +
|
| +void UiDevToolsClient::sendProtocolNotification(const String& message) {
|
| + server_->SendOverWebSocket(connected_client_id, message);
|
| +}
|
| +
|
| +void UiDevToolsClient::flushProtocolNotifications() {
|
| + NOTIMPLEMENTED();
|
| +}
|
| +
|
| +void UiDevToolsClient::Dispatch(const String& data) {
|
| + dispatcher_.dispatch(protocol::parseJSON(data));
|
| +}
|
| +
|
| +} // namespace devtools
|
| +} // namespace ui
|
|
|