| 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 #include "remoting/protocol/pairing_registry.h" | 5 #include "remoting/protocol/pairing_registry.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 PairingRegistry::Pairing::Pairing(const base::Time& created_time, | 37 PairingRegistry::Pairing::Pairing(const base::Time& created_time, |
| 38 const std::string& client_name, | 38 const std::string& client_name, |
| 39 const std::string& client_id, | 39 const std::string& client_id, |
| 40 const std::string& shared_secret) | 40 const std::string& shared_secret) |
| 41 : created_time_(created_time), | 41 : created_time_(created_time), |
| 42 client_name_(client_name), | 42 client_name_(client_name), |
| 43 client_id_(client_id), | 43 client_id_(client_id), |
| 44 shared_secret_(shared_secret) { | 44 shared_secret_(shared_secret) { |
| 45 } | 45 } |
| 46 | 46 |
| 47 PairingRegistry::Pairing::Pairing(const Pairing& other) = default; |
| 48 |
| 47 PairingRegistry::Pairing::~Pairing() { | 49 PairingRegistry::Pairing::~Pairing() { |
| 48 } | 50 } |
| 49 | 51 |
| 50 PairingRegistry::Pairing PairingRegistry::Pairing::Create( | 52 PairingRegistry::Pairing PairingRegistry::Pairing::Create( |
| 51 const std::string& client_name) { | 53 const std::string& client_name) { |
| 52 base::Time created_time = base::Time::Now(); | 54 base::Time created_time = base::Time::Now(); |
| 53 std::string client_id = base::GenerateGUID(); | 55 std::string client_id = base::GenerateGUID(); |
| 54 std::string shared_secret; | 56 std::string shared_secret; |
| 55 char buffer[kKeySize]; | 57 char buffer[kKeySize]; |
| 56 crypto::RandBytes(buffer, arraysize(buffer)); | 58 crypto::RandBytes(buffer, arraysize(buffer)); |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 300 |
| 299 void PairingRegistry::ServiceNextRequest() { | 301 void PairingRegistry::ServiceNextRequest() { |
| 300 if (pending_requests_.empty()) | 302 if (pending_requests_.empty()) |
| 301 return; | 303 return; |
| 302 | 304 |
| 303 PostTask(delegate_task_runner_, FROM_HERE, pending_requests_.front()); | 305 PostTask(delegate_task_runner_, FROM_HERE, pending_requests_.front()); |
| 304 } | 306 } |
| 305 | 307 |
| 306 } // namespace protocol | 308 } // namespace protocol |
| 307 } // namespace remoting | 309 } // namespace remoting |
| OLD | NEW |