| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SYNCABLE_DIRECTORY_H_ | 5 #ifndef SYNC_SYNCABLE_DIRECTORY_H_ |
| 6 #define SYNC_SYNCABLE_DIRECTORY_H_ | 6 #define SYNC_SYNCABLE_DIRECTORY_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 void IncrementTransactionVersion(ModelType type); | 293 void IncrementTransactionVersion(ModelType type); |
| 294 | 294 |
| 295 // Getter/setters for the per datatype context. | 295 // Getter/setters for the per datatype context. |
| 296 void GetDataTypeContext(BaseTransaction* trans, | 296 void GetDataTypeContext(BaseTransaction* trans, |
| 297 ModelType type, | 297 ModelType type, |
| 298 sync_pb::DataTypeContext* context) const; | 298 sync_pb::DataTypeContext* context) const; |
| 299 void SetDataTypeContext(BaseWriteTransaction* trans, | 299 void SetDataTypeContext(BaseWriteTransaction* trans, |
| 300 ModelType type, | 300 ModelType type, |
| 301 const sync_pb::DataTypeContext& context); | 301 const sync_pb::DataTypeContext& context); |
| 302 | 302 |
| 303 // Returns types for which the initial sync has ended. |
| 303 ModelTypeSet InitialSyncEndedTypes(); | 304 ModelTypeSet InitialSyncEndedTypes(); |
| 305 |
| 306 // Returns true if the initial sync for |type| has completed. |
| 304 bool InitialSyncEndedForType(ModelType type); | 307 bool InitialSyncEndedForType(ModelType type); |
| 308 bool InitialSyncEndedForType(BaseTransaction* trans, ModelType type); |
| 309 |
| 310 // Marks the |type| as having its intial sync complete. |
| 311 // This applies only to types with implicitly created root folders. |
| 312 void MarkInitialSyncEndedForType(BaseWriteTransaction* trans, ModelType type); |
| 305 | 313 |
| 306 // (Account) Store birthday is opaque to the client, so we keep it in the | 314 // (Account) Store birthday is opaque to the client, so we keep it in the |
| 307 // format it is in the proto buffer in case we switch to a binary birthday | 315 // format it is in the proto buffer in case we switch to a binary birthday |
| 308 // later. | 316 // later. |
| 309 std::string store_birthday() const; | 317 std::string store_birthday() const; |
| 310 void set_store_birthday(const std::string& store_birthday); | 318 void set_store_birthday(const std::string& store_birthday); |
| 311 | 319 |
| 312 // (Account) Bag of chip is an opaque state used by the server to track the | 320 // (Account) Bag of chip is an opaque state used by the server to track the |
| 313 // client. | 321 // client. |
| 314 std::string bag_of_chips() const; | 322 std::string bag_of_chips() const; |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 // have a ScopedKernelLock. | 621 // have a ScopedKernelLock. |
| 614 void GetMetaHandlesOfType(const ScopedKernelLock& lock, | 622 void GetMetaHandlesOfType(const ScopedKernelLock& lock, |
| 615 BaseTransaction* trans, | 623 BaseTransaction* trans, |
| 616 ModelType type, | 624 ModelType type, |
| 617 std::vector<int64>* result); | 625 std::vector<int64>* result); |
| 618 | 626 |
| 619 // Invoked by DirectoryBackingStore when a catastrophic database error is | 627 // Invoked by DirectoryBackingStore when a catastrophic database error is |
| 620 // detected. | 628 // detected. |
| 621 void OnCatastrophicError(); | 629 void OnCatastrophicError(); |
| 622 | 630 |
| 623 // Returns true if the initial sync for |type| has completed. | |
| 624 bool InitialSyncEndedForType(BaseTransaction* trans, ModelType type); | |
| 625 | |
| 626 // Stops sending events to the delegate and the transaction | 631 // Stops sending events to the delegate and the transaction |
| 627 // observer. | 632 // observer. |
| 628 void Close(); | 633 void Close(); |
| 629 | 634 |
| 630 // Returns true if the directory had encountered an unrecoverable error. | 635 // Returns true if the directory had encountered an unrecoverable error. |
| 631 // Note: Any function in |Directory| that can be called without holding a | 636 // Note: Any function in |Directory| that can be called without holding a |
| 632 // transaction need to check if the Directory already has an unrecoverable | 637 // transaction need to check if the Directory already has an unrecoverable |
| 633 // error on it. | 638 // error on it. |
| 634 bool unrecoverable_error_set(const BaseTransaction* trans) const; | 639 bool unrecoverable_error_set(const BaseTransaction* trans) const; |
| 635 | 640 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 653 | 658 |
| 654 base::WeakPtrFactory<Directory> weak_ptr_factory_; | 659 base::WeakPtrFactory<Directory> weak_ptr_factory_; |
| 655 | 660 |
| 656 DISALLOW_COPY_AND_ASSIGN(Directory); | 661 DISALLOW_COPY_AND_ASSIGN(Directory); |
| 657 }; | 662 }; |
| 658 | 663 |
| 659 } // namespace syncable | 664 } // namespace syncable |
| 660 } // namespace syncer | 665 } // namespace syncer |
| 661 | 666 |
| 662 #endif // SYNC_SYNCABLE_DIRECTORY_H_ | 667 #endif // SYNC_SYNCABLE_DIRECTORY_H_ |
| OLD | NEW |