Chromium Code Reviews| Index: remoting/protocol/pairing_registry.cc |
| diff --git a/remoting/protocol/pairing_registry.cc b/remoting/protocol/pairing_registry.cc |
| index 54b66b04b79996bc335423cbaddb200755f9b6c5..10098b03ed74850a820670e1f9b5646a2d68caec 100644 |
| --- a/remoting/protocol/pairing_registry.cc |
| +++ b/remoting/protocol/pairing_registry.cc |
| @@ -15,17 +15,15 @@ namespace protocol { |
| // How many bytes of random data to use for the client id and shared secret. |
| const int kKeySize = 16; |
| -PairingRegistry::PairingRegistry(scoped_ptr<Delegate> delegate, |
| - const PairedClients& paired_clients) |
| +PairingRegistry::PairingRegistry(scoped_ptr<Delegate> delegate) |
| : delegate_(delegate.Pass()) { |
| DCHECK(delegate_); |
| - paired_clients_ = paired_clients; |
| } |
| PairingRegistry::~PairingRegistry() { |
| } |
| -const PairingRegistry::Pairing& PairingRegistry::CreatePairing( |
| +PairingRegistry::Pairing PairingRegistry::CreatePairing( |
|
rmsousa
2013/06/13 04:26:19
Not for current CL:
This is now a very thin layer
Jamie
2013/06/13 17:22:15
That's true. At one point there was some code here
|
| const std::string& client_name) { |
| DCHECK(CalledOnValidThread()); |
| @@ -42,27 +40,28 @@ const PairingRegistry::Pairing& PairingRegistry::CreatePairing( |
| } |
| // Save the result via the Delegate and return it to the caller. |
| - paired_clients_[result.client_id] = result; |
| - delegate_->Save(paired_clients_); |
| - |
| - return paired_clients_[result.client_id]; |
| + delegate_->AddPairing(result); |
| + return result; |
| } |
| -std::string PairingRegistry::GetSecret(const std::string& client_id) const { |
| +void PairingRegistry::GetPairing(const std::string& client_id, |
| + const GetPairingCallback& callback) { |
| DCHECK(CalledOnValidThread()); |
| + delegate_->GetPairing(client_id, callback); |
| +} |
| - std::string result; |
| - PairedClients::const_iterator i = paired_clients_.find(client_id); |
| - if (i != paired_clients_.end()) { |
| - result = i->second.shared_secret; |
| - } |
| - return result; |
| +void NotImplementedPairingRegistryDelegate::AddPairing( |
| + const PairingRegistry::Pairing& new_paired_client) { |
| + NOTIMPLEMENTED(); |
| } |
| -void NotImplementedPairingRegistryDelegate::Save( |
| - const PairingRegistry::PairedClients& paired_clients) { |
| +void NotImplementedPairingRegistryDelegate::GetPairing( |
| + const std::string& client_id, |
| + const PairingRegistry::GetPairingCallback& callback) { |
| NOTIMPLEMENTED(); |
| + callback.Run(PairingRegistry::Pairing()); |
| } |
| + |
| } // namespace protocol |
| } // namespace remoting |