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

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

Issue 2499343002: [DevTools] Introduce DevToolsSession. (Closed)
Patch Set: Created 4 years, 1 month 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 cbc3bc2cfca5f627d3adc73e83f85ae45346d57a..794bb7f47d83ab647961716aa5e5827a3ebedf25 100644
--- a/content/browser/devtools/devtools_agent_host_impl.h
+++ b/content/browser/devtools/devtools_agent_host_impl.h
@@ -23,6 +23,7 @@ class Message;
namespace content {
class BrowserContext;
+class DevToolsSession;
// Describes interface for managing devtools agents from the browser process.
class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost,
@@ -54,6 +55,7 @@ class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost,
void ConnectWebContents(WebContents* wc) override;
bool Inspect();
+ void SendMessageToClient(int session_id, const std::string& message);
// DevToolsProtocolDelegate implementation.
void SendProtocolResponse(int session_id,
@@ -71,10 +73,9 @@ class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost,
void NotifyCreated();
void HostClosed();
- void SendMessageToClient(int session_id, const std::string& message);
devtools::DevToolsIOContext* GetIOContext() { return &io_context_; }
- int session_id() { DCHECK(client_); return session_id_; }
+ DevToolsSession* session() { return session_.get(); }
private:
friend class DevToolsAgentHost; // for static methods
@@ -86,6 +87,8 @@ class CONTENT_EXPORT DevToolsAgentHostImpl : public DevToolsAgentHost,
const std::string id_;
int session_id_;
+ int last_session_id_;
+ std::unique_ptr<DevToolsSession> session_;
DevToolsAgentHostClient* client_;
devtools::DevToolsIOContext io_context_;
static int s_attached_count_;
« no previous file with comments | « content/browser/devtools/browser_devtools_agent_host.cc ('k') | content/browser/devtools/devtools_agent_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698