| Index: remoting/host/security_key/fake_security_key_ipc_client.cc
|
| diff --git a/remoting/host/security_key/fake_remote_security_key_ipc_client.cc b/remoting/host/security_key/fake_security_key_ipc_client.cc
|
| similarity index 72%
|
| rename from remoting/host/security_key/fake_remote_security_key_ipc_client.cc
|
| rename to remoting/host/security_key/fake_security_key_ipc_client.cc
|
| index 370e84517f4c801ccec1ae4a98ba2920f3530b6e..03e09893eb1ae8bba662f96319b3696c00c70e3b 100644
|
| --- a/remoting/host/security_key/fake_remote_security_key_ipc_client.cc
|
| +++ b/remoting/host/security_key/fake_security_key_ipc_client.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/fake_remote_security_key_ipc_client.h"
|
| +#include "remoting/host/security_key/fake_security_key_ipc_client.h"
|
|
|
| #include <memory>
|
|
|
| @@ -18,24 +18,23 @@
|
|
|
| namespace remoting {
|
|
|
| -FakeRemoteSecurityKeyIpcClient::FakeRemoteSecurityKeyIpcClient(
|
| +FakeSecurityKeyIpcClient::FakeSecurityKeyIpcClient(
|
| const base::Closure& channel_event_callback)
|
| : channel_event_callback_(channel_event_callback), weak_factory_(this) {
|
| DCHECK(!channel_event_callback_.is_null());
|
| }
|
|
|
| -FakeRemoteSecurityKeyIpcClient::~FakeRemoteSecurityKeyIpcClient() {}
|
| +FakeSecurityKeyIpcClient::~FakeSecurityKeyIpcClient() {}
|
|
|
| -base::WeakPtr<FakeRemoteSecurityKeyIpcClient>
|
| -FakeRemoteSecurityKeyIpcClient::AsWeakPtr() {
|
| +base::WeakPtr<FakeSecurityKeyIpcClient> FakeSecurityKeyIpcClient::AsWeakPtr() {
|
| return weak_factory_.GetWeakPtr();
|
| }
|
|
|
| -bool FakeRemoteSecurityKeyIpcClient::WaitForSecurityKeyIpcServerChannel() {
|
| +bool FakeSecurityKeyIpcClient::WaitForSecurityKeyIpcServerChannel() {
|
| return wait_for_ipc_channel_return_value_;
|
| }
|
|
|
| -void FakeRemoteSecurityKeyIpcClient::EstablishIpcConnection(
|
| +void FakeSecurityKeyIpcClient::EstablishIpcConnection(
|
| const base::Closure& connection_ready_callback,
|
| const base::Closure& connection_error_callback) {
|
| if (establish_ipc_connection_should_succeed_) {
|
| @@ -45,7 +44,7 @@ void FakeRemoteSecurityKeyIpcClient::EstablishIpcConnection(
|
| }
|
| }
|
|
|
| -bool FakeRemoteSecurityKeyIpcClient::SendSecurityKeyRequest(
|
| +bool FakeSecurityKeyIpcClient::SendSecurityKeyRequest(
|
| const std::string& request_payload,
|
| const ResponseCallback& response_callback) {
|
| if (send_security_request_should_succeed_) {
|
| @@ -57,13 +56,12 @@ bool FakeRemoteSecurityKeyIpcClient::SendSecurityKeyRequest(
|
| return send_security_request_should_succeed_;
|
| }
|
|
|
| -void FakeRemoteSecurityKeyIpcClient::CloseIpcConnection() {
|
| +void FakeSecurityKeyIpcClient::CloseIpcConnection() {
|
| client_channel_.reset();
|
| channel_event_callback_.Run();
|
| }
|
|
|
| -bool FakeRemoteSecurityKeyIpcClient::ConnectViaIpc(
|
| - const std::string& channel_name) {
|
| +bool FakeSecurityKeyIpcClient::ConnectViaIpc(const std::string& channel_name) {
|
| // The retry loop is needed as the IPC Servers we connect to are reset (torn
|
| // down and recreated) in some tests and we should be resilient in that case.
|
| IPC::ChannelHandle channel_handle(channel_name);
|
| @@ -83,16 +81,15 @@ bool FakeRemoteSecurityKeyIpcClient::ConnectViaIpc(
|
| return false;
|
| }
|
|
|
| -void FakeRemoteSecurityKeyIpcClient::SendSecurityKeyRequestViaIpc(
|
| +void FakeSecurityKeyIpcClient::SendSecurityKeyRequestViaIpc(
|
| const std::string& request_payload) {
|
| client_channel_->Send(
|
| new ChromotingRemoteSecurityKeyToNetworkMsg_Request(request_payload));
|
| }
|
|
|
| -bool FakeRemoteSecurityKeyIpcClient::OnMessageReceived(
|
| - const IPC::Message& message) {
|
| +bool FakeSecurityKeyIpcClient::OnMessageReceived(const IPC::Message& message) {
|
| bool handled = true;
|
| - IPC_BEGIN_MESSAGE_MAP(FakeRemoteSecurityKeyIpcClient, message)
|
| + IPC_BEGIN_MESSAGE_MAP(FakeSecurityKeyIpcClient, message)
|
| IPC_MESSAGE_HANDLER(
|
| ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionDetails,
|
| OnConnectionDetails)
|
| @@ -105,23 +102,23 @@ bool FakeRemoteSecurityKeyIpcClient::OnMessageReceived(
|
| return handled;
|
| }
|
|
|
| -void FakeRemoteSecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) {
|
| +void FakeSecurityKeyIpcClient::OnChannelConnected(int32_t peer_pid) {
|
| ipc_channel_connected_ = true;
|
| channel_event_callback_.Run();
|
| }
|
|
|
| -void FakeRemoteSecurityKeyIpcClient::OnChannelError() {
|
| +void FakeSecurityKeyIpcClient::OnChannelError() {
|
| ipc_channel_connected_ = false;
|
| channel_event_callback_.Run();
|
| }
|
|
|
| -void FakeRemoteSecurityKeyIpcClient::OnConnectionDetails(
|
| +void FakeSecurityKeyIpcClient::OnConnectionDetails(
|
| const std::string& channel_name) {
|
| last_message_received_ = channel_name;
|
| channel_event_callback_.Run();
|
| }
|
|
|
| -void FakeRemoteSecurityKeyIpcClient::OnSecurityKeyResponse(
|
| +void FakeSecurityKeyIpcClient::OnSecurityKeyResponse(
|
| const std::string& request_data) {
|
| last_message_received_ = request_data;
|
| channel_event_callback_.Run();
|
|
|