| 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_;
|
|
|