OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_DIRECTORY_UPDATE_HANDLER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_UPDATE_HANDLER_H_ |
6 #define SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_UPDATE_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "sync/base/sync_export.h" | 13 #include "components/sync/base/model_type.h" |
14 #include "sync/engine/process_updates_util.h" | 14 #include "components/sync/base/sync_export.h" |
15 #include "sync/engine/update_handler.h" | 15 #include "components/sync/base/syncer_error.h" |
16 #include "sync/internal_api/public/base/model_type.h" | 16 #include "components/sync/engine_impl/process_updates_util.h" |
17 #include "sync/internal_api/public/util/syncer_error.h" | 17 #include "components/sync/engine_impl/update_handler.h" |
18 | 18 |
19 namespace sync_pb { | 19 namespace sync_pb { |
20 class DataTypeProgressMarker; | 20 class DataTypeProgressMarker; |
21 class GarbageCollectionDirective; | 21 class GarbageCollectionDirective; |
22 class GetUpdatesResponse; | 22 class GetUpdatesResponse; |
23 } | 23 } |
24 | 24 |
25 namespace syncer { | 25 namespace syncer { |
26 | 26 |
27 namespace sessions { | 27 namespace sessions { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Sometimes there is nothing to do, so we can return without doing anything. | 69 // Sometimes there is nothing to do, so we can return without doing anything. |
70 bool IsApplyUpdatesRequired(); | 70 bool IsApplyUpdatesRequired(); |
71 | 71 |
72 // Called at the end of ApplyUpdates and PassiveApplyUpdates and performs | 72 // Called at the end of ApplyUpdates and PassiveApplyUpdates and performs |
73 // steps common to both (even when IsApplyUpdatesRequired has returned | 73 // steps common to both (even when IsApplyUpdatesRequired has returned |
74 // false). | 74 // false). |
75 void PostApplyUpdates(); | 75 void PostApplyUpdates(); |
76 | 76 |
77 // Processes the given SyncEntities and stores their data in the directory. | 77 // Processes the given SyncEntities and stores their data in the directory. |
78 // Their types must match this update handler's type. | 78 // Their types must match this update handler's type. |
79 void UpdateSyncEntities( | 79 void UpdateSyncEntities(syncable::ModelNeutralWriteTransaction* trans, |
80 syncable::ModelNeutralWriteTransaction* trans, | 80 const SyncEntityList& applicable_updates, |
81 const SyncEntityList& applicable_updates, | 81 sessions::StatusController* status); |
82 sessions::StatusController* status); | |
83 | 82 |
84 // Expires entries according to GC directives. | 83 // Expires entries according to GC directives. |
85 void ExpireEntriesIfNeeded( | 84 void ExpireEntriesIfNeeded( |
86 syncable::ModelNeutralWriteTransaction* trans, | 85 syncable::ModelNeutralWriteTransaction* trans, |
87 const sync_pb::DataTypeProgressMarker& progress_marker); | 86 const sync_pb::DataTypeProgressMarker& progress_marker); |
88 | 87 |
89 // Stores the given progress marker in the directory. | 88 // Stores the given progress marker in the directory. |
90 // Its type must match this update handler's type. | 89 // Its type must match this update handler's type. |
91 void UpdateProgressMarker( | 90 void UpdateProgressMarker( |
92 const sync_pb::DataTypeProgressMarker& progress_marker); | 91 const sync_pb::DataTypeProgressMarker& progress_marker); |
(...skipping 12 matching lines...) Expand all Loading... |
105 scoped_refptr<ModelSafeWorker> worker_; | 104 scoped_refptr<ModelSafeWorker> worker_; |
106 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; | 105 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; |
107 | 106 |
108 std::unique_ptr<sync_pb::GarbageCollectionDirective> cached_gc_directive_; | 107 std::unique_ptr<sync_pb::GarbageCollectionDirective> cached_gc_directive_; |
109 | 108 |
110 DISALLOW_COPY_AND_ASSIGN(DirectoryUpdateHandler); | 109 DISALLOW_COPY_AND_ASSIGN(DirectoryUpdateHandler); |
111 }; | 110 }; |
112 | 111 |
113 } // namespace syncer | 112 } // namespace syncer |
114 | 113 |
115 #endif // SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ | 114 #endif // COMPONENTS_SYNC_ENGINE_IMPL_DIRECTORY_UPDATE_HANDLER_H_ |
OLD | NEW |