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

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

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
Index: content/browser/devtools/forwarding_agent_host.cc
diff --git a/content/browser/devtools/forwarding_agent_host.cc b/content/browser/devtools/forwarding_agent_host.cc
index f87276fa0d92777403ca5404eb3f1d49ab8e1cee..ccf3c3dbfb9295c63e1224bd37eb61d31594e57f 100644
--- a/content/browser/devtools/forwarding_agent_host.cc
+++ b/content/browser/devtools/forwarding_agent_host.cc
@@ -22,12 +22,12 @@ ForwardingAgentHost::~ForwardingAgentHost() {
}
void ForwardingAgentHost::DispatchOnClientHost(const std::string& message) {
- if (session())
- session()->SendMessageToClient(message);
+ if (!sessions().empty())
+ sessions().begin()->second->SendMessageToClient(message);
}
void ForwardingAgentHost::ConnectionClosed() {
- ForceDetach(false);
+ ForceDetachAllClients(false);
}
void ForwardingAgentHost::AttachSession(DevToolsSession* session) {
@@ -45,6 +45,12 @@ bool ForwardingAgentHost::DispatchProtocolMessage(
return true;
}
+bool ForwardingAgentHost::AttachMultiClient(DevToolsAgentHostClient* client) {
+ if (!sessions().empty())
+ return false;
+ return DevToolsAgentHostImpl::AttachMultiClient(client);
+}
+
std::string ForwardingAgentHost::GetType() {
return delegate_->GetType();
}
« no previous file with comments | « content/browser/devtools/forwarding_agent_host.h ('k') | content/browser/devtools/render_frame_devtools_agent_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698