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

Unified Diff: content/browser/devtools/devtools_session.h

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: includes Created 4 years 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
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.cc ('k') | content/browser/devtools/devtools_session.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
};
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.cc ('k') | content/browser/devtools/devtools_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698