| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 LOG(WARNING) << "Could not parse a pairing entry."; | 279 LOG(WARNING) << "Could not parse a pairing entry."; |
| 280 continue; | 280 continue; |
| 281 } | 281 } |
| 282 | 282 |
| 283 // Clear the shared secrect and append the pairing data to the list. | 283 // Clear the shared secrect and append the pairing data to the list. |
| 284 Pairing sanitized_pairing( | 284 Pairing sanitized_pairing( |
| 285 pairing.created_time(), | 285 pairing.created_time(), |
| 286 pairing.client_name(), | 286 pairing.client_name(), |
| 287 pairing.client_id(), | 287 pairing.client_id(), |
| 288 ""); | 288 ""); |
| 289 sanitized_pairings->Append(sanitized_pairing.ToValue().release()); | 289 sanitized_pairings->Append(sanitized_pairing.ToValue()); |
| 290 } | 290 } |
| 291 | 291 |
| 292 callback.Run(std::move(sanitized_pairings)); | 292 callback.Run(std::move(sanitized_pairings)); |
| 293 } | 293 } |
| 294 | 294 |
| 295 void PairingRegistry::ServiceOrQueueRequest(const base::Closure& request) { | 295 void PairingRegistry::ServiceOrQueueRequest(const base::Closure& request) { |
| 296 bool servicing_request = !pending_requests_.empty(); | 296 bool servicing_request = !pending_requests_.empty(); |
| 297 pending_requests_.push(request); | 297 pending_requests_.push(request); |
| 298 if (!servicing_request) { | 298 if (!servicing_request) { |
| 299 ServiceNextRequest(); | 299 ServiceNextRequest(); |
| 300 } | 300 } |
| 301 } | 301 } |
| 302 | 302 |
| 303 void PairingRegistry::ServiceNextRequest() { | 303 void PairingRegistry::ServiceNextRequest() { |
| 304 if (pending_requests_.empty()) | 304 if (pending_requests_.empty()) |
| 305 return; | 305 return; |
| 306 | 306 |
| 307 PostTask(delegate_task_runner_, FROM_HERE, pending_requests_.front()); | 307 PostTask(delegate_task_runner_, FROM_HERE, pending_requests_.front()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace protocol | 310 } // namespace protocol |
| 311 } // namespace remoting | 311 } // namespace remoting |
| OLD | NEW |