| Index: remoting/host/security_key/security_key_ipc_server_impl.cc
|
| diff --git a/remoting/host/security_key/remote_security_key_ipc_server_impl.cc b/remoting/host/security_key/security_key_ipc_server_impl.cc
|
| similarity index 80%
|
| rename from remoting/host/security_key/remote_security_key_ipc_server_impl.cc
|
| rename to remoting/host/security_key/security_key_ipc_server_impl.cc
|
| index f3c9d5a90f68069ed2dc83118d8af7912f9f28be..c39d0d1aa666ae95994dcb46e0b2681581d72809 100644
|
| --- a/remoting/host/security_key/remote_security_key_ipc_server_impl.cc
|
| +++ b/remoting/host/security_key/security_key_ipc_server_impl.cc
|
| @@ -2,7 +2,7 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "remoting/host/security_key/remote_security_key_ipc_server_impl.h"
|
| +#include "remoting/host/security_key/security_key_ipc_server_impl.h"
|
|
|
| #include <cstdint>
|
| #include <memory>
|
| @@ -39,11 +39,11 @@ unsigned int GetCommandCode(const std::string& data) {
|
|
|
| namespace remoting {
|
|
|
| -RemoteSecurityKeyIpcServerImpl::RemoteSecurityKeyIpcServerImpl(
|
| +SecurityKeyIpcServerImpl::SecurityKeyIpcServerImpl(
|
| int connection_id,
|
| uint32_t peer_session_id,
|
| base::TimeDelta initial_connect_timeout,
|
| - const GnubbyAuthHandler::SendMessageCallback& message_callback,
|
| + const SecurityKeyAuthHandler::SendMessageCallback& message_callback,
|
| const base::Closure& done_callback)
|
| : connection_id_(connection_id),
|
| peer_session_id_(peer_session_id),
|
| @@ -56,11 +56,10 @@ RemoteSecurityKeyIpcServerImpl::RemoteSecurityKeyIpcServerImpl(
|
| DCHECK(!message_callback_.is_null());
|
| }
|
|
|
| -RemoteSecurityKeyIpcServerImpl::~RemoteSecurityKeyIpcServerImpl() {}
|
| +SecurityKeyIpcServerImpl::~SecurityKeyIpcServerImpl() {}
|
|
|
| -bool RemoteSecurityKeyIpcServerImpl::CreateChannel(
|
| - const std::string& channel_name,
|
| - base::TimeDelta request_timeout) {
|
| +bool SecurityKeyIpcServerImpl::CreateChannel(const std::string& channel_name,
|
| + base::TimeDelta request_timeout) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| DCHECK(!ipc_channel_);
|
| security_key_request_timeout_ = request_timeout;
|
| @@ -99,26 +98,25 @@ bool RemoteSecurityKeyIpcServerImpl::CreateChannel(
|
| // methods must execute on the same thread (due to |thread_Checker_| so
|
| // the posted task and D'Tor can not execute concurrently.
|
| timer_.Start(FROM_HERE, initial_connect_timeout_,
|
| - base::Bind(&RemoteSecurityKeyIpcServerImpl::OnChannelError,
|
| + base::Bind(&SecurityKeyIpcServerImpl::OnChannelError,
|
| base::Unretained(this)));
|
| return true;
|
| }
|
|
|
| -bool RemoteSecurityKeyIpcServerImpl::SendResponse(const std::string& response) {
|
| +bool SecurityKeyIpcServerImpl::SendResponse(const std::string& response) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
| // Since we have received a response, we update the timer and wait
|
| // for a subsequent request.
|
| timer_.Start(FROM_HERE, security_key_request_timeout_,
|
| - base::Bind(&RemoteSecurityKeyIpcServerImpl::OnChannelError,
|
| + base::Bind(&SecurityKeyIpcServerImpl::OnChannelError,
|
| base::Unretained(this)));
|
|
|
| return ipc_channel_->Send(
|
| new ChromotingNetworkToRemoteSecurityKeyMsg_Response(response));
|
| }
|
|
|
| -bool RemoteSecurityKeyIpcServerImpl::OnMessageReceived(
|
| - const IPC::Message& message) {
|
| +bool SecurityKeyIpcServerImpl::OnMessageReceived(const IPC::Message& message) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
| if (connection_close_pending_) {
|
| @@ -127,7 +125,7 @@ bool RemoteSecurityKeyIpcServerImpl::OnMessageReceived(
|
| }
|
|
|
| bool handled = true;
|
| - IPC_BEGIN_MESSAGE_MAP(RemoteSecurityKeyIpcServerImpl, message)
|
| + IPC_BEGIN_MESSAGE_MAP(SecurityKeyIpcServerImpl, message)
|
| IPC_MESSAGE_HANDLER(ChromotingRemoteSecurityKeyToNetworkMsg_Request,
|
| OnSecurityKeyRequest)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| @@ -137,7 +135,7 @@ bool RemoteSecurityKeyIpcServerImpl::OnMessageReceived(
|
| return handled;
|
| }
|
|
|
| -void RemoteSecurityKeyIpcServerImpl::OnChannelConnected(int32_t peer_pid) {
|
| +void SecurityKeyIpcServerImpl::OnChannelConnected(int32_t peer_pid) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
| #if defined(OS_WIN)
|
| @@ -151,7 +149,7 @@ void RemoteSecurityKeyIpcServerImpl::OnChannelConnected(int32_t peer_pid) {
|
| }
|
| if (connection_close_pending_) {
|
| base::ThreadTaskRunnerHandle::Get()->PostTask(
|
| - FROM_HERE, base::Bind(&RemoteSecurityKeyIpcServerImpl::OnChannelError,
|
| + FROM_HERE, base::Bind(&SecurityKeyIpcServerImpl::OnChannelError,
|
| weak_factory_.GetWeakPtr()));
|
| return;
|
| }
|
| @@ -161,11 +159,11 @@ void RemoteSecurityKeyIpcServerImpl::OnChannelConnected(int32_t peer_pid) {
|
|
|
| // Reset the timer to give the client a chance to send the request.
|
| timer_.Start(FROM_HERE, initial_connect_timeout_,
|
| - base::Bind(&RemoteSecurityKeyIpcServerImpl::OnChannelError,
|
| + base::Bind(&SecurityKeyIpcServerImpl::OnChannelError,
|
| base::Unretained(this)));
|
| }
|
|
|
| -void RemoteSecurityKeyIpcServerImpl::OnChannelError() {
|
| +void SecurityKeyIpcServerImpl::OnChannelError() {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
| if (ipc_channel_) {
|
| ipc_channel_->Close();
|
| @@ -178,16 +176,16 @@ void RemoteSecurityKeyIpcServerImpl::OnChannelError() {
|
| }
|
| }
|
|
|
| -void RemoteSecurityKeyIpcServerImpl::OnSecurityKeyRequest(
|
| +void SecurityKeyIpcServerImpl::OnSecurityKeyRequest(
|
| const std::string& request_data) {
|
| DCHECK(thread_checker_.CalledOnValidThread());
|
|
|
| // Reset the timer to give the client a chance to send the response.
|
| timer_.Start(FROM_HERE, security_key_request_timeout_,
|
| - base::Bind(&RemoteSecurityKeyIpcServerImpl::OnChannelError,
|
| + base::Bind(&SecurityKeyIpcServerImpl::OnChannelError,
|
| base::Unretained(this)));
|
|
|
| - HOST_LOG << "Received gnubby request: " << GetCommandCode(request_data);
|
| + HOST_LOG << "Received security key request: " << GetCommandCode(request_data);
|
| message_callback_.Run(connection_id_, request_data);
|
| }
|
|
|
|
|