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

Side by Side Diff: components/ui_devtools/devtools_server.cc

Issue 2470933002: Disable agents when client disconnects (Closed)
Patch Set: fix nit 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 unified diff | Download patch
« no previous file with comments | « components/ui_devtools/devtools_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/ui_devtools/devtools_server.h" 5 #include "components/ui_devtools/devtools_server.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 task_runner_->PostTask(FROM_HERE, base::Bind(&UiDevToolsClient::Dispatch, 154 task_runner_->PostTask(FROM_HERE, base::Bind(&UiDevToolsClient::Dispatch,
155 base::Unretained(client), data)); 155 base::Unretained(client), data));
156 } 156 }
157 157
158 void UiDevToolsServer::OnClose(int connection_id) { 158 void UiDevToolsServer::OnClose(int connection_id) {
159 ConnectionsMap::iterator it = connections_.find(connection_id); 159 ConnectionsMap::iterator it = connections_.find(connection_id);
160 if (it == connections_.end()) 160 if (it == connections_.end())
161 return; 161 return;
162 UiDevToolsClient* client = it->second; 162 UiDevToolsClient* client = it->second;
163 DCHECK(client); 163 DCHECK(client);
164 client->set_connection_id(UiDevToolsClient::kNotConnected); 164 client->Disconnect();
165 connections_.erase(it); 165 connections_.erase(it);
166 } 166 }
167 167
168 } // namespace devtools 168 } // namespace devtools
169 } // namespace ui 169 } // namespace ui
OLDNEW
« no previous file with comments | « components/ui_devtools/devtools_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698