| 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 COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ |
| 6 #define COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ | 6 #define COMPONENTS_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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 // sync session. |types_to_journal| must be a subset of |disabled_types|. | 457 // sync session. |types_to_journal| must be a subset of |disabled_types|. |
| 458 // 2. Data associated with |types_to_unapply| is reset to an "unapplied" | 458 // 2. Data associated with |types_to_unapply| is reset to an "unapplied" |
| 459 // state, wherein all local data is deleted and IS_UNAPPLIED is set to true. | 459 // state, wherein all local data is deleted and IS_UNAPPLIED is set to true. |
| 460 // This is useful when there's no benefit in discarding the currently | 460 // This is useful when there's no benefit in discarding the currently |
| 461 // downloaded state, such as when there are cryptographer errors. | 461 // downloaded state, such as when there are cryptographer errors. |
| 462 // |types_to_unapply| must be a subset of |disabled_types|. | 462 // |types_to_unapply| must be a subset of |disabled_types|. |
| 463 // 3. All other data is purged entirely. | 463 // 3. All other data is purged entirely. |
| 464 // Note: "Purge" is just meant to distinguish from "deleting" entries, which | 464 // Note: "Purge" is just meant to distinguish from "deleting" entries, which |
| 465 // means something different in the syncable namespace. | 465 // means something different in the syncable namespace. |
| 466 // WARNING! This can be real slow, as it iterates over all entries. | 466 // WARNING! This can be real slow, as it iterates over all entries. |
| 467 // WARNING! Performs synchronous I/O. | 467 void PurgeEntriesWithTypeIn(ModelTypeSet disabled_types, |
| 468 // Returns: true on success, false if an error was encountered. | 468 ModelTypeSet types_to_journal, |
| 469 virtual bool PurgeEntriesWithTypeIn(ModelTypeSet disabled_types, | 469 ModelTypeSet types_to_unapply); |
| 470 ModelTypeSet types_to_journal, | |
| 471 ModelTypeSet types_to_unapply); | |
| 472 | 470 |
| 473 // Resets the base_versions and server_versions of all synced entities | 471 // Resets the base_versions and server_versions of all synced entities |
| 474 // associated with |type| to 1. | 472 // associated with |type| to 1. |
| 475 // WARNING! This can be slow, as it iterates over all entries for a type. | 473 // WARNING! This can be slow, as it iterates over all entries for a type. |
| 476 bool ResetVersionsForType(BaseWriteTransaction* trans, ModelType type); | 474 bool ResetVersionsForType(BaseWriteTransaction* trans, ModelType type); |
| 477 | 475 |
| 478 // Returns true iff the attachment identified by |attachment_id_proto| is | 476 // Returns true iff the attachment identified by |attachment_id_proto| is |
| 479 // linked to an entry. | 477 // linked to an entry. |
| 480 // | 478 // |
| 481 // An attachment linked to a deleted entry is still considered linked if the | 479 // An attachment linked to a deleted entry is still considered linked if the |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 | 661 |
| 664 base::WeakPtrFactory<Directory> weak_ptr_factory_; | 662 base::WeakPtrFactory<Directory> weak_ptr_factory_; |
| 665 | 663 |
| 666 DISALLOW_COPY_AND_ASSIGN(Directory); | 664 DISALLOW_COPY_AND_ASSIGN(Directory); |
| 667 }; | 665 }; |
| 668 | 666 |
| 669 } // namespace syncable | 667 } // namespace syncable |
| 670 } // namespace syncer | 668 } // namespace syncer |
| 671 | 669 |
| 672 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ | 670 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_H_ |
| OLD | NEW |