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

Unified Diff: remoting/host/security_key/security_key_auth_handler_posix.cc

Issue 2197023002: Updating Security Key logic to work on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@posix_auth
Patch Set: Defaulting SK support to true since all hosts support it 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/security_key/security_key_auth_handler_posix.cc
diff --git a/remoting/host/security_key/security_key_auth_handler_posix.cc b/remoting/host/security_key/security_key_auth_handler_posix.cc
index dccae8a65f24c2b7e87d7aaa94d5242b5f7666b0..245a6c913128f8205287052321ffc7b9545374ae 100644
--- a/remoting/host/security_key/security_key_auth_handler_posix.cc
+++ b/remoting/host/security_key/security_key_auth_handler_posix.cc
@@ -150,7 +150,15 @@ SecurityKeyAuthHandlerPosix::SecurityKeyAuthHandlerPosix(
base::TimeDelta::FromSeconds(kDefaultRequestTimeoutSeconds)),
weak_factory_(this) {}
-SecurityKeyAuthHandlerPosix::~SecurityKeyAuthHandlerPosix() {}
+SecurityKeyAuthHandlerPosix::~SecurityKeyAuthHandlerPosix() {
+ if (file_task_runner_) {
+ // Attempt to clean up the socket before being destroyed.
+ file_task_runner_->PostTask(
+ FROM_HERE, base::Bind(base::IgnoreResult(&base::DeleteFile),
+ g_security_key_socket_name.Get(),
+ /*recursive=*/false));
+ }
+}
void SecurityKeyAuthHandlerPosix::CreateSecurityKeyConnection() {
DCHECK(thread_checker_.CalledOnValidThread());
@@ -162,7 +170,8 @@ void SecurityKeyAuthHandlerPosix::CreateSecurityKeyConnection() {
// resume setting up our security key auth socket there.
file_task_runner_->PostTaskAndReply(
FROM_HERE, base::Bind(base::IgnoreResult(&base::DeleteFile),
- g_security_key_socket_name.Get(), false),
+ g_security_key_socket_name.Get(),
+ /*recursive=*/false),
base::Bind(&SecurityKeyAuthHandlerPosix::CreateSocket,
weak_factory_.GetWeakPtr()));
}
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698