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

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

Issue 2590293003: [DevTools] Rework DevToolsSession interaction with domain handlers. (Closed)
Patch Set: addressed comments 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_agent_host_impl.h
diff --git a/content/browser/devtools/devtools_agent_host_impl.h b/content/browser/devtools/devtools_agent_host_impl.h
index 75541d14b2d6d34795f98e29ad83f519da1630d3..64b2c2a135c7f8a46a5f0ddbbf460541eeed2654 100644
--- a/content/browser/devtools/devtools_agent_host_impl.h
+++ b/content/browser/devtools/devtools_agent_host_impl.h
@@ -23,12 +23,6 @@ class DevToolsSession;
// Describes interface for managing devtools agents from the browser process.
class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
public:
- // Informs the hosted agent that a client host has attached.
- virtual void Attach() = 0;
-
- // Informs the hosted agent that a client host has detached.
- virtual void Detach() = 0;
-
// DevToolsAgentHost implementation.
bool AttachClient(DevToolsAgentHostClient* client) override;
void ForceAttachClient(DevToolsAgentHostClient* client) override;
@@ -57,28 +51,31 @@ class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
static bool ShouldForceCreation();
- virtual bool DispatchProtocolMessage(const std::string& message) = 0;
- virtual void InspectElement(int x, int y);
+ virtual void AttachSession(DevToolsSession* session) = 0;
+ virtual void DetachSession(int session_id) = 0;
+ virtual bool DispatchProtocolMessage(
+ DevToolsSession* session,
+ const std::string& message) = 0;
+ virtual void InspectElement(DevToolsSession* session, int x, int y);
void NotifyCreated();
void HostClosed();
DevToolsIOContext* GetIOContext() { return &io_context_; }
+ // TODO(dgozman): remove this accessor.
DevToolsSession* session() { return session_.get(); }
private:
friend class DevToolsAgentHost; // for static methods
- bool InnerAttach(DevToolsAgentHostClient* client, bool force);
- void InnerDetach();
+ bool InnerAttachClient(DevToolsAgentHostClient* client, bool force);
+ void InnerDetachClient();
void NotifyAttached();
void NotifyDetached();
void NotifyDestroyed();
const std::string id_;
- int session_id_;
int last_session_id_;
std::unique_ptr<DevToolsSession> session_;
- DevToolsAgentHostClient* client_;
DevToolsIOContext io_context_;
static int s_attached_count_;
static int s_force_creation_count_;

Powered by Google App Engine
This is Rietveld 408576698