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

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

Issue 577923002: [DevTools] Implement DevToolsManager::Observer which notifies about target updates. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-enumerate-to-dtm-delegate
Patch Set: fixed test flakiness Created 6 years, 3 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_manager.h » ('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.cc
diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc
index 0630a0473be002c67659a9a17d0bf043922f8410..b7f9b24b59f5a749f37691ebb4ed0d40878b3a6a 100644
--- a/content/browser/devtools/devtools_agent_host_impl.cc
+++ b/content/browser/devtools/devtools_agent_host_impl.cc
@@ -75,11 +75,10 @@ void DevToolsAgentHostImpl::AttachClient(DevToolsAgentHostClient* client) {
if (client_) {
client_->AgentHostClosed(this, true);
Detach();
- } else {
- DevToolsManager::GetInstance()->OnClientAttached();
}
client_ = client;
Attach();
+ DevToolsManager::GetInstance()->AgentHostChanged(this);
}
void DevToolsAgentHostImpl::DetachClient() {
@@ -88,8 +87,8 @@ void DevToolsAgentHostImpl::DetachClient() {
scoped_refptr<DevToolsAgentHostImpl> protect(this);
client_ = NULL;
- DevToolsManager::GetInstance()->OnClientDetached();
Detach();
+ DevToolsManager::GetInstance()->AgentHostChanged(this);
}
bool DevToolsAgentHostImpl::IsAttached() {
@@ -125,8 +124,8 @@ void DevToolsAgentHostImpl::HostClosed() {
// Clear |client_| before notifying it.
DevToolsAgentHostClient* client = client_;
client_ = NULL;
- DevToolsManager::GetInstance()->OnClientDetached();
client->AgentHostClosed(this, false);
+ DevToolsManager::GetInstance()->AgentHostChanged(this);
}
void DevToolsAgentHostImpl::SendMessageToClient(const std::string& message) {
@@ -150,9 +149,9 @@ void DevToolsAgentHost::DetachAllClients() {
// Clear |client_| before notifying it.
DevToolsAgentHostClient* client = agent_host->client_;
agent_host->client_ = NULL;
- DevToolsManager::GetInstance()->OnClientDetached();
client->AgentHostClosed(agent_host, true);
agent_host->Detach();
+ DevToolsManager::GetInstance()->AgentHostChanged(protect);
}
}
}
« no previous file with comments | « no previous file | content/browser/devtools/devtools_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698