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

Side by Side Diff: remoting/host/security_key/fake_security_key_ipc_server.cc

Issue 2575963002: Handle Security Key requests from outside the remoted session correctly (Closed)
Patch Set: Addressing CR Feedback Created 4 years 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 unified diff | Download patch
OLDNEW
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/fake_security_key_ipc_server.h" 5 #include "remoting/host/security_key/fake_security_key_ipc_server.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // we use it, otherwise we will use the IPC connection to send a message. 92 // we use it, otherwise we will use the IPC connection to send a message.
93 if (!send_response_callback_.is_null()) { 93 if (!send_response_callback_.is_null()) {
94 send_response_callback_.Run(); 94 send_response_callback_.Run();
95 return true; 95 return true;
96 } 96 }
97 97
98 return ipc_channel_->Send( 98 return ipc_channel_->Send(
99 new ChromotingNetworkToRemoteSecurityKeyMsg_Response(message_data)); 99 new ChromotingNetworkToRemoteSecurityKeyMsg_Response(message_data));
100 } 100 }
101 101
102 void FakeSecurityKeyIpcServer::SendConnectionReadyMessage() {
103 ipc_channel_->Send(
104 new ChromotingNetworkToRemoteSecurityKeyMsg_ConnectionReady());
105 }
106
107 void FakeSecurityKeyIpcServer::SendInvalidSessionMessage() {
108 ipc_channel_->Send(
109 new ChromotingNetworkToRemoteSecurityKeyMsg_InvalidSession());
110 }
111
102 FakeSecurityKeyIpcServerFactory::FakeSecurityKeyIpcServerFactory() { 112 FakeSecurityKeyIpcServerFactory::FakeSecurityKeyIpcServerFactory() {
103 SecurityKeyIpcServer::SetFactoryForTest(this); 113 SecurityKeyIpcServer::SetFactoryForTest(this);
104 } 114 }
105 115
106 FakeSecurityKeyIpcServerFactory::~FakeSecurityKeyIpcServerFactory() { 116 FakeSecurityKeyIpcServerFactory::~FakeSecurityKeyIpcServerFactory() {
107 SecurityKeyIpcServer::SetFactoryForTest(nullptr); 117 SecurityKeyIpcServer::SetFactoryForTest(nullptr);
108 } 118 }
109 119
110 std::unique_ptr<SecurityKeyIpcServer> FakeSecurityKeyIpcServerFactory::Create( 120 std::unique_ptr<SecurityKeyIpcServer> FakeSecurityKeyIpcServerFactory::Create(
111 int connection_id, 121 int connection_id,
(...skipping 10 matching lines...) Expand all
122 132
123 return fake_ipc_server; 133 return fake_ipc_server;
124 } 134 }
125 135
126 base::WeakPtr<FakeSecurityKeyIpcServer> 136 base::WeakPtr<FakeSecurityKeyIpcServer>
127 FakeSecurityKeyIpcServerFactory::GetIpcServerObject(int connection_id) { 137 FakeSecurityKeyIpcServerFactory::GetIpcServerObject(int connection_id) {
128 return ipc_server_map_[connection_id]; 138 return ipc_server_map_[connection_id];
129 } 139 }
130 140
131 } // namespace remoting 141 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698