summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync/engine/syncer.cc
Commit message (Collapse)AuthorAgeFilesLines
* sync: Remove the remaining conflict sets coderlarocque@chromium.org2012-02-211-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflict sets were intended to help us deal with updates that could corrupt the directory tree if applied. This could happen, for example, when the server sends us a new item in a directory that has been deleted locally. Due to a bug, the code to deal with conflict sets was never run. It seems that the consequences of this weren't as bad as one would expect. By this point, it's not worth fixing, since we are a few weeks away from adding code to handle conflict sets entirely on the server side. Over a series of commits, we have removed lots of dead code related to conflict set handling. The only remaining function of conflict sets code was to prevent items that were in both a "conflict set" and a "simple conflict" state from being processed as simple conflicts. If those items had been processed as simple conflicts, there is a small chance we could accidentally apply them, or do other bad things. The code that detects conflict sets is overkill for our current needs, because it was built with the idea that we had to gather information about these conflict sets in order to resolve them. Now that this requirement has been removed, I have been able to greatly simplify the implementation of conflict set detection by moving it to the update application code. Since this was the last remaining purpose of the conflict set processing code, it is now safe to entirely remove the concept of conflict sets. Other changes: - Removed ConflictProgress::EraseNonBlockingConflictingItemById(); the function was never used. - Added some unit tests for the new functionality. BUG=107816 TEST=sync_unit_tests Review URL: http://codereview.chromium.org/9305001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@122894 0039d316-1c4b-4281-b951-d872f2087c98
* Remove single direction conflict set coderlarocque@chromium.org2012-01-271-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code was intended to operate on conflict sets that consist solely of changes from the server. However, we can never detect these kinds of conflict sets because our conflict set detection code assumes that the server never sends us an invalid set of changes; all conflict sets must be cause, at least in part, by local changes. This change also deletes various private and hidden functions that were used only by the single direction conflict set code. This reduced the BuildAndProcessConflictSetsCommand::ExecuteImpl() into a single function call, which I inlined. Also removed in this change is the conflict_sets_built() flag. The single direction conflict set processing code was the only place where its value was "set". It seems that the logic that relied on it in syncer.cc was reversed. We only processed conflicts if !conflict_sets_built(), which is the opposite of what the documentation claims. Fortunately, its value was always false (because there were no single direction conflict sets) so we always processed conflicts. Finally, this CL includes one unrelated change: it removes BuildAndProcessConflictSetsCommand::MergeSetsForNameClash(). That function is not defined anywhere, so I decided to remove its declaration. BUG=107816 TEST= Review URL: http://codereview.chromium.org/9107055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119507 0039d316-1c4b-4281-b951-d872f2087c98
* Fix update_conflicts_resolved() setting wrong varrlarocque@chromium.org2012-01-121-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | The point of this change is to make the function do what it claims to do, while not affecting current syncer behaviour. This bug has been around for almost two years; we may have come to rely on it in some way. I'm not prepared to risk breaking the old functionality at this time. I have removed the if statement in syncer.cc's APPLY_UPDATES_TO_RESOLVE_CONFLICTS step because we would always take the false branch when the bug was in effect. I did not change SyncSession::HasMoreToSync() because the buggy behaviour would set conflict_sets_built() instead of conflicts_resolved(), but this would have had the same effect. We might be relying on the fact that update_conflict_resolved(true) implies HasMoreToSync(), so it's best to not change that now. BUG=109072 TEST= Review URL: http://codereview.chromium.org/9087003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117495 0039d316-1c4b-4281-b951-d872f2087c98
* Detect sync server communication errorsrlarocque@chromium.org2012-01-111-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part 2 of 3 in a series of patches to remove the unnecessary SYNC_CYCLE_CONTINUATION sync cycle that follows every commit. This patch adds infrastructure to report errors involving communication with the sync server back to the SyncSession and SyncScheduler. It modifies SyncerProtoUtil::PostClientToServerMessage to have it return an error code describing why it failed. This function's callers (all of which are SyncerCommands) use the infrastructure added in the first patch of this series to return the error value to SyncShare(). From there, the return values are placed into the session's StatusController object. The method SyncSession::Succeeded() method provides an easy way to determine if the anything went wrong with the current sync session, and its response is based on the stored return values. This change has no effect on the client's behaviour. Although it gives the client access to lots more information, the client does not use it for any decision making. BUG=94670 TEST= Review URL: http://codereview.chromium.org/9158004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117285 0039d316-1c4b-4281-b951-d872f2087c98
* Change definition of "syncing" in AllStatusrlarocque@chromium.org2011-12-211-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This affects some stats displayed in about:sync. Due to a logic error, syncing was defined as 'unsynced_handles > 0 && !throttled'. This seems sort of reasonable, until you notice that the unsynced_handles value is zero at the beginning of the sync cycle and is not updated for successful commits that occur during the sync cycle. And that's just the tip of the iceberg. This change makes it so that 'syncing' is an edge-triggered value. When a sync cycle starts or ends, it will send a SYNC_CYCLE_BEGIN or SYNC_CYCLE_END event to AllStatus, which will update the flag accordingly. This results in a different definition of 'syncing' than the previous system. Whereas the old system tried to infer what the SyncScheduler was doing and remain in the syncing state until it had fully completed its job, this one will report the 'syncing' state only if a call to SyncShare() is currently in progress. One of the implications of this is that it will now toggle in and out of the syncing state when committing more than 25 items, because the loop to commit all unsynced items in batches of 25 currently occurs outside SyncShare. The new system will also bounce in an out of the syncing state as we handle the SYNC_CYCLE_CONTINUATION cycle that follows every cycle that commits an item. How does this look in about:sync? The biggest change is that it will now be almost impossible to see the status summary of "SYNCING". This is because the ProfileSyncService does not receive notification of the beginning of a sync cycle, only the end. So it doesn't bother to update the state of about:sync until the syncing is already completed. Prior to this change, about:sync did show the "SYNCING" summary sometimes, but this was only during the *second* sync cycle, which we enter only because of the SYNC_CYCLE_CONTINUATION bug (issue 94670). Also in this commit are changes to remove the infrastructure used to set the 'syncing' variable in the SyncSessionSnapshot. This had the side-effect of removing the mechanism by which we're guaranteed to kick AllStatus with a STATUS_CHANGED event, so I replaced it with a SYNC_CYCLE_BEGIN event sent from the SYNCER_BEGIN step. I also removed SyncerEndCommand, because the mechanims used to send the SYNC_CYCLE_BEGIN event could be used to send the SYNC_CYCLE_ENDED event, too. BUG=98346 TEST= Review URL: http://codereview.chromium.org/8873058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115386 0039d316-1c4b-4281-b951-d872f2087c98
* Remove code related to counting conflictsrlarocque@chromium.org2011-12-191-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There used to be a bug which caused us to count conflicts incorrectly. We would count each conflict or conflict set once (by adding two to the count), then decrement it by one. The problem is that the increment happened only whent he conflict resolution function was called for the worker to which the conflict belonged, while the decrement would be carried out by each worker. This meant that the conflict never got very high. Fixing issue 97832 brought this code back from the dead. The number of workers involved in a sync cycle was greatly reduced. So the counts actually could exceed 2 and the extra-special, tough conflict resolution code could get triggered. This side-effect was completely unintentional. We've decided that we would like to go back to the old, bug-induced behaviour. This commit removes the buggy counting code and the special case, called only on high count conflict processing functions. This should restore the old behaviour that we've grown attached to. This change also obsoletes issue 46621. The code to be tested by that unit test has been deleted. BUG=107816, 97832, 46621 TEST= Review URL: http://codereview.chromium.org/8976008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115037 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Convert VLOGs to DVLOGsakalin@chromium.org2011-11-291-8/+8
| | | | | | | | | | BUG=101424 TEST= Review URL: http://codereview.chromium.org/8726020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112032 0039d316-1c4b-4281-b951-d872f2087c98
* This is the second and final patch of changes for implementing the per ↵lipalani@chromium.org2011-11-241-0/+1
| | | | | | | | | | | | | | datatype throttling feature. Includes the tests. This consumes the throttled datatypes set in the context and uses that to filter the unsynced handles that we use for committing. BUG=104819 TEST=unit_tests.exe, sync_unit_tests.exe, sync_integration_tests.exe, manual test cases Review URL: http://codereview.chromium.org/8631021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111464 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Made some sync session member functions constakalin@chromium.org2011-11-231-10/+12
| | | | | | | | | | | | | | | | | | | | In particular, split SyncSession::status_controller() into status_controller() and mutable_status_controller(). Also remove some dead code. Propagate const methods throughout sync code. This is in preparation for an upcoming change that makes ModelChangingSyncerCommand post on only the threads it needs to. BUG=97832 TEST= Review URL: http://codereview.chromium.org/8638001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111329 0039d316-1c4b-4281-b951-d872f2087c98
* Event tracing for sync eventsrlarocque@chromium.org2011-11-231-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a "sync" trace event category that traces the following events: - model association time - time spent in each step of the syncer state machine - transactions Also included is a "sync_lock_contention" category that tracks the time spent acquiring the sync lock. This information would normally clutter up the logs, but it is useful information when we suspect lock contention is an issue. To trace model association tracing, I needed to have a set of strings with application lifetime representing each model type. I have changed the return type of ModelTypeToString from std::string to const char* to meet this need. In the interest of avoiding duplicate functionality, this change also removes other mechanisms for tracing transaction time. In particular, some of the log messages around acquiring and releasing transactions have been removed. BUG=104353 TEST=Run with '--trace-startup=sync,sync_lock_contention', open resulting chrometrace.log in about:tracing. Review URL: http://codereview.chromium.org/8573011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111265 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 110555 - sync: Remove ModelNeutralExecuteImpl()rlarocque@chromium.org2011-11-171-4/+2
| | | | | | | | | | | | | | | | | | ProcessUpdatesCommand was the only child of ModelChangingSyncerCommand to override this function. Since it is special, let's just treat it specially in syncer.cc rather than modifying ModelChangingSyncerCommand to suit its needs. BUG=36594 TEST= Review URL: http://codereview.chromium.org/8510079 TBR=rlarocque@chromium.org Review URL: http://codereview.chromium.org/8586042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110572 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove ModelNeutralExecuteImpl()rlarocque@chromium.org2011-11-171-2/+4
| | | | | | | | | | | | | | | ProcessUpdatesCommand was the only child of ModelChangingSyncerCommand to override this function. Since it is special, let's just treat it specially in syncer.cc rather than modifying ModelChangingSyncerCommand to suit its needs. BUG=36594 TEST= Review URL: http://codereview.chromium.org/8510079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110555 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] use base::Time in syncakalin@chromium.org2011-09-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Make EntryKernel/Entry/BaseNode use base::Time instead of int64s. Add sync/util/time.h, with utility functions to manage the sync proto time format. Store times on disk in proto format instead of the local system. This requires a database version bump (to 77). Update SessionChangeProcessor/SessionModelAssociator to use base::Time, too. Remove hackish Now() function. Remove ZeroFields() function, and instead zero-initialize in EntryKernel::EntryKernel() directly. BUG= TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=102184 Review URL: http://codereview.chromium.org/7981006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102218 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 102184 - [Sync] use base::Time in syncakalin@chromium.org2011-09-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make EntryKernel/Entry/BaseNode use base::Time instead of int64s. Add sync/util/time.h, with utility functions to manage the sync proto time format. Store times on disk in proto format instead of the local system. This requires a database version bump (to 77). Update SessionChangeProcessor/SessionModelAssociator to use base::Time, too. Remove hackish Now() function. Remove ZeroFields() function, and instead zero-initialize in EntryKernel::EntryKernel() directly. BUG= TEST= Review URL: http://codereview.chromium.org/7981006 TBR=akalin@chromium.org Review URL: http://codereview.chromium.org/7977034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102186 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] use base::Time in syncakalin@chromium.org2011-09-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Make EntryKernel/Entry/BaseNode use base::Time instead of int64s. Add sync/util/time.h, with utility functions to manage the sync proto time format. Store times on disk in proto format instead of the local system. This requires a database version bump (to 77). Update SessionChangeProcessor/SessionModelAssociator to use base::Time, too. Remove hackish Now() function. Remove ZeroFields() function, and instead zero-initialize in EntryKernel::EntryKernel() directly. BUG= TEST= Review URL: http://codereview.chromium.org/7981006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102184 0039d316-1c4b-4281-b951-d872f2087c98
* Delete Tracked, and move Location to its own file.ajwong@chromium.org2011-09-211-1/+1
| | | | | | | | | | | | | The Birth/Death tracking of tasks has been moved out-of-band into MessageLoop's PendingTask structure. Thus, Task no longer needs to inherit from Tracked. Since Task was the only child of Tracked, delete the Tracked class and move Location to its own file. BUG=none TEST=builds Review URL: http://codereview.chromium.org/7879006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102132 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Remove static initializersakalin@chromium.org2011-09-011-1/+1
| | | | | | | | | | BUG=94991 TEST= Review URL: http://codereview.chromium.org/7822008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99139 0039d316-1c4b-4281-b951-d872f2087c98
* Simulate transient error and verify exponential backoff.lipalani@chromium.org2011-08-121-2/+11
| | | | | | | | | | BUG= TEST= Review URL: http://codereview.chromium.org/7477004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96515 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add client-side plumbing for server control of sessions commit delayakalin@chromium.org2011-08-101-0/+5
| | | | | | | | | | | | Add OVERRIDE to a bunch of overridden functions. BUG=91861 TEST= Review URL: http://codereview.chromium.org/7604019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96243 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add RequestCleanupDisabledTypes() method to SyncManagerakalin@chromium.org2011-07-281-16/+20
| | | | | | | | | | | | | | Use that instead of nudging when a type is disabled. Cleaned up SyncScheduler and SyncManager a bit. BUG=78165 TEST= TBR=tim Review URL: http://codereview.chromium.org/7281017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94530 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add Location parameter to Read/WriteTransactionsakalin@chromium.org2011-06-171-1/+1
| | | | | | | | | | | Also add to SyncChangeProcessor and SyncableService. BUG= TEST= Review URL: http://codereview.chromium.org/7189004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89556 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Split DirectoryChangeListener for thread-safetyakalin@chromium.org2011-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Split DirectoryChangeListener into DirectoryChangeDelegate and TransactionObserver classes. This removes a remove/notify race condition with the DirectoryChange events. Make syncable::{Read,Write}Transaction take Locations instead of file/line pairs. Move construction of sync_manager_ into sync thread. Add logging utils in sync/logging.{h,cc}. Add overloads to ObserverListThreadSafe::Notify for 2, 3, and 4 arguments. Fixed 'Inital' misspelling in SyncBackendHost (finally). BUG=85656 TEST= Review URL: http://codereview.chromium.org/7190001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89413 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Clean up sync loggingakalin@chromium.org2011-06-081-0/+8
| | | | | | | | | | | | | | | | Add GetDebugName() method to Profile. Use it in ProfileSyncServiceHarness, SyncerThread, and LiveSyncExtensionHelper. Change VLOG(1)s in SyncerThread to VLOG(2)s. Turn on logging for the test server if VLOG is enabled for that file, and not just in general. BUG= TEST= Review URL: http://codereview.chromium.org/7024058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88355 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Support for non-blocking conflicts and encryption conflicts.zea@chromium.org2011-05-051-4/+13
| | | | | | | | | | | | | | | | | | | | | | This patch introduces the notion of non-blocking conflicts. These are conflicts that do not result in the syncer getting stuck. They affect the HasConflictingUpdates status call, so we attempt to reapply updates when they occur, but they are not passed to the conflict resolver, and hence do not result in the syncer being stuck. All cases where we have a conflict due to encryption/decryption result in a new ENCRYPTION_CONFLICT, which are treated as nonblocking conflicts. Updated sync's protocol_version to 27 so the server can tell which clients understand encryption. Also, due to this change, it's more likely that local/server changes will be overwritten in the conflict resolver (since encryption conflicts are kept as unapplied while they can't be decrypted). Added counters for how often this happens, which will appear on about:sync, and filed follow up bug crbug.com/76596. BUG=59242 TEST=new session sync_integration tests, modified apply_updates_command unit tests Review URL: http://codereview.chromium.org/6714002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84177 0039d316-1c4b-4281-b951-d872f2087c98
* Remove all TODO(tim):deprcecated and clean up all the remnants of syncer ↵lipalani@chromium.org2011-04-291-18/+1
| | | | | | | | | | | thread2. BUG= TEST= Review URL: http://codereview.chromium.org/6883210 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83485 0039d316-1c4b-4281-b951-d872f2087c98
* sync: hook up ServerConnectionManager <> SyncerThread2 and tie up more loose ↵tim@chromium.org2011-03-291-8/+3
| | | | | | | | | | | | | | | | | | | ends This permits the thread to initiate syncing by waiting for valid network connectivity. Adds a callback to SyncerThread2::Start to learn when config mode has started. Makes ConfigureDataTypes asynchronous to allow waiting for config mode to have started. As a result of this, passing --new-syncer-thread on the command line actually works and doesn't crash (too much!) BUG=26339 TEST=SyncerThread2Test Review URL: http://codereview.chromium.org/6690020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79717 0039d316-1c4b-4281-b951-d872f2087c98
* sync: implement configuration tasks in SyncerThread2tim@chromium.org2011-02-151-3/+8
| | | | | | | | | | | | Required shuffling initial_sync_ended bit-setting from SyncerEnd to ApplyUpdatesCommand. BUG=26339 TEST=SyncerThread2Test Review URL: http://codereview.chromium.org/6473008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75015 0039d316-1c4b-4281-b951-d872f2087c98
* sync: add a SyncSessionJobPurpose for clearing private data.tim@chromium.org2011-02-031-11/+17
| | | | | | | | | | | Removes the nudge source which wasn't used server-side. BUG=71616,26339 TEST=SyncerThread2Test Review URL: http://codereview.chromium.org/6286067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73647 0039d316-1c4b-4281-b951-d872f2087c98
* sync: tiny cleanup in syncer.h/cctim@chromium.org2011-02-011-4/+6
| | | | | | | | | | | Moves last bit of state from syncer to the sync session context, which is where we store state we want to carry over between sessions. BUG=none TEST=syncer_unittest Review URL: http://codereview.chromium.org/6349030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73355 0039d316-1c4b-4281-b951-d872f2087c98
* Recommit attempt for rev 72685.zea@chromium.org2011-01-271-1/+2
| | | | | | | | | | | [SYNC] Refactor SyncSourceInfo and add support in chrome invalidation client and syncer thread for passing a datatype-specific payload originating in the invalidation server and directed at the sync frontend server. Also fixes bug with last_sync_time and PostTimeToTypeHistogram, which would get hit when the unit tests were being run. BUG=68572, 69558 TEST=unit Review URL: http://codereview.chromium.org/6313018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72891 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 72685 - [SYNC] Refactor SyncSourceInfo and add support in chrome ↵zea@chromium.org2011-01-261-2/+1
| | | | | | | | | | | | | invalidation client and syncer thread for passing a datatype-specific payload originating in the invalidation server and directed at the sync frontend server. Also fixes bug with last_sync_time and PostTimeToTypeHistogram, which would get hit when the unit tests were being run. BUG=68572,69558 TEST=unit Review URL: http://codereview.chromium.org/6182004 TBR=zea@chromium.org Review URL: http://codereview.chromium.org/6270006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72687 0039d316-1c4b-4281-b951-d872f2087c98
* [SYNC] Refactor SyncSourceInfo and add support in chrome invalidation client ↵zea@chromium.org2011-01-261-1/+2
| | | | | | | | | | and syncer thread for passing a datatype-specific payload originating in the invalidation server and directed at the sync frontend server. Also fixes bug with last_sync_time and PostTimeToTypeHistogram, which would get hit when the unit tests were being run. BUG=68572,69558 TEST=unit Review URL: http://codereview.chromium.org/6182004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72685 0039d316-1c4b-4281-b951-d872f2087c98
* Remove obsolete base/lock.h and fix up callers to use the new header file andbrettw@chromium.org2011-01-211-2/+2
| | | | | | | | | | | the base namespace. Fix several files including lock.h unnecessarily. BUG=none TEST=none Original review=http://codereview.chromium.org/6142009/ Patch by leviw@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@72106 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove unneeded browser_thread.h usage.thestig@chromium.org2010-12-131-1/+0
| | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/5676004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69037 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Make SyncSession take most of its required state at construction time.tim@chromium.org2010-11-241-27/+14
| | | | | | | | | | | | This is more prep for the MessageLoop based SyncerThread. Somewhat subtle: previously, if HasMoreToSync returned true, we'd grab a fresh copy of routing_info and workers for the next session, but now we hold the data constant, which I think is more sane. BUG=26339, 64136 TEST=sync_unit_tests, sync_integration_tests Review URL: http://codereview.chromium.org/5307001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67334 0039d316-1c4b-4281-b951-d872f2087c98
* Plumb datatype information to syncer from nudges.zea@chromium.org2010-11-111-6/+5
| | | | | | | | | | | | Add plumbing to support tracking which datatypes are triggering nudges. This gets plumbed from the nudges to the actual sync session. Also added some histogramming for the frequency at which particular datatypes trigger syncs (as a result, also supports tracking how often datatypes are changing). New histograms are of the form "Sync.Freq<datatype>", with bucket units in milliseconds. BUG=None TEST=unit_tests Review URL: http://codereview.chromium.org/4659003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65818 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ChromeThread to BrowserThread Part22:tfarina@chromium.org2010-10-121-1/+1
| | | | | | | | | | | | | | | | - Include browser_thread instead of chrome_thread in more 97 files. Now the remaining files that are including chrome_thread.h are: chrome_thread.cc and browser_thread.h. They will be fixed next. BUG=56926 TEST=trybots Review URL: http://codereview.chromium.org/3717004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62312 0039d316-1c4b-4281-b951-d872f2087c98
* sync: use ObserverList instead of EventChannel (deprecated) for syncer events.tim@chromium.org2010-10-111-32/+19
| | | | | | | | | | | | | | | Remove the relay_channel and syncer_event_channel in favor of having listeners live on the SyncSessionContext and be notified directly. Remove some unnecessary event types and variables. BUG=26339 TEST=sync_unit_tests Review URL: http://codereview.chromium.org/3538011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62187 0039d316-1c4b-4281-b951-d872f2087c98
* Implements the backend for clearing data from the servertim@chromium.org2010-09-081-14/+28
| | | | | | | | | | | | BUG=54280 TEST=accessible only via unit test checked in this CL Original patch by raz@chromium.org Original review: http://codereview.chromium.org/3293007 Review URL: http://codereview.chromium.org/3310018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58859 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: A giant cleanup to net/erg@google.com2010-08-311-0/+10
| | | | | | | | | | | | This moves all sorts of code from h files to cc files and reduces header dependencies. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3212008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58020 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Get rid of duplicated typedef Closure definition.tfarina@chromium.org2010-07-161-2/+1
| | | | | | | | | | | | | | | The closure.h file just defines a callback type. But base/callback.h already define a callback with the same type, but with a different name. So just use the callback from base instead. BUG=26443 TEST=trybots Signed-off-by: Thiago Farina <tfarina@chromium.org> Review URL: http://codereview.chromium.org/2966009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52662 0039d316-1c4b-4281-b951-d872f2087c98
* sync: add CleanupDisabledTypesCommand to purge data pertaining to previouslytim@chromium.org2010-07-021-0/+8
| | | | | | | | | | | | | synced data types that the user has disabled. Despite my attempt at simplifying the purge code in Directory[BackingStore], I had to go back to my first attempt with DeleteEntries (which was previously reviewed separately), with a few extra gotchas in Directory::PurgeEntriesWithTypeIn. BUG=40252 TEST=CleanupDisabledTypesCommandTest, SyncableDirectoryTest, DirectoryBackingStoreTest Review URL: http://codereview.chromium.org/2865022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51491 0039d316-1c4b-4281-b951-d872f2087c98
* Replace changes_channel with an observer list.zork@chromium.org2010-06-111-4/+9
| | | | | | | | | BUG=none TEST=Run unit tests Review URL: http://codereview.chromium.org/2075012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49490 0039d316-1c4b-4281-b951-d872f2087c98
* Make last_download_timestamp and initial_sync_ended per-datatype.nick@chromium.org2010-04-011-2/+1
| | | | | | | | | | | | | | | | | Persist them on a per-datatype basis. Add a migration from the old database scheme. In DownloadUpdates, pick the datatype(s) with the lowest last_download_timestamp; and fetch those. Keep running DownloadUpdatesCommand until we've gotten a "no-timestamp" result when requesting all datatypes. BUG=33065,37359,37331,37369,37373 TEST=included unit tests. Also, ran with Bookmark sync enabled, then added autofill the next time I started up, and observed that the incremental GetUpdates happened for autofill only, and that eventually the timestamps for bookmarks and autofill coalesced. Review URL: http://codereview.chromium.org/1521005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43397 0039d316-1c4b-4281-b951-d872f2087c98
* Make it clear what last_sync_timestamp actually tracks. Updatenick@chromium.org2010-03-241-1/+11
| | | | | | | | | | | | | | | | last_sync_timestamp from the new_timestamp only, never from per-entry timestamps. Use what the server sends us to know whether or not there are more updates to fetch. Eliminate some unnecessarily complicated logic having to do with the # of updates returned -- that's always a red herring; with server-side filtering, it is indeed possible for 0 updates to be returned along with a new timestamp. BUG=37373 TEST=manual testing of 2 browser sync; unit tests. Review URL: http://codereview.chromium.org/1161006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42413 0039d316-1c4b-4281-b951-d872f2087c98
* svn prop fixes. Applied to all files not in third_party.pkasting@chromium.org2010-03-091-0/+0
| | | | | | | | | | | | * Removed eol-style, executable and mergeinfo from BMP/GIF/ICO/JPEG files, and set correct mime-type. * Removed executable and mergeinfo from .c/.cc/.cpp/.h/.m/.mm and .gyp files, and set eol-style to LF. TBR=evanm BUG=none TEST=none git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40991 0039d316-1c4b-4281-b951-d872f2087c98
* Move a debug string util to syncer proto util. Add better getupdates logging ↵chron@google.com2010-03-021-17/+0
| | | | | | | | in debug builds. Review URL: http://codereview.chromium.org/660346 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40436 0039d316-1c4b-4281-b951-d872f2087c98
* Multi-pass ModelChangingSyncerCommands.tim@chromium.org2010-02-251-7/+7
| | | | | | | | BUG=31911 Review URL: http://codereview.chromium.org/638001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39957 0039d316-1c4b-4281-b951-d872f2087c98
* For sync, make ProcessCommitResponseCommand handle commit entries one ↵tim@chromium.org2010-02-161-1/+1
| | | | | | | | | | | | | | | ModelSafeGroup at a time. Enforce ModelSafeGroup restrictions in the StatusController by DCHECKing if out-of-bounds. Move OrderedCommitSet to its own file. Removed some unused error counters and ResetTransientState calls that were useless. BUG=31911 TEST=ProcessCommitResponseTest, OrderedCommitSetTest Review URL: http://codereview.chromium.org/604045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39139 0039d316-1c4b-4281-b951-d872f2087c98
* In the sync database, use protobuf-based storage. Drop the oldnick@chromium.org2010-01-271-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | bookmark-only columns. Add getters and setters for BookmarkSpecifics to syncapi as well as syncable entries. Make the datatype be a required property when creating a syncapi node. Add a datatype for the 'google chrome' top level folder. Add database migrations from version 67 to the new schema. Add infrastructure to support migrations generically. Add unit tests for the migrations. Pull a new version of the protobuf library to pick up a fix for a bug that this change exposed (I upstreamed the fix). Fix some example code in the sql helpers so that it would actually compile. BUG=29899,30041 TEST=New unit tests for migrations: unit tests are based on actual database dumps. Additionally, I manually tested 2-client sync using combos of old-protocol servers, new-protocol servers, and initial database versions v67, v68, and v0 (new client). I manually verified that add/edit/delete works in these combination cases. Afterwards I verified (by inspecting the sync databases) that the ModelTypes are consistent across the various migration/protocol paths. Review URL: http://codereview.chromium.org/554066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37253 0039d316-1c4b-4281-b951-d872f2087c98