| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines the "sync API", an interface to the syncer | 5 // This file defines the "sync API", an interface to the syncer |
| 6 // backend that exposes (1) the core functionality of maintaining a consistent | 6 // backend that exposes (1) the core functionality of maintaining a consistent |
| 7 // local snapshot of a hierarchical object set; (2) a means to transactionally | 7 // local snapshot of a hierarchical object set; (2) a means to transactionally |
| 8 // access and modify those objects; (3) a means to control client/server | 8 // access and modify those objects; (3) a means to control client/server |
| 9 // synchronization tasks, namely: pushing local object modifications to a | 9 // synchronization tasks, namely: pushing local object modifications to a |
| 10 // server, pulling nonlocal object modifications from a server to this client, | 10 // server, pulling nonlocal object modifications from a server to this client, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 class ScopedDirLookup; | 72 class ScopedDirLookup; |
| 73 class WriteTransaction; | 73 class WriteTransaction; |
| 74 } | 74 } |
| 75 | 75 |
| 76 namespace sync_pb { | 76 namespace sync_pb { |
| 77 class AppSpecifics; | 77 class AppSpecifics; |
| 78 class AutofillSpecifics; | 78 class AutofillSpecifics; |
| 79 class BookmarkSpecifics; | 79 class BookmarkSpecifics; |
| 80 class EntitySpecifics; | 80 class EntitySpecifics; |
| 81 class ExtensionSpecifics; | 81 class ExtensionSpecifics; |
| 82 class SessionSpecifics; |
| 82 class NigoriSpecifics; | 83 class NigoriSpecifics; |
| 83 class PasswordSpecifics; | 84 class PasswordSpecifics; |
| 84 class PreferenceSpecifics; | 85 class PreferenceSpecifics; |
| 85 class PasswordSpecifics; | 86 class PasswordSpecifics; |
| 86 class PasswordSpecificsData; | 87 class PasswordSpecificsData; |
| 87 class ThemeSpecifics; | 88 class ThemeSpecifics; |
| 88 class TypedUrlSpecifics; | 89 class TypedUrlSpecifics; |
| 89 } | 90 } |
| 90 | 91 |
| 91 namespace sync_api { | 92 namespace sync_api { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 const sync_pb::ThemeSpecifics& GetThemeSpecifics() const; | 202 const sync_pb::ThemeSpecifics& GetThemeSpecifics() const; |
| 202 | 203 |
| 203 // Getter specific to the TYPED_URLS datatype. Returns protobuf | 204 // Getter specific to the TYPED_URLS datatype. Returns protobuf |
| 204 // data. Can only be called if GetModelType() == TYPED_URLS. | 205 // data. Can only be called if GetModelType() == TYPED_URLS. |
| 205 const sync_pb::TypedUrlSpecifics& GetTypedUrlSpecifics() const; | 206 const sync_pb::TypedUrlSpecifics& GetTypedUrlSpecifics() const; |
| 206 | 207 |
| 207 // Getter specific to the EXTENSIONS datatype. Returns protobuf | 208 // Getter specific to the EXTENSIONS datatype. Returns protobuf |
| 208 // data. Can only be called if GetModelType() == EXTENSIONS. | 209 // data. Can only be called if GetModelType() == EXTENSIONS. |
| 209 const sync_pb::ExtensionSpecifics& GetExtensionSpecifics() const; | 210 const sync_pb::ExtensionSpecifics& GetExtensionSpecifics() const; |
| 210 | 211 |
| 212 // Getter specific to the SESSIONS datatype. Returns protobuf |
| 213 // data. Can only be called if GetModelType() == SESSIONS. |
| 214 const sync_pb::SessionSpecifics& GetSessionSpecifics() const; |
| 215 |
| 211 // Returns the local external ID associated with the node. | 216 // Returns the local external ID associated with the node. |
| 212 int64 GetExternalId() const; | 217 int64 GetExternalId() const; |
| 213 | 218 |
| 214 // Return the ID of the node immediately before this in the sibling order. | 219 // Return the ID of the node immediately before this in the sibling order. |
| 215 // For the first node in the ordering, return 0. | 220 // For the first node in the ordering, return 0. |
| 216 int64 GetPredecessorId() const; | 221 int64 GetPredecessorId() const; |
| 217 | 222 |
| 218 // Return the ID of the node immediately after this in the sibling order. | 223 // Return the ID of the node immediately after this in the sibling order. |
| 219 // For the last node in the ordering, return 0. | 224 // For the last node in the ordering, return 0. |
| 220 int64 GetSuccessorId() const; | 225 int64 GetSuccessorId() const; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 void SetThemeSpecifics(const sync_pb::ThemeSpecifics& specifics); | 351 void SetThemeSpecifics(const sync_pb::ThemeSpecifics& specifics); |
| 347 | 352 |
| 348 // Set the typed_url specifics (url, title, typed_count, etc). | 353 // Set the typed_url specifics (url, title, typed_count, etc). |
| 349 // Should only be called if GetModelType() == TYPED_URLS. | 354 // Should only be called if GetModelType() == TYPED_URLS. |
| 350 void SetTypedUrlSpecifics(const sync_pb::TypedUrlSpecifics& specifics); | 355 void SetTypedUrlSpecifics(const sync_pb::TypedUrlSpecifics& specifics); |
| 351 | 356 |
| 352 // Set the extension specifics (id, update url, enabled state, etc). | 357 // Set the extension specifics (id, update url, enabled state, etc). |
| 353 // Should only be called if GetModelType() == EXTENSIONS. | 358 // Should only be called if GetModelType() == EXTENSIONS. |
| 354 void SetExtensionSpecifics(const sync_pb::ExtensionSpecifics& specifics); | 359 void SetExtensionSpecifics(const sync_pb::ExtensionSpecifics& specifics); |
| 355 | 360 |
| 361 // Set the session specifics (windows, tabs, navigations etc.). |
| 362 // Should only be called if GetModelType() == SESSIONS. |
| 363 void SetSessionSpecifics(const sync_pb::SessionSpecifics& specifics); |
| 364 |
| 356 // Implementation of BaseNode's abstract virtual accessors. | 365 // Implementation of BaseNode's abstract virtual accessors. |
| 357 virtual const syncable::Entry* GetEntry() const; | 366 virtual const syncable::Entry* GetEntry() const; |
| 358 | 367 |
| 359 virtual const BaseTransaction* GetTransaction() const; | 368 virtual const BaseTransaction* GetTransaction() const; |
| 360 | 369 |
| 361 private: | 370 private: |
| 362 void* operator new(size_t size); // Node is meant for stack use only. | 371 void* operator new(size_t size); // Node is meant for stack use only. |
| 363 | 372 |
| 364 // Helper to set model type. This will clear any specifics data. | 373 // Helper to set model type. This will clear any specifics data. |
| 365 void PutModelType(syncable::ModelType model_type); | 374 void PutModelType(syncable::ModelType model_type); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 383 void PutPasswordSpecificsAndMarkForSyncing( | 392 void PutPasswordSpecificsAndMarkForSyncing( |
| 384 const sync_pb::PasswordSpecifics& new_value); | 393 const sync_pb::PasswordSpecifics& new_value); |
| 385 void PutPreferenceSpecificsAndMarkForSyncing( | 394 void PutPreferenceSpecificsAndMarkForSyncing( |
| 386 const sync_pb::PreferenceSpecifics& new_value); | 395 const sync_pb::PreferenceSpecifics& new_value); |
| 387 void PutThemeSpecificsAndMarkForSyncing( | 396 void PutThemeSpecificsAndMarkForSyncing( |
| 388 const sync_pb::ThemeSpecifics& new_value); | 397 const sync_pb::ThemeSpecifics& new_value); |
| 389 void PutTypedUrlSpecificsAndMarkForSyncing( | 398 void PutTypedUrlSpecificsAndMarkForSyncing( |
| 390 const sync_pb::TypedUrlSpecifics& new_value); | 399 const sync_pb::TypedUrlSpecifics& new_value); |
| 391 void PutExtensionSpecificsAndMarkForSyncing( | 400 void PutExtensionSpecificsAndMarkForSyncing( |
| 392 const sync_pb::ExtensionSpecifics& new_value); | 401 const sync_pb::ExtensionSpecifics& new_value); |
| 402 void PutSessionSpecificsAndMarkForSyncing( |
| 403 const sync_pb::SessionSpecifics& new_value); |
| 393 void PutSpecificsAndMarkForSyncing( | 404 void PutSpecificsAndMarkForSyncing( |
| 394 const sync_pb::EntitySpecifics& specifics); | 405 const sync_pb::EntitySpecifics& specifics); |
| 395 | 406 |
| 396 // Sets IS_UNSYNCED and SYNCING to ensure this entry is considered in an | 407 // Sets IS_UNSYNCED and SYNCING to ensure this entry is considered in an |
| 397 // upcoming commit pass. | 408 // upcoming commit pass. |
| 398 void MarkForSyncing(); | 409 void MarkForSyncing(); |
| 399 | 410 |
| 400 // The underlying syncable object which this class wraps. | 411 // The underlying syncable object which this class wraps. |
| 401 syncable::MutableEntry* entry_; | 412 syncable::MutableEntry* entry_; |
| 402 | 413 |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 // This allows actual HttpPostProvider subclass implementations to be | 924 // This allows actual HttpPostProvider subclass implementations to be |
| 914 // reference counted, which is useful if a particular implementation uses | 925 // reference counted, which is useful if a particular implementation uses |
| 915 // multiple threads to serve network requests. | 926 // multiple threads to serve network requests. |
| 916 virtual void Destroy(HttpPostProviderInterface* http) = 0; | 927 virtual void Destroy(HttpPostProviderInterface* http) = 0; |
| 917 virtual ~HttpPostProviderFactory() { } | 928 virtual ~HttpPostProviderFactory() { } |
| 918 }; | 929 }; |
| 919 | 930 |
| 920 } // namespace sync_api | 931 } // namespace sync_api |
| 921 | 932 |
| 922 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ | 933 #endif // CHROME_BROWSER_SYNC_ENGINE_SYNCAPI_H_ |
| OLD | NEW |