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 virtual void PurgeEntriesWithTypeIn(ModelTypeSet types); | 424 // Returns: true on success, false if an error was encountered. |
| 425 virtual bool PurgeEntriesWithTypeIn(ModelTypeSet types); |
425 | 426 |
426 private: | 427 private: |
427 // A helper that implements the logic of checking tree invariants. | 428 // A helper that implements the logic of checking tree invariants. |
428 bool CheckTreeInvariants(syncable::BaseTransaction* trans, | 429 bool CheckTreeInvariants(syncable::BaseTransaction* trans, |
429 const MetahandleSet& handles); | 430 const MetahandleSet& handles); |
430 | 431 |
431 // Helper to prime ids_index, parent_id_and_names_index, unsynced_metahandles | 432 // Helper to prime ids_index, parent_id_and_names_index, unsynced_metahandles |
432 // and unapplied_metahandles from metahandles_index. | 433 // and unapplied_metahandles from metahandles_index. |
433 void InitializeIndices(); | 434 void InitializeIndices(); |
434 | 435 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 report_unrecoverable_error_function_; | 606 report_unrecoverable_error_function_; |
606 bool unrecoverable_error_set_; | 607 bool unrecoverable_error_set_; |
607 | 608 |
608 InvariantCheckLevel invariant_check_level_; | 609 InvariantCheckLevel invariant_check_level_; |
609 }; | 610 }; |
610 | 611 |
611 } // namespace syncable | 612 } // namespace syncable |
612 } // namespace syncer | 613 } // namespace syncer |
613 | 614 |
614 #endif // SYNC_SYNCABLE_DIRECTORY_H_ | 615 #endif // SYNC_SYNCABLE_DIRECTORY_H_ |
OLD | NEW |