| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef REMOTING_PROTOCOL_PAIRING_REGISTRY_H_ | 5 #ifndef REMOTING_PROTOCOL_PAIRING_REGISTRY_H_ |
| 6 #define REMOTING_PROTOCOL_PAIRING_REGISTRY_H_ | 6 #define REMOTING_PROTOCOL_PAIRING_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // * The shared secret for the client. This is generated on-demand by this | 40 // * The shared secret for the client. This is generated on-demand by this |
| 41 // class and used in the SPAKE2 exchange to mutually verify identity. | 41 // class and used in the SPAKE2 exchange to mutually verify identity. |
| 42 class PairingRegistry : public base::RefCountedThreadSafe<PairingRegistry> { | 42 class PairingRegistry : public base::RefCountedThreadSafe<PairingRegistry> { |
| 43 public: | 43 public: |
| 44 struct Pairing { | 44 struct Pairing { |
| 45 Pairing(); | 45 Pairing(); |
| 46 Pairing(const base::Time& created_time, | 46 Pairing(const base::Time& created_time, |
| 47 const std::string& client_name, | 47 const std::string& client_name, |
| 48 const std::string& client_id, | 48 const std::string& client_id, |
| 49 const std::string& shared_secret); | 49 const std::string& shared_secret); |
| 50 Pairing(const Pairing& other); |
| 50 ~Pairing(); | 51 ~Pairing(); |
| 51 | 52 |
| 52 static Pairing Create(const std::string& client_name); | 53 static Pairing Create(const std::string& client_name); |
| 53 static Pairing CreateFromValue(const base::DictionaryValue& pairing); | 54 static Pairing CreateFromValue(const base::DictionaryValue& pairing); |
| 54 | 55 |
| 55 scoped_ptr<base::DictionaryValue> ToValue() const; | 56 scoped_ptr<base::DictionaryValue> ToValue() const; |
| 56 | 57 |
| 57 bool operator==(const Pairing& other) const; | 58 bool operator==(const Pairing& other) const; |
| 58 | 59 |
| 59 bool is_valid() const; | 60 bool is_valid() const; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 197 |
| 197 std::queue<base::Closure> pending_requests_; | 198 std::queue<base::Closure> pending_requests_; |
| 198 | 199 |
| 199 DISALLOW_COPY_AND_ASSIGN(PairingRegistry); | 200 DISALLOW_COPY_AND_ASSIGN(PairingRegistry); |
| 200 }; | 201 }; |
| 201 | 202 |
| 202 } // namespace protocol | 203 } // namespace protocol |
| 203 } // namespace remoting | 204 } // namespace remoting |
| 204 | 205 |
| 205 #endif // REMOTING_PROTOCOL_PAIRING_REGISTRY_H_ | 206 #endif // REMOTING_PROTOCOL_PAIRING_REGISTRY_H_ |
| OLD | NEW |