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..e568dd258555b40f0234a197a33802f14f066c49 100644 |
--- a/content/browser/devtools/devtools_session.h |
+++ b/content/browser/devtools/devtools_session.h |
@@ -2,25 +2,36 @@ |
// 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; |
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() const { return session_id_; } |
+ void AddHandler(std::unique_ptr<protocol::DevToolsDomainHandler> handler); |
+ void SetRenderFrameHost(RenderFrameHostImpl* host); |
+ void SetFallThroughForNotFound(bool value); |
+ protocol::DevToolsDomainHandler* GetHandlerByName(const std::string& name); |
+ |
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(); } |
+ // Only used by DevToolsAgentHostImpl. |
+ DevToolsAgentHostClient* client() const { return client_; } |
private: |
// protocol::FrontendChannel implementation. |
@@ -32,7 +43,11 @@ class DevToolsSession : public protocol::FrontendChannel { |
void flushProtocolNotifications() override; |
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_; |
}; |