| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |