summaryrefslogtreecommitdiffstats
path: root/sync
Commit message (Collapse)AuthorAgeFilesLines
* Remove hard_dependency=1 from cacheinvalidation targetakalin@chromium.org2012-06-181-5/+4
| | | | | | | | | | | | | | | | | Since cacheinvalidation headers avoid including proto headers, we can do this. Add explicit dependencies on cacheinvalidation_proto_cpp from the targets that still depend on it. (See http://code.google.com/p/gyp/issues/detail?id=215 for reference.) BUG=79848 TEST= Review URL: https://chromiumcodereview.appspot.com/10577003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142843 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142517 - [Sync] Refactor sync configuration logic.zea@chromium.org2012-06-189-504/+228
| | | | | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10583002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142814 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Propagate XMPP auth errors to SyncNotifierObserversakalin@chromium.org2012-06-1825-132/+466
| | | | | | | | | | | | | | | | | | | | | | | | Detect XMPP auth errors and add new notifications to SingleLoginAttempt and Login. Replace PushClientObserver::OnNotificationStateChange with OnNotifications{Enabled,Disabled} notifications. Change SyncNotifierObserver similarly. Handle InvalidationClient errors and propagate auth errors from that, too. Propagate XMPP auth errors all the way up to SyncManager. It will be handled in a future CL. BUG=38091 TEST= Review URL: https://chromiumcodereview.appspot.com/10545170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142806 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142794 - Revert 142517 - [Sync] Refactor sync configuration logic.kkania@chromium.org2012-06-188-213/+481
| | | | | | | | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10536194 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10581005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142798 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142517 - [Sync] Refactor sync configuration logic.zea@chromium.org2012-06-188-481/+213
| | | | | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10536194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142794 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142563 - Handle sync database corruption with re-downloadzea@chromium.org2012-06-182-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent change allowed us to handle a missing sync database by creating a new directory and repopulating it by requesting an initial sync from the server. This commit builds on that work by intentionally deleting the sync database if it is found to be corrupt or unusable. The client will then recognize that the database is empty and repopulate it, just as it would had the directory not existed in the first place. BUG=109668 TEST=Manual. Three cases, see below: - Delete 'Sync Data/SyncData.sqlite3' from the profile directory. Start chromium and observe that all data is redownloaded from the server. - Corrupt an existing sync directory. The SQL command 'DELETE FROM metas WHERE metahandle = 1' should be sufficient. Start chromium and observe that the directory is deleted then recreated and all data is redownloaded from the server. - Ensure that no directory can be created. You could do this by marking the 'Sync Data' folder as read-only. Start chrome, and observe that sync is unusable, but the browser still works. NOTE: This only works in release builds, debug builds will DCHECK. It's debatable whether or not this scenario is worth testing. Review URL: https://chromiumcodereview.appspot.com/10554016 TBR=rlarocque@chromium.org Review URL: https://chromiumcodereview.appspot.com/10578003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142793 0039d316-1c4b-4281-b951-d872f2087c98
* sync: move internal_api components used by chrome/browser into ↵tim@chromium.org2012-06-1769-160/+171
| | | | | | | | | | | | | | internal_api/public TBR=jhawkins@chromium.org BUG=131130 TEST= Review URL: https://chromiumcodereview.appspot.com/10534080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142626 0039d316-1c4b-4281-b951-d872f2087c98
* Handle sync database corruption with re-downloadrlarocque@chromium.org2012-06-162-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent change allowed us to handle a missing sync database by creating a new directory and repopulating it by requesting an initial sync from the server. This commit builds on that work by intentionally deleting the sync database if it is found to be corrupt or unusable. The client will then recognize that the database is empty and repopulate it, just as it would had the directory not existed in the first place. BUG=109668 TEST=Manual. Three cases, see below: - Delete 'Sync Data/SyncData.sqlite3' from the profile directory. Start chromium and observe that all data is redownloaded from the server. - Corrupt an existing sync directory. The SQL command 'DELETE FROM metas WHERE metahandle = 1' should be sufficient. Start chromium and observe that the directory is deleted then recreated and all data is redownloaded from the server. - Ensure that no directory can be created. You could do this by marking the 'Sync Data' folder as read-only. Start chrome, and observe that sync is unusable, but the browser still works. NOTE: This only works in release builds, debug builds will DCHECK. It's debatable whether or not this scenario is worth testing. Review URL: https://chromiumcodereview.appspot.com/10554016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142563 0039d316-1c4b-4281-b951-d872f2087c98
* Replace GetIOMessageLoopProxy() with GetNetworkTaskRunner() in ↵sergeyu@chromium.org2012-06-162-37/+39
| | | | | | | | | | | | UrlRequestContextGetter. Also updated all code that depends on that methods. TBR=mnissler@chromium.org Review URL: https://chromiumcodereview.appspot.com/10539148 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142560 0039d316-1c4b-4281-b951-d872f2087c98
* Protect against sync entries left by old clientsrlarocque@chromium.org2012-06-163-4/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old clients would sometimes end up with items that were deleted before their existence was ever reported to the server. For a while, we let these entries accumulate in the database, and just filtered them out of the list of items to commit when we created that list in GetCommitIds. Then we learned that a subset of these entries could be deleted in such a manner that they would be detected as database corruption. The client was udpated so it would delete these entries in a timely manner. The filter in GetCommitIds was removed. See crbug.com/125381 for details. It turns out that a lot of clients have some deleted local items in their sync database created by older clients. When they update to the new client which doesn't have the GetCommitIds filter, they will try to commit the local tombstones. This is bad. This commit addresses the problem in two ways: 1. Drop any server-unknown deleted items when we open the database. 2. As a fallback, put the filter back into GetCommitIds. The filter should not be required, so it will trigger a NOTREACHED() if it is executed. BUG=132905,125381 TEST=SyncableDirectoryTest.OldClientLeftUnsyncedDeletedLocalItem Review URL: https://chromiumcodereview.appspot.com/10559018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142555 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Refactor sync configuration logic.zea@chromium.org2012-06-159-228/+504
| | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142517 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Refactor per-datatype throttlingrlarocque@chromium.org2012-06-1324-291/+450
| | | | | | | | | | | | | | | | | | | | | | | | | | | This CL pulls the code to track throttled data types out of the sync session context and into a class meant for that purpose. This new class, ThrottledDataTypeTracker, also implements code to notify the AllStatus object whenever the set of throttled datatypes is changed. The fact that ThrottledDataTypeTracker, which lives in sync/engine, references AllStatus caused some problems with DEPS checks. After a few iterations during code review, this commit now includes the following additional changes: - Move all_status.{cc,h} from sync/internal_api to sync/engine. - Move the SyncManager::Status inner class out of SyncManager and into sync/internal_api/public/engine/sync_status.{cc,h}. The class has been renamed to SyncStatus. This CL does not include code to expose the throttled status on the chrome://sync page, though it does contain functionality we will use to implement it in a future commit. BUG=125065 TEST= Review URL: https://chromiumcodereview.appspot.com/10454105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141992 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Remove unnecessary posting of methods in sync scheduler.zea@chromium.org2012-06-114-217/+127
| | | | | | | | | | | | | Configuration, Clear User Data, Cleanup Disabled Types, and StartMode are all now synchronous methods. Nudge and Stop are the only methods that do posting. BUG=129665, 103327 TEST=unit_tests Review URL: https://chromiumcodereview.appspot.com/10542044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141541 0039d316-1c4b-4281-b951-d872f2087c98
* RefCounted types should not have public destructors - sync and jinglersleevi@chromium.org2012-06-1117-64/+61
| | | | | | | | | | | | | | | | | | In the process of ensuring no base classes for RefCounted classes have public destructors, base::NonThreadSafe shows up frequently due to having a public destructor. Begin migrating all the code that has a base::NonThreadSafe member to directly inheriting from base::NonThreadSafe, so that base::NonThreadSafe's destructor can be made private. BUG=123295 TEST=existing Review URL: https://chromiumcodereview.appspot.com/10411046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141530 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor following sync commit loop changerlarocque@chromium.org2012-06-0816-141/+96
| | | | | | | | | | | | | | | | | | | | | | | This change includes some cleanups of the code introduced in r139519. They have been kept separate from that CL in the hopes of making both CLs easiser to read. This commit moves some error-detection functionality from ProcessCommitResponse's ModelNeutralExecuteImpl() into BuildAndPostCommits(). This simplifies some of the error handling and allows us to remove ModelChangingSyncerCommand's ModelNeutralExecuteImpl(). This CL also combines both commit error indicators into a single variable. BUG=91696,36594 TEST= Review URL: https://chromiumcodereview.appspot.com/10523003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141321 0039d316-1c4b-4281-b951-d872f2087c98
* sync: create internal_api/public to house sync/ files needed by ↵tim@chromium.org2012-06-07123-240/+244
| | | | | | | | | | | | | | | | | chrome/browser/sync. Note on sync.gyp changes and .cc file moves: most files in /public have .h and their .cc side by side, as they are simple implementations. In some cases like model_type.cc (and others in a follow up patch, like sync_manager.cc) have only their header exposed in /public while the impl stays behind, because it needs to include things from within sync/, and /public has a strict include DEPS policy. This is in accordance with other /public folders (like content/). Cleans up DEPS files in sync + c/b/sync. Adds sync/{engine, sessions, syncable} to public/. There is more to come (moving things in internal_api/ into public). Not touching /notifier as that is in flux at the moment. BUG=131130 TEST= Review URL: https://chromiumcodereview.appspot.com/10532019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141038 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Fix sync scheduler/session logic determining successful commands.zea@chromium.org2012-06-066-29/+92
| | | | | | | | | | | | | | We now have Succeeded(), which is true iff the command ran successfully, and SuccessfullyReachedServer(), which is true iff we actually contacted the server without errors. BUG=131414 TEST=unit_tests Review URL: https://chromiumcodereview.appspot.com/10537032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140885 0039d316-1c4b-4281-b951-d872f2087c98
* sync: split SyncSessionSnapshot, SyncerStatus, ErrorCounters, and ↵tim@chromium.org2012-06-0620-368/+522
| | | | | | | | | | | | | | SyncSourceInfo out of session_state. This is in preparation for moving the snapshot et al to internal_api/public. BUG=131130 TEST=none Review URL: https://chromiumcodereview.appspot.com/10545010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140687 0039d316-1c4b-4281-b951-d872f2087c98
* Add chrome://sync counter for total commitsrlarocque@chromium.org2012-06-043-1/+6
| | | | | | | | | | | | | This is a strictly increasing counter that tracks the total number of successful commits during the life of this sync instance. BUG=128409 TEST=Open chrome://sync, observe "Successful Commits" counter. Review URL: https://chromiumcodereview.appspot.com/10441117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140338 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak introduced in r140122rlarocque@chromium.org2012-06-022-16/+17
| | | | | | | | | | | | That CL should have updated some unit tests to account for the change in ownership of SyncSessionContext. BUG=103326 TEST=Ran valgrind locally on sync_unit_tests. Review URL: https://chromiumcodereview.appspot.com/10507002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140135 0039d316-1c4b-4281-b951-d872f2087c98
* Remove sync's ModelSafeWorkerRegistrarrlarocque@chromium.org2012-06-0118-296/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ModelSafeWorkerRegistrar interface was a wrapper around the SyncBackendRegistrar. When the sync thread wanted to access the SyncBackendRegistrar's information regarding currently enabled types or workers, it would use the ModelSafeWorkerRegistrar interface to do it. This change removes this implicit inter-thread communication. Where necessary, it modifies the SyncBackendHost, SyncManager, SyncScheduler and the SyncSessionContext to ensure that these classes have access to a fresh copy of the SyncBackendRegistrar's data whenever it is required. The most biggest consequence of this patch is that the SyncSessionContext now maintains a copy of the list of ModelSafeWorkers and routing info, rather than a pointer to the ModelSafeWorkerRegistrar. Various functions along the path to CleanupDisabledTypes, Configure and StartSyncingNormally have been updated to ensure that the latest routing info is made available to the session context. Future patches may refactor this code to reduce the amount of duplicated state. This work was intentionally left to future patches to reduce the risk of the current change. The refactoring should be much easier once we're convinced that the new, explicit inter-thread communication mechanisms are no more buggy than the existing code. BUG=103326 TEST=sync_integration_tests Review URL: https://chromiumcodereview.appspot.com/10388187 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140122 0039d316-1c4b-4281-b951-d872f2087c98
* Add APK targets for sql_unittests and sync_unit_tests.nileshagrawal@chromium.org2012-05-311-1/+28
| | | | | | | | | | | | | BUG=125059 Follow-up to: http://codereview.chromium.org/10399126/ TEST= Review URL: https://chromiumcodereview.appspot.com/10443068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139727 0039d316-1c4b-4281-b951-d872f2087c98
* sync: migrate invalidation state from syncable::Directory to InvalidationStoragetim@chromium.org2012-05-3123-121/+158
| | | | | | | | | | | | | | | | | | | | | | | Deprecates SyncNotifier::SetState, as this is needed only to plumb notification state from the syncable::Directory to notifier. It is still in use to facilitate migration. Migration for an existing sync setup works as follows: 1) normal SyncManager::Init occurs, which calls SetState on notifier. 2) The InvalidationNotifier takes the state received in SetState and echoes it back through the InvalidationStateTracker) which is the new store. It does this in addition to normal stashing, to hand to ChromeInvalidationClient when needed. 3) On a subsequent restart, the SyncNotifierFactory will see a non-empty initial invalidation state in the InvalidationStateTracker, and pass this down on creation to notifier components. 4) SetState calls will now be no-ops, as the invalidation state will be non-empty, and it can only be set once on this code path. UMA tracks the number of "worthwhile" SetStateDeprecated calls for a rough global migration progress. At some point in the future, once these bits have served all (statistically speaking) users, the SetStateDeprecated call can be removed entirely and the syncable::Directory schema updated to remove existing and unnecessary columns. I did not remove the column from DirectoryBackingStore::CreateTables, since the code doesn't really support a half-way migration and it's likely cleaner to do it in one fell swoop when we know it is safe. Open to suggestions. Built on http://codereview.chromium.org/10451058/ BUG=124140 TEST= Review URL: https://chromiumcodereview.appspot.com/10451060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139706 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Make InvalidationNotifier use PushClientakalin@chromium.org2012-05-3017-490/+571
| | | | | | | | | | | | | | | | | | | This removes a lot of duplicated code and unifies the two main SyncNotifier implementations (P2P and Invalidation) to use the same underlying transport layer. Replace CacheInvalidationPacketHandler and ChromeNetwork with PushClientChannel. Add PushClient::CreateDefaultOnIOThread which creates an XmppPushClient directly. BUG=76764 TEST= Review URL: https://chromiumcodereview.appspot.com/10436013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139508 0039d316-1c4b-4281-b951-d872f2087c98
* sync: fix and enable InvalidationNotifierTest.Basictim@chromium.org2012-05-301-8/+2
| | | | | | | | | | BUG=119467 TEST=InvalidationNotifierTest.Basic Review URL: https://chromiumcodereview.appspot.com/10446073 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139490 0039d316-1c4b-4281-b951-d872f2087c98
* sync: move invalidation version prefs out of SyncPrefs into InvalidatorStorage.tim@chromium.org2012-05-305-1/+20
| | | | | | | | | | | | | | | | | | | | De-coupling so we don't add more sync < > invalidations deps while adding support for storing opaque notification state in InvalidationStateTracker. Added get/setters to InvalidationStateTracker and impl (InvalidatorStorage), but it's not wired up for use yet. Next step is to add migration code to move state from syncable::Directory to InvalidationStateTracker. Comment in invalidator_storage.h explains motivations for not moving out of sync. This patch creates the c/b/s/invalidations directory, which we can move non-profile-sync-specific chrome invalidations code to (such as BridgedSyncNotifier, and the android related part of ChromeSyncNotificationsBridge). BUG=124140 TEST=InvalidatorStorageTest, should be no functional changes Review URL: https://chromiumcodereview.appspot.com/10451058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139464 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Cleanup all tab sync enabling logic now that its on by default.zea@chromium.org2012-05-308-98/+11
| | | | | | | | | | BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139462 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Loop committing items without downloading updatesrlarocque@chromium.org2012-05-2636-551/+625
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since its inception sync has required all commits to be preceded by a GetUpdates request. This was done to try to ensure we detect and resolve conflicts on the client, rather than having two conflicting commits collide at the server. It could never work perfectly, but it was likely to work in most cases and the server would bounce the commit if it didn't. Now we have a new server that doesn't always give us the latest version of a node when we ask for it, especially when the request was not solicited by the server (ie. not triggered by notification). The update before commit is now much less likely to detect conflicts. Even worse, the useless update requests can be surprisingly expensive in certain scenarios. This change allows us to avoid fetching updates between 'batches' of commits. This should improve performance in the case where we have lots of items to commit (ie. first time sync) and reduce load on the server. This CL has some far-reaching effects. This is in part because I decided to refactor the commit code, but major changes would have been required with or without the refactor. Highlights include: - The commit-related SyncerCommands are now paramaterized with local variables, allowing us to remove many members from the SyncSession classes. - Several syncer states have been collapsed into one COMMIT state which redirects to the new BuildAndPostCommits() function. - The PostCommitMessageCommand had been reduced to one line, which has now been inlined into the BuildAndPostCommits() function. - The unsynced_handles counter has been removed for now. Following this change, it would have always been zero unless an error was encountered during the commit. The functions that reference it expect different behaviour and would have been broken by this change. - The code to put extensions activity data back into the ExtensionsActivityMonitor in case of failure has been moved around to avoid double-counting if we have to post many commit messages. - A CONFLICT response from the server is now treated as a transient error. If we had continued to treat it as a success we might risk going into an infinite loop. See comment in code for details. - The "purposeless anachronism" conflicting_new_folder_ids_ has been removed. Review URL: https://chromiumcodereview.appspot.com/10210009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139159 0039d316-1c4b-4281-b951-d872f2087c98
* sync: in MutableEntry, SaveOriginals on-demand rather than on construction ↵tim@chromium.org2012-05-252-19/+21
| | | | | | | | | | | | | | | | to reduce unnecessary fragmentation. On several of my modestly sized accounts (~7000 items total) this reduced peak sync related memory consumption by an average of 14MB. Anecdotal evidence suggests larger accounts (many have 7000 or more autofill items alone) will see a nominal drop of over 50MB, which starts to become more than a drop in the bucket. I don't love this solution, because adding any new Put / mutating method on MutableEntry means remembering to add a call to SaveOriginals. This is somewhat mitigated by the fact that MutableEntry is quite stable and virtually never changes, and this change is small, easy to understand, and fully addresses the issue. BUG=127274 TEST=sync_unit_tests Review URL: https://chromiumcodereview.appspot.com/10441025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138991 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Fix sync_listen_notifications to use a real host resolverakalin@chromium.org2012-05-254-4/+42
| | | | | | | | | | | | | | | r138413 switched TestURLRequestContext to use a mock HostResolver by default. Clean up sync DEPS a bit. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10435007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138947 0039d316-1c4b-4281-b951-d872f2087c98
* Ignore tombstones for items belonging to unrequested types. lipalani@chromium.org2012-05-242-2/+18
| | | | | | | | | | | | During a sync cycle(regular or configuration) the server might send us tombstones for items that don't belong to one of the types that the client requested. If the server sent such tombstones, with this patch, the client would ignore them. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10432003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138923 0039d316-1c4b-4281-b951-d872f2087c98
* Disable failing test ImmutableTest.Deque on Windowsbattre@chromium.org2012-05-231-1/+7
| | | | | | | | | | BUG=129128 TEST=no TBR=akalin@chromium.org Review URL: https://chromiumcodereview.appspot.com/10388250 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138468 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Turn notifier::PushClient into an interfaceakalin@chromium.org2012-05-234-131/+127
| | | | | | | | | | | | | | | | | | | | | | | | | Split the previous implementation into two pieces: XmppPushClient and NonBlockingPushClient. Add FakePushClient and FakePushClientObserver. Remove use of ThreadSafeObserverList. Add PushClient::CreateDefault() function, which creates a NonBlockingPushClient for an XmppPushClient. Dep-inject PushClient into P2PNotifier. Add some helper functions to notification_defines.{h,cc}. BUG=76764 TEST= Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=138216 Review URL: https://chromiumcodereview.appspot.com/10413014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138431 0039d316-1c4b-4281-b951-d872f2087c98
* [net] Switch TestURLRequestContext and other tests to use ↵szym@chromium.org2012-05-232-1/+14
| | | | | | | | | | | | | | MockCachingHostResolver or MockHostResolver. Make explicit when HostResolver::Resolve is expected to never complete in tests. Clean up TestURLRequestContext API. BUG=126016,128745 TEST=net_unittests; jingle_unittests; sync_unit_tests Review URL: https://chromiumcodereview.appspot.com/10408067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138413 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 138216 - [Sync] Turn notifier::PushClient into an interfaceakalin@chromium.org2012-05-224-127/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | Split the previous implementation into two pieces: XmppPushClient and NonBlockingPushClient. Add FakePushClient and FakePushClientObserver. Remove use of ThreadSafeObserverList. Add PushClient::CreateDefault() function, which creates a NonBlockingPushClient for an XmppPushClient. Dep-inject PushClient into P2PNotifier. Add some helper functions to notification_defines.{h,cc}. BUG=76764 TEST= Review URL: https://chromiumcodereview.appspot.com/10413014 TBR=akalin@chromium.org Review URL: https://chromiumcodereview.appspot.com/10388227 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138221 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Turn notifier::PushClient into an interfaceakalin@chromium.org2012-05-224-119/+127
| | | | | | | | | | | | | | | | | | | | | | | Split the previous implementation into two pieces: XmppPushClient and NonBlockingPushClient. Add FakePushClient and FakePushClientObserver. Remove use of ThreadSafeObserverList. Add PushClient::CreateDefault() function, which creates a NonBlockingPushClient for an XmppPushClient. Dep-inject PushClient into P2PNotifier. Add some helper functions to notification_defines.{h,cc}. BUG=76764 TEST= Review URL: https://chromiumcodereview.appspot.com/10413014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138216 0039d316-1c4b-4281-b951-d872f2087c98
* Revive revision 137685 and fix the DEPs file in chrome/browser/syncmunjal@chromium.org2012-05-1815-91/+90
| | | | | | | BUG=124140 Review URL: https://chromiumcodereview.appspot.com/10408011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137922 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 137685 (broke check_deps on linux builder) - Rename ↵fischman@chromium.org2012-05-1715-90/+91
| | | | | | | | | | | | | | InvalidationVersionTracker to InvalidationStateTracker in preparation to add more methods to that class. BUG=124140 Review URL: https://chromiumcodereview.appspot.com/10407014 TBR=munjal@chromium.org Review URL: https://chromiumcodereview.appspot.com/10391186 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137689 0039d316-1c4b-4281-b951-d872f2087c98
* Rename InvalidationVersionTracker to InvalidationStateTracker in preparationmunjal@chromium.org2012-05-1715-91/+90
| | | | | | | | | to add more methods to that class. BUG=124140 Review URL: https://chromiumcodereview.appspot.com/10407014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137685 0039d316-1c4b-4281-b951-d872f2087c98
* Add additional error logging to investigate Autocomplete Sync failures.isherman@chromium.org2012-05-173-31/+64
| | | | | | | | | | BUG=122687 TEST=none Review URL: https://chromiumcodereview.appspot.com/10310113 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137617 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Replace TalkMediator*/MediatorThread* with PushClientakalin@chromium.org2012-05-1713-134/+103
| | | | | | | | | | | | | | | Streamline methods of PushClient and its Observer subclass. Remove sync/protocol/service_constants.h and consolidate use of each constant in one place. Remove duplicate constant in cloud print code. BUG=76764 TEST= TBR=estade@chromium.org Review URL: https://chromiumcodereview.appspot.com/10398051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137615 0039d316-1c4b-4281-b951-d872f2087c98
* Sync: Clear IS_UNSYNCED for deleted local itemsrlarocque@chromium.org2012-05-1611-83/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change, if we were to delete a newly-created item before informing the sync server of its existence, it would end up in an unusual state. We do not commit deleted items unless they were known to sync server. However, these items were still considered to be 'unsynced' (ie. waiting to be committed to the server) and therefore impossible to entirely remove from the sync directory. They remain forever both IS_DEL and IS_UNSYNCED. This had a few side-effects. The most serious is that this behaviour could cause directory corruption. If we created a folder and a bookmark within it, then deleted that bookmark before it had a chance to sync, the bookmark would remain in a zombie state. When we finally got around to committing its parent folder, the folder's ID will change. The zombie bookmark's PARENT_ID will not be updated, leaving us with a dangling reference that will be detected as directory corruption the next time sync is loaded. See crbug.com/125381 for details. Another effect is that locally deleted, never synced UNIQUE_CLIENT_TAG could have strange effects later on. If a foreign client were to create an item with the same UNIQUE_CLIENT_TAG and sync it, this client would conflict-resolve the update against the zombie entry. The zombie entry would win, the newly created item would be deleted, and the deletion synced back to the server. This may not be an entirely bad thing, but it is a behaviour that's changed following this patch. From now on, the deleted item will be overwritten (if it still exists, which it probably won't). Finally, we now have a mechanism for permanently deleting these items. With this patch applied, these items will no longer have the unsynced bit set, so they will be deleted on restart by DropDeletedEntries(). This patch changes PutIsDel() to clear the IS_UNSYNCED bit of entries which were never committed to the sync server. The remainder of the changes either add or update existing tests. BUG=125381 TEST=SyncerTest.ClientTagUncommittedTagMatchesUpdate, SyncableDirectoryTest.ChangeEntryIDAndUpdateChildren_DeletedAndUnsyncedChildren Review URL: https://chromiumcodereview.appspot.com/10389103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137476 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup: Remove unneeded scoped_ptr.h includes from ppapi, printing, ↵thestig@chromium.org2012-05-163-5/+5
| | | | | | | | | | | | remoting, and sync. BUG=none TEST=none TBR=brettw,hclam,akalin,abodenha Review URL: https://chromiumcodereview.appspot.com/10387107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137376 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Move PageTransitions enums to SyncEnumszea@chromium.org2012-05-165-50/+54
| | | | | | | | | | BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10382183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137309 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Move chrome/browser/sync/api to sync/apiakalin@chromium.org2012-05-1520-0/+1257
| | | | | | | | | | | | Update all references. BUG=128061 TEST= TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/10389134 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137062 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Clean up XMPP connection codeakalin@chromium.org2012-05-151-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove dead DNS-resolution-related code. Remove complicated XmppConnectionGenerator class now that we don't have to do DNS resolution ourselves. Move the simplified logic into MakeConnectionSettingsList(). Add unit tests for it. Remove unused ConnectionOptions struct. Simplify SingleLoginAttempt a bit and add tests for it. Also document redirection protocol. Simplify LoginSettings and add tests for it. Move redirection timeout logic from Login to LoginSettings. Replace some bools with enums. Document sketchy (but necessary) include of libjingle's p2p/port.h. Some minor cleanup here and there. BUG=38091 TEST= Review URL: https://chromiumcodereview.appspot.com/10391084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137027 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add check to help debug CreateOrUpdateSyncNode errors.zea@chromium.org2012-05-111-2/+10
| | | | | | | | | | | | | We check if we succeed in decrypting data, but fail in parsing the string into a protobuf. BUG=123223 TEST= Review URL: https://chromiumcodereview.appspot.com/10387089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136695 0039d316-1c4b-4281-b951-d872f2087c98
* Remove flaky assertion from TransientPollFailurerlarocque@chromium.org2012-05-111-7/+2
| | | | | | | | | | | | | | | | | | | This test has been causing flakiness on various platforms. Although we could try to fix this by relaxing the timing constraints, I think it's safer to remove the time-related assertions. The test will still be very useful even without that assertion. The UseMockDelayProvider() line and the other assertions should catch most of the same bugs that the timing assertions would have found. At least it's a significant improvement over a DISABLED/FLAKY test. BUG=118370 TEST=SyncSchedulerTest.TransientPollFailure Review URL: https://chromiumcodereview.appspot.com/10200001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136623 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Fix sync_listen_notification's usage messageakalin@chromium.org2012-05-111-1/+1
| | | | | | | | | | BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10383124 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136518 0039d316-1c4b-4281-b951-d872f2087c98
* Add session name for Chromebox.kochi@chromium.org2012-05-103-2/+23
| | | | | | | | | | | | | For testing, on stumpy open some tabs and sync, then on the other device click on NTP "other devices" link and see if "chromebox" appears. BUG=chromium:124916 TEST=manual Review URL: https://chromiumcodereview.appspot.com/10382034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136230 0039d316-1c4b-4281-b951-d872f2087c98