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 "remoting/host/security_key/security_key_auth_handler.h" | 5 #include "remoting/host/security_key/security_key_auth_handler.h" |
6 | 6 |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 | 8 |
9 #include <cstdint> | 9 #include <cstdint> |
10 #include <map> | 10 #include <map> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 SecurityKeyAuthHandlerPosix::SecurityKeyAuthHandlerPosix( | 147 SecurityKeyAuthHandlerPosix::SecurityKeyAuthHandlerPosix( |
148 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) | 148 scoped_refptr<base::SingleThreadTaskRunner> file_task_runner) |
149 : file_task_runner_(file_task_runner), | 149 : file_task_runner_(file_task_runner), |
150 request_timeout_( | 150 request_timeout_( |
151 base::TimeDelta::FromSeconds(kDefaultRequestTimeoutSeconds)), | 151 base::TimeDelta::FromSeconds(kDefaultRequestTimeoutSeconds)), |
152 weak_factory_(this) {} | 152 weak_factory_(this) {} |
153 | 153 |
154 SecurityKeyAuthHandlerPosix::~SecurityKeyAuthHandlerPosix() { | 154 SecurityKeyAuthHandlerPosix::~SecurityKeyAuthHandlerPosix() { |
| 155 DCHECK(thread_checker_.CalledOnValidThread()); |
155 if (file_task_runner_) { | 156 if (file_task_runner_) { |
156 // Attempt to clean up the socket before being destroyed. | 157 // Attempt to clean up the socket before being destroyed. |
157 file_task_runner_->PostTask( | 158 file_task_runner_->PostTask( |
158 FROM_HERE, base::Bind(base::IgnoreResult(&base::DeleteFile), | 159 FROM_HERE, base::Bind(base::IgnoreResult(&base::DeleteFile), |
159 g_security_key_socket_name.Get(), | 160 g_security_key_socket_name.Get(), |
160 /*recursive=*/false)); | 161 /*recursive=*/false)); |
161 } | 162 } |
162 } | 163 } |
163 | 164 |
164 void SecurityKeyAuthHandlerPosix::CreateSecurityKeyConnection() { | 165 void SecurityKeyAuthHandlerPosix::CreateSecurityKeyConnection() { |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 304 |
304 void SecurityKeyAuthHandlerPosix::RequestTimedOut(int connection_id) { | 305 void SecurityKeyAuthHandlerPosix::RequestTimedOut(int connection_id) { |
305 HOST_LOG << "SecurityKey request timed out for socket: " << connection_id; | 306 HOST_LOG << "SecurityKey request timed out for socket: " << connection_id; |
306 ActiveSockets::const_iterator iter = active_sockets_.find(connection_id); | 307 ActiveSockets::const_iterator iter = active_sockets_.find(connection_id); |
307 if (iter != active_sockets_.end()) { | 308 if (iter != active_sockets_.end()) { |
308 SendErrorAndCloseActiveSocket(iter); | 309 SendErrorAndCloseActiveSocket(iter); |
309 } | 310 } |
310 } | 311 } |
311 | 312 |
312 } // namespace remoting | 313 } // namespace remoting |
OLD | NEW |