summaryrefslogtreecommitdiffstats
path: root/sync/syncable/directory.h
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-12 23:53:19 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-12 23:53:19 +0000
commit47151c66e3160c66afdd837c7ff45df35db03658 (patch)
tree229a14bb5406f335fcd60496027bb2ec4f997d31 /sync/syncable/directory.h
parent534bc2478349834e475c5c18d44c84ffc3f76c27 (diff)
downloadchromium_src-47151c66e3160c66afdd837c7ff45df35db03658.zip
chromium_src-47151c66e3160c66afdd837c7ff45df35db03658.tar.gz
chromium_src-47151c66e3160c66afdd837c7ff45df35db03658.tar.bz2
Remove initial_sync_ended bits
As of crbug.com/164288, we can no longer trust initial_sync_ended. If my diagnosis is correct, then there are some clients out there who have their initial_sync_ended bits set for some data types which have not actually been synced. Those clients now crash at every startup. This change attempts to solve the problem by removing the separate initial_sync_ended array of bools and checking the database directly to learn of a type's status. The new definition of initial_sync_ended is that a type has finished initial sync if its top level folder has been downloaded and applied. To prevent crashing if the server decides to not send us those root nodes during the control types configure step, we now check that all control types are initial_sync_ended following that configure and fail gracefully if their initial sync is not completed. The new definition of initial_sync_ended makes it much easier to hit crbug.com/164914. That bug would prevent us from saving our changes following a call to PurgeEntriesWithTypeIn() in some situations. This commit also fixes that bug. Since the initial sync ended status is no longer independent from the database state, it is no longer necessary to collect debug info as to its status. It has been removed from the about:sync UI and other debug info reporting mechanisms. Its role in unit tests has also been greatly reduced. BUG=164288,164914 Review URL: https://chromiumcodereview.appspot.com/11474036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172707 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/syncable/directory.h')
-rw-r--r--sync/syncable/directory.h9
1 files changed, 3 insertions, 6 deletions
diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h
index 2b0bd3c4..0eb0ae7 100644
--- a/sync/syncable/directory.h
+++ b/sync/syncable/directory.h
@@ -169,8 +169,6 @@ class SYNC_EXPORT Directory {
// TODO(hatiaol): implement detection and fixing of out-of-sync models.
// Bug 154858.
int64 transaction_version[MODEL_TYPE_COUNT];
- // true iff we ever reached the end of the changelog.
- ModelTypeSet initial_sync_ended;
// The store birthday we were given by the server. Contents are opaque to
// the client.
std::string store_birthday;
@@ -265,9 +263,9 @@ class SYNC_EXPORT Directory {
int64 GetTransactionVersion(ModelType type) const;
void IncrementTransactionVersion(ModelType type);
- ModelTypeSet initial_sync_ended_types() const;
- bool initial_sync_ended_for_type(ModelType type) const;
- void set_initial_sync_ended_for_type(ModelType type, bool value);
+ ModelTypeSet InitialSyncEndedTypes();
+ bool InitialSyncEndedForType(ModelType type);
+ bool InitialSyncEndedForType(BaseTransaction* trans, ModelType type);
const std::string& name() const { return kernel_->name; }
@@ -491,7 +489,6 @@ class SYNC_EXPORT Directory {
// Internal setters that do not acquire a lock internally. These are unsafe
// on their own; caller must guarantee exclusive access manually by holding
// a ScopedKernelLock.
- void set_initial_sync_ended_for_type_unsafe(ModelType type, bool x);
void SetNotificationStateUnsafe(const std::string& notification_state);
Directory& operator = (const Directory&);