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

Unified Diff: remoting/protocol/protocol_mock_objects.h

Issue 16893002: Make the mapping from client id -> secret asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang errors. Created 7 years, 6 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/protocol/pairing_registry_unittest.cc ('k') | remoting/protocol/protocol_mock_objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/protocol_mock_objects.h
diff --git a/remoting/protocol/protocol_mock_objects.h b/remoting/protocol/protocol_mock_objects.h
index 54dc150d6f3a4299850e27228132f9e508ad96cc..7262ae595af689334b51f4d4fd8768184e9ff4db 100644
--- a/remoting/protocol/protocol_mock_objects.h
+++ b/remoting/protocol/protocol_mock_objects.h
@@ -16,6 +16,7 @@
#include "remoting/protocol/connection_to_client.h"
#include "remoting/protocol/host_stub.h"
#include "remoting/protocol/input_stub.h"
+#include "remoting/protocol/pairing_registry.h"
#include "remoting/protocol/session.h"
#include "remoting/protocol/session_manager.h"
#include "remoting/protocol/transport.h"
@@ -203,6 +204,30 @@ class MockSessionManager : public SessionManager {
DISALLOW_COPY_AND_ASSIGN(MockSessionManager);
};
+// Simple delegate that caches information on paired clients in memory.
+class MockPairingRegistryDelegate : public PairingRegistry::Delegate {
+ public:
+ MockPairingRegistryDelegate();
+ virtual ~MockPairingRegistryDelegate();
+
+ const PairingRegistry::PairedClients& paired_clients() const {
+ return paired_clients_;
+ }
+
+ // PairingRegistry::Delegate implementation.
+ virtual void AddPairing(
+ const PairingRegistry::Pairing& new_paired_client) OVERRIDE;
+ virtual void GetPairing(
+ const std::string& client_id,
+ const PairingRegistry::GetPairingCallback& callback) OVERRIDE;
+
+ void RunCallback();
+
+ private:
+ base::Closure saved_callback_;
+ PairingRegistry::PairedClients paired_clients_;
+};
+
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/pairing_registry_unittest.cc ('k') | remoting/protocol/protocol_mock_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698