| 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_ipc_client.h" | 5 #include "remoting/host/security_key/security_key_ipc_client.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
| 12 #include "base/threading/thread_task_runner_handle.h" | 12 #include "base/threading/thread_task_runner_handle.h" |
| 13 #include "ipc/ipc_channel.h" | 13 #include "ipc/ipc_channel.h" |
| 14 #include "ipc/ipc_listener.h" | 14 #include "ipc/ipc_listener.h" |
| 15 #include "ipc/ipc_message.h" | 15 #include "ipc/ipc_message.h" |
| 16 #include "ipc/ipc_message_macros.h" | 16 #include "ipc/ipc_message_macros.h" |
| 17 #include "mojo/edk/embedder/embedder.h" | 17 #include "mojo/edk/embedder/embedder.h" |
| 18 #include "mojo/edk/embedder/named_platform_handle_utils.h" | 18 #include "mojo/edk/embedder/named_platform_handle_utils.h" |
| 19 #include "remoting/host/chromoting_messages.h" | 19 #include "remoting/host/chromoting_messages.h" |
| 20 #include "remoting/host/ipc_constants.h" | 20 #include "remoting/host/ipc_constants.h" |
| 21 #include "remoting/host/security_key/security_key_ipc_constants.h" | 21 #include "remoting/host/security_key/security_key_ipc_constants.h" |
| 22 | 22 |
| 23 namespace remoting { | 23 namespace remoting { |
| 24 | 24 |
| 25 SecurityKeyIpcClient::SecurityKeyIpcClient() | 25 SecurityKeyIpcClient::SecurityKeyIpcClient() |
| 26 : named_channel_handle_(remoting::GetSecurityKeyIpcChannel()), | 26 : named_channel_handle_(remoting::GetSecurityKeyIpcChannel()), |
| 27 weak_factory_(this) {} | 27 weak_factory_(this) {} |
| 28 | 28 |
| 29 SecurityKeyIpcClient::~SecurityKeyIpcClient() {} | 29 SecurityKeyIpcClient::~SecurityKeyIpcClient() { |
| 30 DCHECK(thread_checker_.CalledOnValidThread()); |
| 31 } |
| 30 | 32 |
| 31 bool SecurityKeyIpcClient::CheckForSecurityKeyIpcServerChannel() { | 33 bool SecurityKeyIpcClient::CheckForSecurityKeyIpcServerChannel() { |
| 32 DCHECK(thread_checker_.CalledOnValidThread()); | 34 DCHECK(thread_checker_.CalledOnValidThread()); |
| 33 | 35 |
| 34 if (!channel_handle_.is_valid()) { | 36 if (!channel_handle_.is_valid()) { |
| 35 channel_handle_ = mojo::edk::CreateClientHandle(named_channel_handle_); | 37 channel_handle_ = mojo::edk::CreateClientHandle(named_channel_handle_); |
| 36 } | 38 } |
| 37 return channel_handle_.is_valid(); | 39 return channel_handle_.is_valid(); |
| 38 } | 40 } |
| 39 | 41 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 return; | 200 return; |
| 199 } | 201 } |
| 200 ipc_channel_.reset(); | 202 ipc_channel_.reset(); |
| 201 | 203 |
| 202 if (connection_error_callback_) { | 204 if (connection_error_callback_) { |
| 203 base::ResetAndReturn(&connection_error_callback_).Run(); | 205 base::ResetAndReturn(&connection_error_callback_).Run(); |
| 204 } | 206 } |
| 205 } | 207 } |
| 206 | 208 |
| 207 } // namespace remoting | 209 } // namespace remoting |
| OLD | NEW |