| 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 14 matching lines...) Expand all Loading... |
| 25 namespace syncer { | 25 namespace syncer { |
| 26 | 26 |
| 27 namespace sessions { | 27 namespace sessions { |
| 28 class StatusController; | 28 class StatusController; |
| 29 } | 29 } |
| 30 | 30 |
| 31 namespace syncable { | 31 namespace syncable { |
| 32 class Directory; | 32 class Directory; |
| 33 } | 33 } |
| 34 | 34 |
| 35 class DirectoryTypeDebugInfoEmitter; |
| 35 class ModelSafeWorker; | 36 class ModelSafeWorker; |
| 36 | 37 |
| 37 // This class represents the syncable::Directory's processes for requesting and | 38 // This class represents the syncable::Directory's processes for requesting and |
| 38 // processing updates from the sync server. | 39 // processing updates from the sync server. |
| 39 // | 40 // |
| 40 // Each instance of this class represents a particular type in the | 41 // Each instance of this class represents a particular type in the |
| 41 // syncable::Directory. It can store and retreive that type's progress markers. | 42 // syncable::Directory. It can store and retreive that type's progress markers. |
| 42 // It can also process a set of received SyncEntities and store their data. | 43 // It can also process a set of received SyncEntities and store their data. |
| 43 class SYNC_EXPORT_PRIVATE DirectoryUpdateHandler : public UpdateHandler { | 44 class SYNC_EXPORT_PRIVATE DirectoryUpdateHandler : public UpdateHandler { |
| 44 public: | 45 public: |
| 45 DirectoryUpdateHandler(syncable::Directory* dir, | 46 DirectoryUpdateHandler(syncable::Directory* dir, |
| 46 ModelType type, | 47 ModelType type, |
| 47 scoped_refptr<ModelSafeWorker> worker); | 48 scoped_refptr<ModelSafeWorker> worker, |
| 49 DirectoryTypeDebugInfoEmitter* debug_info_emitter); |
| 48 virtual ~DirectoryUpdateHandler(); | 50 virtual ~DirectoryUpdateHandler(); |
| 49 | 51 |
| 50 // UpdateHandler implementation. | 52 // UpdateHandler implementation. |
| 51 virtual void GetDownloadProgress( | 53 virtual void GetDownloadProgress( |
| 52 sync_pb::DataTypeProgressMarker* progress_marker) const OVERRIDE; | 54 sync_pb::DataTypeProgressMarker* progress_marker) const OVERRIDE; |
| 53 virtual void GetDataTypeContext(sync_pb::DataTypeContext* context) const | 55 virtual void GetDataTypeContext(sync_pb::DataTypeContext* context) const |
| 54 OVERRIDE; | 56 OVERRIDE; |
| 55 virtual SyncerError ProcessGetUpdatesResponse( | 57 virtual SyncerError ProcessGetUpdatesResponse( |
| 56 const sync_pb::DataTypeProgressMarker& progress_marker, | 58 const sync_pb::DataTypeProgressMarker& progress_marker, |
| 57 const sync_pb::DataTypeContext& mutated_context, | 59 const sync_pb::DataTypeContext& mutated_context, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 86 | 88 |
| 87 bool IsValidProgressMarker( | 89 bool IsValidProgressMarker( |
| 88 const sync_pb::DataTypeProgressMarker& progress_marker) const; | 90 const sync_pb::DataTypeProgressMarker& progress_marker) const; |
| 89 | 91 |
| 90 // Skips all checks and goes straight to applying the updates. | 92 // Skips all checks and goes straight to applying the updates. |
| 91 SyncerError ApplyUpdatesImpl(sessions::StatusController* status); | 93 SyncerError ApplyUpdatesImpl(sessions::StatusController* status); |
| 92 | 94 |
| 93 syncable::Directory* dir_; | 95 syncable::Directory* dir_; |
| 94 ModelType type_; | 96 ModelType type_; |
| 95 scoped_refptr<ModelSafeWorker> worker_; | 97 scoped_refptr<ModelSafeWorker> worker_; |
| 98 DirectoryTypeDebugInfoEmitter* debug_info_emitter_; |
| 96 | 99 |
| 97 scoped_ptr<sync_pb::GarbageCollectionDirective> cached_gc_directive_; | 100 scoped_ptr<sync_pb::GarbageCollectionDirective> cached_gc_directive_; |
| 98 | 101 |
| 99 DISALLOW_COPY_AND_ASSIGN(DirectoryUpdateHandler); | 102 DISALLOW_COPY_AND_ASSIGN(DirectoryUpdateHandler); |
| 100 }; | 103 }; |
| 101 | 104 |
| 102 } // namespace syncer | 105 } // namespace syncer |
| 103 | 106 |
| 104 #endif // SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ | 107 #endif // SYNC_ENGINE_DIRECTORY_UPDATE_HANDLER_H_ |
| OLD | NEW |