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

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

Issue 2874613003: [DevTools] Support multiple clients in DevToolsAgentHost (Closed)
Patch Set: Created 3 years, 7 months 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 | « no previous file | content/browser/devtools/devtools_agent_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 63f0ebf58a8686d40f367394ed20e7ea9b1e9e70..3ba4d6f92b668680ad572ffd426f38b35fd74644 100644
--- a/content/browser/devtools/devtools_agent_host_impl.h
+++ b/content/browser/devtools/devtools_agent_host_impl.h
@@ -27,6 +27,7 @@ class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
// DevToolsAgentHost implementation.
bool AttachClient(DevToolsAgentHostClient* client) override;
void ForceAttachClient(DevToolsAgentHostClient* client) override;
+ bool AttachMultiClient(DevToolsAgentHostClient* client) override;
bool DetachClient(DevToolsAgentHostClient* client) override;
bool DispatchProtocolMessage(DevToolsAgentHostClient* client,
const std::string& message) override;
@@ -59,26 +60,26 @@ class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost {
virtual void InspectElement(DevToolsSession* session, int x, int y);
void NotifyCreated();
- void ForceDetach(bool replaced);
+ void ForceDetachAllClients(bool replaced);
DevToolsIOContext* GetIOContext() { return &io_context_; }
-
- // TODO(dgozman): remove this accessor.
- DevToolsSession* session() { return session_; }
+ const base::flat_map<int, DevToolsSession*>& sessions() {
+ return session_by_id_;
+ }
private:
friend class DevToolsAgentHost; // for static methods
friend class DevToolsSession;
- bool InnerAttachClient(DevToolsAgentHostClient* client, bool force);
- void InnerDetachClient();
+ void InnerAttachClient(DevToolsAgentHostClient* client);
+ void InnerDetachClient(DevToolsAgentHostClient* client);
void NotifyAttached();
void NotifyDetached();
void NotifyDestroyed();
const std::string id_;
int last_session_id_;
- // TODO(dgozman): remove this together with accessor above.
- DevToolsSession* session_;
- base::flat_set<std::unique_ptr<DevToolsSession>> sessions_;
+ base::flat_map<DevToolsAgentHostClient*, std::unique_ptr<DevToolsSession>>
+ session_by_client_;
+ base::flat_map<int, DevToolsSession*> session_by_id_;
DevToolsIOContext io_context_;
static int s_attached_count_;
static int s_force_creation_count_;
« no previous file with comments | « no previous file | content/browser/devtools/devtools_agent_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698