Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2237)

Unified Diff: chrome/browser/sync/syncable/syncable.h

Issue 2865022: sync: add CleanupDisabledTypesCommand to purge data pertaining to previously... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/syncable/directory_manager.h ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/syncable/syncable.h
===================================================================
--- chrome/browser/sync/syncable/syncable.h (revision 51231)
+++ chrome/browser/sync/syncable/syncable.h (working copy)
@@ -570,7 +570,13 @@
// the write. This is defined up here since DirectoryChangeEvent also contains
// one.
enum WriterTag {
- INVALID, SYNCER, AUTHWATCHER, UNITTEST, VACUUM_AFTER_SAVE, SYNCAPI
+ INVALID,
+ SYNCER,
+ AUTHWATCHER,
+ UNITTEST,
+ VACUUM_AFTER_SAVE,
+ PURGE_ENTRIES,
+ SYNCAPI
};
// A separate Event type and channel for very frequent changes, caused
@@ -644,6 +650,8 @@
FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest,
TakeSnapshotGetsOnlyDirtyHandlesTest);
FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest, TestPurgeEntriesWithTypeIn);
+ FRIEND_TEST_ALL_PREFIXES(SyncableDirectoryTest,
+ TakeSnapshotGetsMetahandlesToPurge);
public:
class EventListenerHookup;
@@ -692,6 +700,7 @@
KernelShareInfoStatus kernel_info_status;
PersistedKernelInfo kernel_info;
OriginalEntries dirty_metas;
+ MetahandleSet metahandles_to_purge;
SaveChangesSnapshot() : kernel_info_status(KERNEL_SHARE_INFO_INVALID) {
}
};
@@ -773,6 +782,9 @@
// The semantic checking is implemented higher up.
void Undelete(EntryKernel* const entry);
void Delete(EntryKernel* const entry);
+ void UnlinkEntryFromOrder(EntryKernel* entry,
+ WriteTransaction* trans,
+ ScopedKernelLock* lock);
// Overridden by tests.
virtual DirectoryBackingStore* CreateBackingStore(
@@ -862,7 +874,7 @@
// entries, which means something different in the syncable namespace.
// WARNING! This can be real slow, as it iterates over all entries.
// WARNING! Performs synchronous I/O.
- void PurgeEntriesWithTypeIn(const std::set<ModelType>& types);
+ virtual void PurgeEntriesWithTypeIn(const std::set<ModelType>& types);
private:
// Helper to prime ids_index, parent_id_and_names_index, unsynced_metahandles
@@ -926,6 +938,10 @@
typedef std::set<EntryKernel*,
LessField<StringField, UNIQUE_CLIENT_TAG> > ClientTagIndex;
+ protected:
+ // Used by tests.
+ void init_kernel(const std::string& name);
+
private:
struct Kernel {
@@ -970,6 +986,10 @@
// necessarily). Dirtyness is confirmed in TakeSnapshotForSaveChanges().
MetahandleSet* const dirty_metahandles;
+ // When a purge takes place, we remove items from all our indices and stash
+ // them in here so that SaveChanges can persist their permanent deletion.
+ MetahandleSet* const metahandles_to_purge;
+
// TODO(ncarter): Figure out what the hell this is, and comment it.
Channel* const channel;
« no previous file with comments | « chrome/browser/sync/syncable/directory_manager.h ('k') | chrome/browser/sync/syncable/syncable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698