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 SYNC_ENGINE_SYNCER_H_ | 5 #ifndef SYNC_ENGINE_SYNCER_H_ |
6 #define SYNC_ENGINE_SYNCER_H_ | 6 #define SYNC_ENGINE_SYNCER_H_ |
7 | 7 |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 14 #include "sync/base/sync_export.h" |
14 #include "sync/engine/conflict_resolver.h" | 15 #include "sync/engine/conflict_resolver.h" |
15 #include "sync/engine/syncer_types.h" | 16 #include "sync/engine/syncer_types.h" |
16 #include "sync/internal_api/public/base/model_type.h" | 17 #include "sync/internal_api/public/base/model_type.h" |
17 #include "sync/sessions/sync_session.h" | 18 #include "sync/sessions/sync_session.h" |
18 #include "sync/util/extensions_activity_monitor.h" | 19 #include "sync/util/extensions_activity_monitor.h" |
19 | 20 |
20 namespace syncer { | 21 namespace syncer { |
21 | 22 |
22 namespace syncable { | 23 namespace syncable { |
23 class Entry; | 24 class Entry; |
(...skipping 13 matching lines...) Expand all Loading... |
37 // A Syncer provides a control interface for driving the individual steps | 38 // A Syncer provides a control interface for driving the individual steps |
38 // of the sync cycle. Each cycle (hopefully) moves the client into closer | 39 // of the sync cycle. Each cycle (hopefully) moves the client into closer |
39 // synchronization with the server. The individual steps are modeled | 40 // synchronization with the server. The individual steps are modeled |
40 // as SyncerCommands, and the ordering of the steps is expressed using | 41 // as SyncerCommands, and the ordering of the steps is expressed using |
41 // the SyncerStep enum. | 42 // the SyncerStep enum. |
42 // | 43 // |
43 // A Syncer instance expects to run on a dedicated thread. Calls | 44 // A Syncer instance expects to run on a dedicated thread. Calls |
44 // to SyncShare() may take an unbounded amount of time, as SyncerCommands | 45 // to SyncShare() may take an unbounded amount of time, as SyncerCommands |
45 // may block on network i/o, on lock contention, or on tasks posted to | 46 // may block on network i/o, on lock contention, or on tasks posted to |
46 // other threads. | 47 // other threads. |
47 class Syncer { | 48 class SYNC_EXPORT_PRIVATE Syncer { |
48 public: | 49 public: |
49 typedef std::vector<int64> UnsyncedMetaHandles; | 50 typedef std::vector<int64> UnsyncedMetaHandles; |
50 | 51 |
51 Syncer(); | 52 Syncer(); |
52 virtual ~Syncer(); | 53 virtual ~Syncer(); |
53 | 54 |
54 // Called by other threads to tell the syncer to stop what it's doing | 55 // Called by other threads to tell the syncer to stop what it's doing |
55 // and return early from SyncShare, if possible. | 56 // and return early from SyncShare, if possible. |
56 bool ExitRequested(); | 57 bool ExitRequested(); |
57 void RequestEarlyExit(); | 58 void RequestEarlyExit(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 }; | 94 }; |
94 | 95 |
95 // Utility function declarations. | 96 // Utility function declarations. |
96 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); | 97 void CopyServerFields(syncable::Entry* src, syncable::MutableEntry* dest); |
97 void ClearServerData(syncable::MutableEntry* entry); | 98 void ClearServerData(syncable::MutableEntry* entry); |
98 const char* SyncerStepToString(const SyncerStep); | 99 const char* SyncerStepToString(const SyncerStep); |
99 | 100 |
100 } // namespace syncer | 101 } // namespace syncer |
101 | 102 |
102 #endif // SYNC_ENGINE_SYNCER_H_ | 103 #endif // SYNC_ENGINE_SYNCER_H_ |
OLD | NEW |