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 SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ |
6 #define SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ | 6 #define SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 void ApplyUpdates(sessions::StatusController* status) override; | 61 void ApplyUpdates(sessions::StatusController* status) override; |
62 void PassiveApplyUpdates(sessions::StatusController* status) override; | 62 void PassiveApplyUpdates(sessions::StatusController* status) override; |
63 | 63 |
64 private: | 64 private: |
65 friend class DirectoryUpdateHandlerApplyUpdateTest; | 65 friend class DirectoryUpdateHandlerApplyUpdateTest; |
66 friend class DirectoryUpdateHandlerProcessUpdateTest; | 66 friend class DirectoryUpdateHandlerProcessUpdateTest; |
67 | 67 |
68 // Sometimes there is nothing to do, so we can return without doing anything. | 68 // Sometimes there is nothing to do, so we can return without doing anything. |
69 bool IsApplyUpdatesRequired(); | 69 bool IsApplyUpdatesRequired(); |
70 | 70 |
| 71 // Called at the end of ApplyUpdates and PassiveApplyUpdates and performs |
| 72 // steps common to both (even when IsApplyUpdatesRequired has returned |
| 73 // false). |
| 74 void PostApplyUpdates(); |
| 75 |
71 // Processes the given SyncEntities and stores their data in the directory. | 76 // Processes the given SyncEntities and stores their data in the directory. |
72 // Their types must match this update handler's type. | 77 // Their types must match this update handler's type. |
73 void UpdateSyncEntities( | 78 void UpdateSyncEntities( |
74 syncable::ModelNeutralWriteTransaction* trans, | 79 syncable::ModelNeutralWriteTransaction* trans, |
75 const SyncEntityList& applicable_updates, | 80 const SyncEntityList& applicable_updates, |
76 sessions::StatusController* status); | 81 sessions::StatusController* status); |
77 | 82 |
78 // Expires entries according to GC directives. | 83 // Expires entries according to GC directives. |
79 void ExpireEntriesIfNeeded( | 84 void ExpireEntriesIfNeeded( |
80 syncable::ModelNeutralWriteTransaction* trans, | 85 syncable::ModelNeutralWriteTransaction* trans, |
(...skipping 19 matching lines...) Expand all Loading... |
100 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; | 105 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; |
101 | 106 |
102 scoped_ptr<sync_pb::GarbageCollectionDirective> cached_gc_directive_; | 107 scoped_ptr<sync_pb::GarbageCollectionDirective> cached_gc_directive_; |
103 | 108 |
104 DISALLOW_COPY_AND_ASSIGN(DirectoryUpdateHandler); | 109 DISALLOW_COPY_AND_ASSIGN(DirectoryUpdateHandler); |
105 }; | 110 }; |
106 | 111 |
107 } // namespace syncer | 112 } // namespace syncer |
108 | 113 |
109 #endif // SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ | 114 #endif // SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ |
OLD | NEW |