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

Unified Diff: remoting/host/security_key/fake_ipc_gnubby_auth_handler.h

Issue 2167473003: Revert of Renaming Gnubby and RemoteSecurityKey files/classes/members (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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') | remoting/host/security_key/fake_ipc_gnubby_auth_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/security_key/fake_ipc_gnubby_auth_handler.h
diff --git a/remoting/host/security_key/fake_ipc_gnubby_auth_handler.h b/remoting/host/security_key/fake_ipc_gnubby_auth_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..73b5377f516a71bcff9f79159d1789459433d07e
--- /dev/null
+++ b/remoting/host/security_key/fake_ipc_gnubby_auth_handler.h
@@ -0,0 +1,72 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_SECURITY_KEY_FAKE_IPC_GNUBBY_AUTH_HANDLER_H_
+#define REMOTING_HOST_SECURITY_KEY_FAKE_IPC_GNUBBY_AUTH_HANDLER_H_
+
+#include "remoting/host/security_key/gnubby_auth_handler.h"
+
+#include <memory>
+#include <string>
+
+#include "base/time/time.h"
+#include "ipc/ipc_listener.h"
+
+namespace IPC {
+class Channel;
+class Message;
+} // IPC
+
+namespace remoting {
+
+// Simplified implementation of an IPC based GnubbyAuthHandler class used for
+// testing.
+class FakeIpcGnubbyAuthHandler : public GnubbyAuthHandler,
+ public IPC::Listener {
+ public:
+ FakeIpcGnubbyAuthHandler();
+ ~FakeIpcGnubbyAuthHandler() override;
+
+ // GnubbyAuthHandler interface.
+ void CreateGnubbyConnection() override;
+ bool IsValidConnectionId(int gnubby_connection_id) const override;
+ void SendClientResponse(int gnubby_connection_id,
+ const std::string& response) override;
+ void SendErrorAndCloseConnection(int gnubby_connection_id) override;
+ void SetSendMessageCallback(const SendMessageCallback& callback) override;
+ size_t GetActiveConnectionCountForTest() const override;
+ void SetRequestTimeoutForTest(base::TimeDelta timeout) override;
+
+ void set_ipc_security_key_channel_name(
+ const std::string& ipc_security_key_channel_name) {
+ ipc_security_key_channel_name_ = ipc_security_key_channel_name;
+ }
+
+ void set_ipc_server_channel_name(const std::string& ipc_server_channel_name) {
+ ipc_server_channel_name_ = ipc_server_channel_name;
+ }
+
+ private:
+ // IPC::Listener implementation.
+ bool OnMessageReceived(const IPC::Message& message) override;
+ void OnChannelConnected(int32_t peer_pid) override;
+ void OnChannelError() override;
+
+ // The name used when creating the well-known IPC Server channel.
+ std::string ipc_server_channel_name_;
+
+ // The channel name returned in the test connection details message and used
+ // to exchange security key messages over IPC.
+ std::string ipc_security_key_channel_name_;
+
+ // IPC Clients connect to this channel first to receive their own unique IPC
+ // channel to start a security key forwarding session on.
+ std::unique_ptr<IPC::Channel> ipc_server_channel_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeIpcGnubbyAuthHandler);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_SECURITY_KEY_FAKE_IPC_GNUBBY_AUTH_HANDLER_H_
« no previous file with comments | « remoting/host/remoting_me2me_host.cc ('k') | remoting/host/security_key/fake_ipc_gnubby_auth_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698