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

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

Issue 1437993003: Revert of [DevTools] Filter any messages from previous sessions in DevToolsAgentHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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.cc
diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc
index 28318e043b921197a4a015d29883f6dfdbc4fd92..4d935519c07e0fa2ee919e11ee9ec83bf5e751c8 100644
--- a/content/browser/devtools/devtools_agent_host_impl.cc
+++ b/content/browser/devtools/devtools_agent_host_impl.cc
@@ -76,7 +76,8 @@
}
DevToolsAgentHostImpl::DevToolsAgentHostImpl()
- : id_(base::GenerateGUID()), session_id_(0), client_(NULL) {
+ : id_(base::GenerateGUID()),
+ client_(NULL) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
g_instances.Get()[id_] = this;
}
@@ -105,7 +106,6 @@
void DevToolsAgentHostImpl::AttachClient(DevToolsAgentHostClient* client) {
scoped_refptr<DevToolsAgentHostImpl> protect(this);
- ++session_id_;
if (client_) {
client_->AgentHostClosed(this, true);
InnerDetach();
@@ -151,16 +151,6 @@
}
void DevToolsAgentHostImpl::ConnectWebContents(WebContents* wc) {
-}
-
-void DevToolsAgentHostImpl::SendProtocolResponse(int session_id,
- const std::string& message) {
- SendMessageToClient(session_id, message);
-}
-
-void DevToolsAgentHostImpl::SendProtocolNotification(
- const std::string& message) {
- SendMessageToClient(session_id(), message);
}
void DevToolsAgentHostImpl::HostClosed() {
@@ -174,12 +164,8 @@
client->AgentHostClosed(this, false);
}
-void DevToolsAgentHostImpl::SendMessageToClient(int session_id,
- const std::string& message) {
+void DevToolsAgentHostImpl::SendMessageToClient(const std::string& message) {
if (!client_)
- return;
- // Filter any messages from previous sessions.
- if (session_id != session_id_)
return;
client_->DispatchProtocolMessage(this, message);
}
@@ -263,7 +249,7 @@
if (chunk.is_first && chunk.is_last) {
CHECK(message_buffer_size_ == 0);
- callback_.Run(chunk.session_id, chunk.data);
+ callback_.Run(chunk.data);
return;
}
@@ -279,7 +265,7 @@
if (chunk.is_last) {
CHECK(message_buffer_.size() == message_buffer_size_);
- callback_.Run(chunk.session_id, message_buffer_);
+ callback_.Run(message_buffer_);
message_buffer_ = std::string();
message_buffer_size_ = 0;
}
« no previous file with comments | « content/browser/devtools/devtools_agent_host_impl.h ('k') | content/browser/devtools/devtools_protocol_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698