OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/proximity_auth/cryptauth/sync_scheduler.h" | |
6 | |
7 #include "components/proximity_auth/logging/logging.h" | |
8 | |
9 namespace proximity_auth { | |
10 | |
11 SyncScheduler::SyncRequest::SyncRequest( | |
12 base::WeakPtr<SyncScheduler> sync_scheduler, | |
13 bool is_aggressive_recovery) | |
14 : sync_scheduler_(sync_scheduler), | |
15 is_aggressive_recovery_(is_aggressive_recovery), | |
Ilya Sherman
2015/05/18 23:25:38
What is this variable used for?
Tim Song
2015/05/19 22:13:18
I was going to use it to set the InvocationReason
| |
16 completed_(false) { | |
17 } | |
18 | |
19 SyncScheduler::SyncRequest::~SyncRequest() { | |
20 if (!completed_) | |
21 PA_LOG(ERROR) << "SyncRequest destroyed but Complete() was never called"; | |
22 } | |
23 | |
24 void SyncScheduler::SyncRequest::Complete(bool success) { | |
25 if (sync_scheduler_) { | |
26 sync_scheduler_->OnSyncCompleted(success); | |
27 sync_scheduler_.reset(); | |
28 completed_ = true; | |
29 } else { | |
30 PA_LOG(ERROR) << "SyncRequest completed, but SyncScheduler destroyed."; | |
31 } | |
32 } | |
33 | |
34 } // proximity_auth | |
OLD | NEW |