OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_H_ |
6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 16 matching lines...) Expand all Loading... |
27 // cycles consist of downloading updates, parsing the response (aka. process | 27 // cycles consist of downloading updates, parsing the response (aka. process |
28 // updates), applying updates while resolving conflicts, and committing local | 28 // updates), applying updates while resolving conflicts, and committing local |
29 // changes. Some of these steps may be skipped if they're deemed to be | 29 // changes. Some of these steps may be skipped if they're deemed to be |
30 // unnecessary. | 30 // unnecessary. |
31 // | 31 // |
32 // A Syncer instance expects to run on a dedicated thread. Calls to SyncShare() | 32 // A Syncer instance expects to run on a dedicated thread. Calls to SyncShare() |
33 // may take an unbounded amount of time because it may block on network I/O, on | 33 // may take an unbounded amount of time because it may block on network I/O, on |
34 // lock contention, or on tasks posted to other threads. | 34 // lock contention, or on tasks posted to other threads. |
35 class Syncer { | 35 class Syncer { |
36 public: | 36 public: |
37 typedef std::vector<int64_t> UnsyncedMetaHandles; | 37 using UnsyncedMetaHandles = std::vector<int64_t>; |
38 | 38 |
39 explicit Syncer(CancelationSignal* cancelation_signal); | 39 explicit Syncer(CancelationSignal* cancelation_signal); |
40 virtual ~Syncer(); | 40 virtual ~Syncer(); |
41 | 41 |
42 // Whether an early exist was requested due to a cancelation signal. | 42 // Whether an early exist was requested due to a cancelation signal. |
43 bool ExitRequested(); | 43 bool ExitRequested(); |
44 | 44 |
45 // Whether the syncer is in the middle of a sync cycle. | 45 // Whether the syncer is in the middle of a sync cycle. |
46 bool IsSyncing() const; | 46 bool IsSyncing() const; |
47 | 47 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 125 |
126 // Whether the syncer is in the middle of a sync attempt. | 126 // Whether the syncer is in the middle of a sync attempt. |
127 bool is_syncing_; | 127 bool is_syncing_; |
128 | 128 |
129 DISALLOW_COPY_AND_ASSIGN(Syncer); | 129 DISALLOW_COPY_AND_ASSIGN(Syncer); |
130 }; | 130 }; |
131 | 131 |
132 } // namespace syncer | 132 } // namespace syncer |
133 | 133 |
134 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_H_ | 134 #endif // COMPONENTS_SYNC_ENGINE_IMPL_SYNCER_H_ |
OLD | NEW |