| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // should not be invoked outside of tests. | 414 // should not be invoked outside of tests. |
| 415 bool FullyCheckTreeInvariants(BaseTransaction *trans); | 415 bool FullyCheckTreeInvariants(BaseTransaction *trans); |
| 416 | 416 |
| 417 // Purges all data associated with any entries whose ModelType or | 417 // Purges all data associated with any entries whose ModelType or |
| 418 // ServerModelType is found in |types|, from _both_ memory and disk. | 418 // ServerModelType is found in |types|, from _both_ memory and disk. |
| 419 // Only valid, "real" model types are allowed in |types| (see model_type.h | 419 // Only valid, "real" model types are allowed in |types| (see model_type.h |
| 420 // for definitions). "Purge" is just meant to distinguish from "deleting" | 420 // for definitions). "Purge" is just meant to distinguish from "deleting" |
| 421 // entries, which means something different in the syncable namespace. | 421 // entries, which means something different in the syncable namespace. |
| 422 // WARNING! This can be real slow, as it iterates over all entries. | 422 // WARNING! This can be real slow, as it iterates over all entries. |
| 423 // WARNING! Performs synchronous I/O. | 423 // WARNING! Performs synchronous I/O. |
| 424 // Returns: true on success, false if an error was encountered. | 424 virtual void PurgeEntriesWithTypeIn(ModelTypeSet types); |
| 425 virtual bool PurgeEntriesWithTypeIn(ModelTypeSet types); | |
| 426 | 425 |
| 427 private: | 426 private: |
| 428 // A helper that implements the logic of checking tree invariants. | 427 // A helper that implements the logic of checking tree invariants. |
| 429 bool CheckTreeInvariants(syncable::BaseTransaction* trans, | 428 bool CheckTreeInvariants(syncable::BaseTransaction* trans, |
| 430 const MetahandleSet& handles); | 429 const MetahandleSet& handles); |
| 431 | 430 |
| 432 // Helper to prime ids_index, parent_id_and_names_index, unsynced_metahandles | 431 // Helper to prime ids_index, parent_id_and_names_index, unsynced_metahandles |
| 433 // and unapplied_metahandles from metahandles_index. | 432 // and unapplied_metahandles from metahandles_index. |
| 434 void InitializeIndices(); | 433 void InitializeIndices(); |
| 435 | 434 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 report_unrecoverable_error_function_; | 605 report_unrecoverable_error_function_; |
| 607 bool unrecoverable_error_set_; | 606 bool unrecoverable_error_set_; |
| 608 | 607 |
| 609 InvariantCheckLevel invariant_check_level_; | 608 InvariantCheckLevel invariant_check_level_; |
| 610 }; | 609 }; |
| 611 | 610 |
| 612 } // namespace syncable | 611 } // namespace syncable |
| 613 } // namespace syncer | 612 } // namespace syncer |
| 614 | 613 |
| 615 #endif // SYNC_SYNCABLE_DIRECTORY_H_ | 614 #endif // SYNC_SYNCABLE_DIRECTORY_H_ |
| OLD | NEW |