| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_INTERNAL_API_SYNC_MANAGER_IMPL_H_ | 5 #ifndef COMPONENTS_SYNC_CORE_IMPL_SYNC_MANAGER_IMPL_H_ |
| 6 #define SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_ | 6 #define COMPONENTS_SYNC_CORE_IMPL_SYNC_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "components/sync/base/cryptographer.h" |
| 17 #include "components/sync/base/sync_export.h" |
| 18 #include "components/sync/base/time.h" |
| 19 #include "components/sync/core/sync_manager.h" |
| 20 #include "components/sync/core/user_share.h" |
| 21 #include "components/sync/core_impl/change_reorder_buffer.h" |
| 22 #include "components/sync/core_impl/debug_info_event_listener.h" |
| 23 #include "components/sync/core_impl/js_mutation_event_observer.h" |
| 24 #include "components/sync/core_impl/js_sync_encryption_handler_observer.h" |
| 25 #include "components/sync/core_impl/js_sync_manager_observer.h" |
| 26 #include "components/sync/core_impl/protocol_event_buffer.h" |
| 27 #include "components/sync/core_impl/sync_encryption_handler_impl.h" |
| 28 #include "components/sync/engine_impl/all_status.h" |
| 29 #include "components/sync/engine_impl/net/server_connection_manager.h" |
| 30 #include "components/sync/engine_impl/nudge_handler.h" |
| 31 #include "components/sync/engine_impl/sync_engine_event_listener.h" |
| 32 #include "components/sync/js/js_backend.h" |
| 33 #include "components/sync/syncable/directory_change_delegate.h" |
| 16 #include "net/base/network_change_notifier.h" | 34 #include "net/base/network_change_notifier.h" |
| 17 #include "sync/base/sync_export.h" | |
| 18 #include "sync/engine/all_status.h" | |
| 19 #include "sync/engine/net/server_connection_manager.h" | |
| 20 #include "sync/engine/nudge_handler.h" | |
| 21 #include "sync/engine/sync_engine_event_listener.h" | |
| 22 #include "sync/internal_api/change_reorder_buffer.h" | |
| 23 #include "sync/internal_api/debug_info_event_listener.h" | |
| 24 #include "sync/internal_api/js_mutation_event_observer.h" | |
| 25 #include "sync/internal_api/js_sync_encryption_handler_observer.h" | |
| 26 #include "sync/internal_api/js_sync_manager_observer.h" | |
| 27 #include "sync/internal_api/protocol_event_buffer.h" | |
| 28 #include "sync/internal_api/public/sync_manager.h" | |
| 29 #include "sync/internal_api/public/user_share.h" | |
| 30 #include "sync/internal_api/sync_encryption_handler_impl.h" | |
| 31 #include "sync/js/js_backend.h" | |
| 32 #include "sync/syncable/directory_change_delegate.h" | |
| 33 #include "sync/util/cryptographer.h" | |
| 34 #include "sync/util/time.h" | |
| 35 | 35 |
| 36 class GURL; | 36 class GURL; |
| 37 | 37 |
| 38 namespace syncer { | 38 namespace syncer { |
| 39 | 39 |
| 40 class ModelTypeRegistry; | 40 class ModelTypeRegistry; |
| 41 class SyncAPIServerConnectionManager; | 41 class SyncAPIServerConnectionManager; |
| 42 class TypeDebugInfoObserver; | 42 class TypeDebugInfoObserver; |
| 43 class WriteNode; | 43 class WriteNode; |
| 44 class WriteTransaction; | 44 class WriteTransaction; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // versions of an entry. Note that a node's index may change without its | 214 // versions of an entry. Note that a node's index may change without its |
| 215 // UNIQUE_POSITION changing if its sibling nodes were changed. To handle such | 215 // UNIQUE_POSITION changing if its sibling nodes were changed. To handle such |
| 216 // cases, we rely on the caller to treat a position update on any sibling as | 216 // cases, we rely on the caller to treat a position update on any sibling as |
| 217 // updating the positions of all siblings. | 217 // updating the positions of all siblings. |
| 218 bool VisiblePositionsDiffer( | 218 bool VisiblePositionsDiffer( |
| 219 const syncable::EntryKernelMutation& mutation) const; | 219 const syncable::EntryKernelMutation& mutation) const; |
| 220 | 220 |
| 221 // Determine if any of the fields made visible to clients of the Sync API | 221 // Determine if any of the fields made visible to clients of the Sync API |
| 222 // differ between the versions of an entry stored in |a| and |b|. A return | 222 // differ between the versions of an entry stored in |a| and |b|. A return |
| 223 // value of false means that it should be OK to ignore this change. | 223 // value of false means that it should be OK to ignore this change. |
| 224 bool VisiblePropertiesDiffer( | 224 bool VisiblePropertiesDiffer(const syncable::EntryKernelMutation& mutation, |
| 225 const syncable::EntryKernelMutation& mutation, | 225 Cryptographer* cryptographer) const; |
| 226 Cryptographer* cryptographer) const; | |
| 227 | 226 |
| 228 // Open the directory named with |username|. | 227 // Open the directory named with |username|. |
| 229 bool OpenDirectory(const std::string& username); | 228 bool OpenDirectory(const std::string& username); |
| 230 | 229 |
| 231 // Purge those disabled types as specified by |to_purge|. |to_journal| and | 230 // Purge those disabled types as specified by |to_purge|. |to_journal| and |
| 232 // |to_unapply| specify subsets that require special handling. |to_journal| | 231 // |to_unapply| specify subsets that require special handling. |to_journal| |
| 233 // types are saved into the delete journal, while |to_unapply| have only | 232 // types are saved into the delete journal, while |to_unapply| have only |
| 234 // their local data deleted, while their server data is preserved. | 233 // their local data deleted, while their server data is preserved. |
| 235 bool PurgeDisabledTypes(ModelTypeSet to_purge, | 234 bool PurgeDisabledTypes(ModelTypeSet to_purge, |
| 236 ModelTypeSet to_journal, | 235 ModelTypeSet to_journal, |
| 237 ModelTypeSet to_unapply); | 236 ModelTypeSet to_unapply); |
| 238 | 237 |
| 239 void RequestNudgeForDataTypes( | 238 void RequestNudgeForDataTypes(const tracked_objects::Location& nudge_location, |
| 240 const tracked_objects::Location& nudge_location, | 239 ModelTypeSet type); |
| 241 ModelTypeSet type); | |
| 242 | 240 |
| 243 // If this is a deletion for a password, sets the legacy | 241 // If this is a deletion for a password, sets the legacy |
| 244 // ExtraPasswordChangeRecordData field of |buffer|. Otherwise sets | 242 // ExtraPasswordChangeRecordData field of |buffer|. Otherwise sets |
| 245 // |buffer|'s specifics field to contain the unencrypted data. | 243 // |buffer|'s specifics field to contain the unencrypted data. |
| 246 void SetExtraChangeRecordData(int64_t id, | 244 void SetExtraChangeRecordData(int64_t id, |
| 247 ModelType type, | 245 ModelType type, |
| 248 ChangeReorderBuffer* buffer, | 246 ChangeReorderBuffer* buffer, |
| 249 Cryptographer* cryptographer, | 247 Cryptographer* cryptographer, |
| 250 const syncable::EntryKernel& original, | 248 const syncable::EntryKernel& original, |
| 251 bool existed_before, | 249 bool existed_before, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 // with the cryptographer. | 338 // with the cryptographer. |
| 341 std::unique_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; | 339 std::unique_ptr<SyncEncryptionHandlerImpl> sync_encryption_handler_; |
| 342 | 340 |
| 343 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_; | 341 base::WeakPtrFactory<SyncManagerImpl> weak_ptr_factory_; |
| 344 | 342 |
| 345 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); | 343 DISALLOW_COPY_AND_ASSIGN(SyncManagerImpl); |
| 346 }; | 344 }; |
| 347 | 345 |
| 348 } // namespace syncer | 346 } // namespace syncer |
| 349 | 347 |
| 350 #endif // SYNC_INTERNAL_API_SYNC_MANAGER_IMPL_H_ | 348 #endif // COMPONENTS_SYNC_CORE_IMPL_SYNC_MANAGER_IMPL_H_ |
| OLD | NEW |