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