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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 Metahandles* result); | 416 Metahandles* result); |
417 | 417 |
418 // Get metahandle counts for various criteria to show on the | 418 // Get metahandle counts for various criteria to show on the |
419 // about:sync page. The information is computed on the fly | 419 // about:sync page. The information is computed on the fly |
420 // each time. If this results in a significant performance hit, | 420 // each time. If this results in a significant performance hit, |
421 // additional data structures can be added to cache results. | 421 // additional data structures can be added to cache results. |
422 void CollectMetaHandleCounts(std::vector<int>* num_entries_by_type, | 422 void CollectMetaHandleCounts(std::vector<int>* num_entries_by_type, |
423 std::vector<int>* num_to_delete_entries_by_type); | 423 std::vector<int>* num_to_delete_entries_by_type); |
424 | 424 |
425 // Returns a ListValue serialization of all nodes for the given type. | 425 // Returns a ListValue serialization of all nodes for the given type. |
426 scoped_ptr<base::ListValue> GetNodeDetailsForType( | 426 std::unique_ptr<base::ListValue> GetNodeDetailsForType(BaseTransaction* trans, |
427 BaseTransaction* trans, | 427 ModelType type); |
428 ModelType type); | |
429 | 428 |
430 // Sets the level of invariant checking performed after transactions. | 429 // Sets the level of invariant checking performed after transactions. |
431 void SetInvariantCheckLevel(InvariantCheckLevel check_level); | 430 void SetInvariantCheckLevel(InvariantCheckLevel check_level); |
432 | 431 |
433 // Checks tree metadata consistency following a transaction. It is intended | 432 // Checks tree metadata consistency following a transaction. It is intended |
434 // to provide a reasonable tradeoff between performance and comprehensiveness | 433 // to provide a reasonable tradeoff between performance and comprehensiveness |
435 // and may be used in release code. | 434 // and may be used in release code. |
436 bool CheckInvariantsOnTransactionClose( | 435 bool CheckInvariantsOnTransactionClose( |
437 syncable::BaseTransaction* trans, | 436 syncable::BaseTransaction* trans, |
438 const MetahandleSet& modified_handles); | 437 const MetahandleSet& modified_handles); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 void Close(); | 628 void Close(); |
630 | 629 |
631 // Returns true if the directory had encountered an unrecoverable error. | 630 // Returns true if the directory had encountered an unrecoverable error. |
632 // Note: Any function in |Directory| that can be called without holding a | 631 // Note: Any function in |Directory| that can be called without holding a |
633 // transaction need to check if the Directory already has an unrecoverable | 632 // transaction need to check if the Directory already has an unrecoverable |
634 // error on it. | 633 // error on it. |
635 bool unrecoverable_error_set(const BaseTransaction* trans) const; | 634 bool unrecoverable_error_set(const BaseTransaction* trans) const; |
636 | 635 |
637 Kernel* kernel_; | 636 Kernel* kernel_; |
638 | 637 |
639 scoped_ptr<DirectoryBackingStore> store_; | 638 std::unique_ptr<DirectoryBackingStore> store_; |
640 | 639 |
641 const WeakHandle<UnrecoverableErrorHandler> unrecoverable_error_handler_; | 640 const WeakHandle<UnrecoverableErrorHandler> unrecoverable_error_handler_; |
642 base::Closure report_unrecoverable_error_function_; | 641 base::Closure report_unrecoverable_error_function_; |
643 bool unrecoverable_error_set_; | 642 bool unrecoverable_error_set_; |
644 | 643 |
645 // Not owned. | 644 // Not owned. |
646 NigoriHandler* const nigori_handler_; | 645 NigoriHandler* const nigori_handler_; |
647 Cryptographer* const cryptographer_; | 646 Cryptographer* const cryptographer_; |
648 | 647 |
649 InvariantCheckLevel invariant_check_level_; | 648 InvariantCheckLevel invariant_check_level_; |
650 | 649 |
651 // Maintain deleted entries not in |kernel_| until it's verified that they | 650 // Maintain deleted entries not in |kernel_| until it's verified that they |
652 // are deleted in native models as well. | 651 // are deleted in native models as well. |
653 scoped_ptr<DeleteJournal> delete_journal_; | 652 std::unique_ptr<DeleteJournal> delete_journal_; |
654 | 653 |
655 base::WeakPtrFactory<Directory> weak_ptr_factory_; | 654 base::WeakPtrFactory<Directory> weak_ptr_factory_; |
656 | 655 |
657 DISALLOW_COPY_AND_ASSIGN(Directory); | 656 DISALLOW_COPY_AND_ASSIGN(Directory); |
658 }; | 657 }; |
659 | 658 |
660 } // namespace syncable | 659 } // namespace syncable |
661 } // namespace syncer | 660 } // namespace syncer |
662 | 661 |
663 #endif // SYNC_SYNCABLE_DIRECTORY_H_ | 662 #endif // SYNC_SYNCABLE_DIRECTORY_H_ |
OLD | NEW |