Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Unified Diff: content/browser/devtools/protocol/browser_handler.h

Issue 2047833002: DevTools: introduce browser domain for basic target discovery. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..d4135bc1625a593a7116c734d1cf2744269cf748
--- /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 : public DevToolsAgentHostClient {
+ 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_
« no previous file with comments | « content/browser/devtools/devtools_manager_unittest.cc ('k') | content/browser/devtools/protocol/browser_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698