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

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

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: 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
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..db7cd6b5875912f377c89128d472c318ee2f28f9 100644
--- a/content/browser/devtools/devtools_session.h
+++ b/content/browser/devtools/devtools_session.h
@@ -2,25 +2,53 @@
// 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_; }
+ 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();
+ protocol::InspectorHandler* GetInspectorHandler();
+ protocol::NetworkHandler* GetNetworkHandler();
+ protocol::PageHandler* GetPageHandler();
+ protocol::TargetHandler* GetTargetHandler();
+ protocol::TracingHandler* GetTracingHandler();
+
+ // Only used by DevToolsAgentHostImpl.
+ DevToolsAgentHostClient* client() const { return client_; }
+ void Attach();
+ void Detach();
private:
// protocol::FrontendChannel implementation.
@@ -31,8 +59,15 @@ 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_;
+ bool attached_;
caseq 2016/12/20 23:13:20 Let's try to get rid of that, as well as of Attach
dgozman 2016/12/21 00:29:40 Done.
std::unique_ptr<protocol::UberDispatcher> dispatcher_;
};

Powered by Google App Engine
This is Rietveld 408576698