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

Unified Diff: remoting/protocol/protocol_mock_objects.cc

Issue 15709005: Linux pairing registry delegate implementation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Windows and Mac compile 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/protocol_mock_objects.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/protocol_mock_objects.cc
diff --git a/remoting/protocol/protocol_mock_objects.cc b/remoting/protocol/protocol_mock_objects.cc
index 1902d83acc9a65d1990e351e0c74d4433affc951..f558769cc919d8e819872171ba6b233e70e3c1df 100644
--- a/remoting/protocol/protocol_mock_objects.cc
+++ b/remoting/protocol/protocol_mock_objects.cc
@@ -54,31 +54,24 @@ MockPairingRegistryDelegate::MockPairingRegistryDelegate() {
MockPairingRegistryDelegate::~MockPairingRegistryDelegate() {
}
-void MockPairingRegistryDelegate::AddPairing(
- const PairingRegistry::Pairing& new_paired_client,
- const PairingRegistry::AddPairingCallback& callback) {
- paired_clients_[new_paired_client.client_id()] = new_paired_client;
+void MockPairingRegistryDelegate::Save(
+ const std::string& pairings_json,
+ const PairingRegistry::SaveCallback& callback) {
+ pairings_json_ = pairings_json;
if (!callback.is_null()) {
callback.Run(true);
}
}
-void MockPairingRegistryDelegate::GetPairing(
- const std::string& client_id,
- const PairingRegistry::GetPairingCallback& callback) {
- PairingRegistry::Pairing result;
- PairingRegistry::PairedClients::const_iterator i =
- paired_clients_.find(client_id);
- if (i != paired_clients_.end()) {
- result = i->second;
- }
- saved_callback_ = base::Bind(base::Bind(callback), result);
+void MockPairingRegistryDelegate::Load(
+ const PairingRegistry::LoadCallback& callback) {
+ load_callback_ = base::Bind(base::Bind(callback), pairings_json_);
}
void MockPairingRegistryDelegate::RunCallback() {
- DCHECK(!saved_callback_.is_null());
- saved_callback_.Run();
- saved_callback_.Reset();
+ DCHECK(!load_callback_.is_null());
+ load_callback_.Run();
+ load_callback_.Reset();
}
} // namespace protocol
« no previous file with comments | « remoting/protocol/protocol_mock_objects.h ('k') | remoting/remoting.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698