Index: content/browser/devtools/devtools_session.h |
diff --git a/content/browser/devtools/devtools_session.h b/content/browser/devtools/devtools_session.h |
index c02fc56b2a4e7f2404c579fed9ed04e2a0004a55..6362e3e0437e747ce73bb54f78bee8280114d138 100644 |
--- a/content/browser/devtools/devtools_session.h |
+++ b/content/browser/devtools/devtools_session.h |
@@ -2,25 +2,51 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include "content/browser/devtools/protocol/devtools_domain_handler.h" |
#include "content/browser/devtools/protocol/protocol.h" |
namespace content { |
class DevToolsAgentHostImpl; |
+class DevToolsAgentHostClient; |
+class RenderFrameHostImpl; |
+ |
+namespace protocol { |
+class InputHandler; |
+class InspectorHandler; |
+class NetworkHandler; |
+class PageHandler; |
+class TargetHandler; |
+class TracingHandler; |
+} |
class DevToolsSession : public protocol::FrontendChannel { |
public: |
- DevToolsSession(DevToolsAgentHostImpl* agent_host, int session_id); |
+ DevToolsSession(DevToolsAgentHostImpl* agent_host, |
+ DevToolsAgentHostClient* client, |
+ int session_id); |
~DevToolsSession() override; |
- void ResetDispatcher(); |
+ int session_id() { return session_id_; } |
caseq
2016/12/21 23:17:27
nit: could be const.
dgozman
2016/12/22 06:26:13
Done.
|
+ void AddHandler(std::unique_ptr<protocol::DevToolsDomainHandler> handler); |
+ void SetRenderFrameHost(RenderFrameHostImpl* host); |
+ void SetFallThroughForNotFound(bool value); |
+ |
protocol::Response::Status Dispatch( |
const std::string& message, |
+ bool offer_to_delegate, |
int* call_id, |
std::string* method); |
- int session_id() { return session_id_; } |
- protocol::UberDispatcher* dispatcher() { return dispatcher_.get(); } |
+ protocol::InputHandler* GetInputHandler(); |
caseq
2016/12/21 23:17:27
Let's move these somewhere else, it would be nice
dgozman
2016/12/22 06:26:13
Done.
|
+ protocol::InspectorHandler* GetInspectorHandler(); |
+ protocol::NetworkHandler* GetNetworkHandler(); |
+ protocol::PageHandler* GetPageHandler(); |
+ protocol::TargetHandler* GetTargetHandler(); |
+ protocol::TracingHandler* GetTracingHandler(); |
+ |
+ // Only used by DevToolsAgentHostImpl. |
+ DevToolsAgentHostClient* client() const { return client_; } |
private: |
// protocol::FrontendChannel implementation. |
@@ -31,8 +57,14 @@ class DevToolsSession : public protocol::FrontendChannel { |
std::unique_ptr<protocol::Serializable> message) override; |
void flushProtocolNotifications() override; |
+ protocol::DevToolsDomainHandler* GetHandlerByName(const std::string& name); |
+ |
DevToolsAgentHostImpl* agent_host_; |
+ DevToolsAgentHostClient* client_; |
int session_id_; |
+ std::unordered_map<std::string, |
+ std::unique_ptr<protocol::DevToolsDomainHandler>> handlers_; |
+ RenderFrameHostImpl* host_; |
std::unique_ptr<protocol::UberDispatcher> dispatcher_; |
}; |