Chromium Code Reviews| Index: content/browser/devtools/protocol/browser_handler.h |
| diff --git a/content/browser/devtools/protocol/browser_handler.h b/content/browser/devtools/protocol/browser_handler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b672b3ad8187ad525e060b2053c1ad03dd4517cf |
| --- /dev/null |
| +++ b/content/browser/devtools/protocol/browser_handler.h |
| @@ -0,0 +1,56 @@ |
| +// 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. |
| + |
| +#ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |
| +#define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
| +#include "content/public/browser/devtools_agent_host.h" |
| + |
| +namespace net { |
| +class ServerSocket; |
| +} |
| + |
| +// Windows headers will redefine SendMessage. |
| +#ifdef SendMessage |
| +#undef SendMessage |
| +#endif |
| + |
| +namespace content { |
| +namespace devtools { |
| +namespace browser { |
| + |
| +class BrowserHandler : DevToolsAgentHostClient { |
|
dgozman
2016/06/08 03:53:29
style: missing public/private before super-class.
pfeldman
2016/06/08 15:54:52
Done.
|
| + public: |
| + using Response = DevToolsProtocolClient::Response; |
| + |
| + BrowserHandler(); |
| + ~BrowserHandler() override; |
| + |
| + void SetClient(std::unique_ptr<Client> client); |
| + |
| + using TargetInfos = std::vector<scoped_refptr<devtools::browser::TargetInfo>>; |
| + Response GetTargets(TargetInfos* infos); |
| + Response Attach(const std::string& targetId); |
| + Response Detach(const std::string& targetId); |
| + Response SendMessage(const std::string& targetId, const std::string& message); |
| + |
| + private: |
| + void DispatchProtocolMessage(DevToolsAgentHost* agent_host, |
| + const std::string& message) override; |
| + |
| + void AgentHostClosed(DevToolsAgentHost* agent_host, |
| + bool replaced_with_another_client) override; |
| + |
| + std::unique_ptr<Client> client_; |
| + DISALLOW_COPY_AND_ASSIGN(BrowserHandler); |
| +}; |
| + |
| +} // namespace browser |
| +} // namespace devtools |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_BROWSER_HANDLER_H_ |