summaryrefslogtreecommitdiffstats
path: root/sync/sync.gyp
Commit message (Collapse)AuthorAgeFilesLines
* [sync] Componentize sync: Part Final: Target 'sync' is now its own componentrsimha@chromium.org2013-02-011-1007/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the long term goals of the sync team has been to pull sync out of chrome_dll and into its own component. This should result in faster link times for component builds, and cleaner demarcation between sync code and the rest of chrome. This patch does the following: - Splits off sync.gyp into gypi files for sync_core, sync_api, sync_internal_api, sync_notifier and sync_proto. - Audits the dependencies of various targets in sync.gyp, sync_tests.gyp, and other chrome gyp files, and makes sure all dependencies are explicitly declared. - Makes targets declared in gyp files outside sync.gyp directly depend on sync.gyp:sync instead of inner sync targets. - Implements two versions of the target 'sync.gyp:sync': 1) In static mode, the public 'sync' target has a target type of 'none', and is composed of the static library targets 'sync_api', 'sync_core', 'sync_internal_api', 'sync_notifier', and 'sync_proto'. 2) In component mode, we build the public 'sync' target into a single shared library, which includes the contents of sync_api.gypi, sync_core.gypi, sync_internal_api.gypi, sync_notifier.gypi, and sync_proto.gypi. TBR=akalin,robertshield,thakis BUG=136928 TEST=Set GYP_DEFINES="component=shared_library" and build the 'all' target on all platforms. Review URL: https://codereview.chromium.org/11412211 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180034 0039d316-1c4b-4281-b951-d872f2087c98
* Adds a client for v2 of the notification library.dsmyers@chromium.org2013-01-261-0/+1
| | | | | | | | BUG=159221 Review URL: https://chromiumcodereview.appspot.com/12051074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179048 0039d316-1c4b-4281-b951-d872f2087c98
* Makes the necessary changes to sync.gyp as well as its dependencies (most ↵blundell@chromium.org2013-01-241-30/+5
| | | | | | | | | | notably jingle) in order to bring up the complete sync_notifier target on iOS. TBR=thakis Review URL: https://chromiumcodereview.appspot.com/12041016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178650 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Componentize sync: Part 7: Eliminate more filename collisions in sync.gyprsimha@chromium.org2013-01-241-2/+2
| | | | | | | | | | | | | | | | | | | | In order to move src/sync into its own compoent, all the static_library targets in sync.gyp need to be converted to targets of type 'none' and rolled into one sync target of type component. This is currently blocked by duplicate .cc filenames in syncable and internal_api, which flags an error while running gyp. The offending files are {internal_api|syncable}/delete_journal.cc. This patch renames syncable/delete_journal.{h|cc} to syncable/syncable_delete_journal.{h|cc}. This is a continuation of https://codereview.chromium.org/11638018. BUG=136928 Review URL: https://codereview.chromium.org/12033084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178639 0039d316-1c4b-4281-b951-d872f2087c98
* Use delete journal to remove bookmarks that are already deleted in sync modelhaitaol@chromium.org2013-01-221-0/+2
| | | | | | | | | | | | | before assocating bookmark model and sync model. BUG=121928 Review URL: https://chromiumcodereview.appspot.com/11533008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178157 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Divorce python sync test server chromiumsync.py from testserver.pyrsimha@chromium.org2013-01-201-1/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Various chrome test suites use the infrastructure in net::LocalTestServer and net/tools/testserver.py to create local test server instances against which to run automated tests. Sync tests use reference implementations of sync and xmpp servers, which build on the testserver infrastructure in net/. In the past, the sync testserver was small enough that it made sense for it to be a part of the testserver in net/. This, however, resulted in an unwanted dependency from net/ onto sync/, due to the sync proto modules needed to run a python sync server. Now that the sync testserver has grown considerably in scope, it is time to separate it out from net/ while reusing base testserver code, and eliminate the dependency from net/ onto sync/. This work also provides us with the opportunity to remove a whole bunch of dead pyauto sync test code in chrome/test/functional. This patch does the following: - Moves the native class LocalSyncTestServer from net/test/ to sync/test/. - Moves chromiumsync{_test}.py and xmppserver{_test}.py from net/tools/testserver/ to sync/tools/testserver/. - Removes all sync server specific code from net/. - Adds a new sync_testserver.py runner script for the python sync test. - Moves some base classes from testserver.py to testserver_base.py so they can be reused by sync_testserver.py. - Audits all the python imports in testserver.py, testserver_base.py and sync_testserver.py to make sure there are no unnecessary / missing imports. - Adds a new run_sync_testserver runner executable to launch a sync testserver. - Removes a couple of static methods from LocalTestServer, that were being used by run_testserver, and refactors run_sync_testserver to use their non-static versions. - Adds the ability to run both chromiumsync_test.py and xmppserver_test.py from run_sync_testserver. - Fixes chromiumsync.py to undo / rectify some older changes that broke tests in chromiumsync_test.py. - Adds a new test target called test_support_sync_testserver to sync.gyp. - Removes the hacky dependency on sync_proto from net.gyp:net_test_support. - Updates various gyp files across chrome to use the new sync testserver target. - Audits dependencies of net_test_support, run_testserver, and the newly added targets. - Fixes the android chrome testserver spawner script to account for the above changes. - Removes all mentions of TYPE_SYNC from the pyauto TestServer shim. - Deletes all (deprecated) pyauto sync tests. (They had all become broken over time, gotten disabled, and were all redundant due to their equivalent sync integration tests.) - Removes all sync related pyauto hooks from TestingAutomationProvider, since they are no longer going to be used. - Takes care of a TODO in safe_browser_testserver.py to remove an unnecessary code block. Note: A majority of the bugs listed below are for individual pyauto sync tests. Deleting the sync pyauto test script fixes all these bugs in one fell swoop. TBR=mattm@chromium.org BUG=117559, 119403, 159731, 15016, 80329, 49378, 87642, 86949, 88679, 104227, 88593, 124913 TEST=run_testserver, run_sync_testserver, sync_integration_tests, sync_performance_tests. All chrome tests that use a testserver should continue to work. Review URL: https://codereview.chromium.org/11971025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177864 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Add java InvalidationController for Android.nyquist@chromium.org2013-01-121-0/+31
| | | | | | | | | | | | | | | | | | | * Adds InvalidationController to facilitate the move to the new invalidation client, but still supporting the old way. * Sets up the chromium test shell to be able to run the new tests for sync. * Upstreaming a few base test utilities for MockContext and SharedPreferences. InvalidationController and InvalidationControllerTest provided by dsmyers@chromium.org. BUG=159221 Review URL: https://chromiumcodereview.appspot.com/11778084 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176533 0039d316-1c4b-4281-b951-d872f2087c98
* Initial UniquePositions implementationrlarocque@chromium.org2013-01-081-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Introduces a new class that represents an item's position within an arbitrarily ordered list. It's currently biased towards bookmarks, but it could be made more generic if there was a need for it. This class supports inserting before, after, or between other UniquePosition items. It never runs out of position values, though it can use up unbounded space in the worst case. In addition to the basics mentioned above, it also has support for other functions that are particularly useful for bookmark sync. The positions are serializable and de-serializable, for storage and transimission. They also support conversion to and from int64 values, allowing them to operate with old-style positions. The class is not currently used anywhere. This commit includes only its implementation and some tests. BUG=145412 Review URL: https://chromiumcodereview.appspot.com/11569045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175462 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add support for loading, updating and querying delete journals in haitaol@chromium.org2013-01-051-0/+2
| | | | | | | | | | | | | | | | | | | Directory. Delete journals keeps deleted metas until the persistence of the deletes in native model is confirmed. When an entry is deleted in sync model, a copy is added to delete journals in memory and saved in database later. Next time when the client restarts, if some native data doesn't match with sync data but matches with a delete journal, it's safe to assume that it's because native delete was not persisted and the native data should be deleted. This helps prevent back-from-dead problem due to native model and sync model get out-of-sync. BUG=121928 Review URL: https://chromiumcodereview.appspot.com/11441026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175248 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Move unique_client_tag hashing coderlarocque@chromium.org2012-12-211-0/+1
| | | | | | | | | | | | | | | | | This is one of many changes that will lead up to the introduction of the bookmark UniquePosition algorithm. We eventually want to use the hashing code to create a unique tag for bookmarks. This tag will be initialized at bookmark creation time in MutableEntry. This patch moves the hashing code out of BaseNode and into syncable_util so it can be accessed from the syncable layer. BUG=145412,126505 Review URL: https://chromiumcodereview.appspot.com/11571092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174449 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Componentize sync: Part 5: Eliminate filename collisions in sync.gyprsimha@chromium.org2012-12-191-7/+7
| | | | | | | | | | | | In order to move src/sync into its own compoent, all the static_library targets in sync.gyp need to be converted to targets of type 'none' and rolled into one sync target of type component. This is currently blocked by duplicate .cc filenames in syncable and internal_api, which flags an error while running gyp. The offending files are {internal_api|syncable}/{base|read|write}_transaction.cc. This patch renames syncable/{base|read|write}_transaction.{h|cc} to syncable/syncable_{base|read|write}_transaction.{h|cc}. BUG=136928 Review URL: https://codereview.chromium.org/11638018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174032 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add tests for invalid specifics field number handlingakalin@chromium.org2012-12-131-0/+1
| | | | | | | | | | | | | | | | | | This is a follow up to r172232. Change NOTREACHED() to DLOG(WARNING), since the server sending down unknown/invalid field numbers is a valid event. Add tests for the code that uses GetModelTypeFromSpecificsFieldNumber(). Clean up some code in sync/engine/ a bit. BUG=165171 Review URL: https://chromiumcodereview.appspot.com/11485019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@172816 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] [chromeos] Get rid of dependencies on chrome/browser from within sync/rsimha@chromium.org2012-12-071-10/+11
| | | | | | | | | | | | | | | | | | | | | As of today, syncer::GetSessionNameSynchronously() utilizes code in chromeos::system::StatisticsProvider, which lives in chrome/browser/chromeos. This results in an ugly mutual dependency between sync.gyp:sync and chrome.gyp:browser. This hasn't been a huge problem so far because sync is built into browser. It will, however, be a problem once sync is pulled into its own component. This patch does the following: - Removes the dependency from sync/ onto chrome/browser. - Reimplements GetSessionNameSynchronously to use command line primitives. - Adds new CrOs-only unit tests to exercise this code. BUG=164726,126732,136928 TEST=GetSessionNameTest.*; Open a new tab on a Chromebook and Chromebox and make sure the title of the "Other devices" section looks right. Review URL: https://codereview.chromium.org/11473012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171683 0039d316-1c4b-4281-b951-d872f2087c98
* Implement features needed for local ack handling in InvalidationStateTracker.dcheng@chromium.org2012-12-051-0/+21
| | | | | | | | | | | Adds the ability to save payloads in InvalidationStateTracker, and also adds the functionality to generate, track, and acknowledge local ack handles. BUG=124149 Review URL: https://codereview.chromium.org/11415049 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171165 0039d316-1c4b-4281-b951-d872f2087c98
* Depend on stored sync session GUID for Android.nyquist@chromium.org2012-12-051-2/+0
| | | | | | | | | | | | | | | | | | This changes the Android port of Chrome to depend on the pref kSyncSessionsGUID to be set before the SessionModelAssociator is initialized. We now also force-removes any foreign sessions that are using the current client's GUID as a session tag. This also lead to the removal of the Android specific session utils. BUG=157419 Review URL: https://chromiumcodereview.appspot.com/11414013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171109 0039d316-1c4b-4281-b951-d872f2087c98
* For iOS, exclude a unit test that crashes when coverage is turned on.lliabraa@chromium.org2012-11-291-2/+7
| | | | | | | | | BUG=156058 Review URL: https://chromiumcodereview.appspot.com/11412222 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170199 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unregistered IDs from the invalidation state map cache.dcheng@chromium.org2012-11-211-1/+2
| | | | | | | | | BUG=161754 Review URL: https://chromiumcodereview.appspot.com/11316079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169113 0039d316-1c4b-4281-b951-d872f2087c98
* Sync: Add DeviceInfo's ChangeProcessorrlarocque@chromium.org2012-11-211-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the long-awaited change to enable DeviceInfo tracking. Long ago (r161496) we committed code to support the DeviceInfo type, but we had to leave this code disabled until the server was ready to support the new type. That support has now been added. This change includes a very special kind of ChangeProcessor named SyncedDeviceTracker. It is the only ChangeProcessor that is owned by the sync thread. The SyncBackendHost creates and initializes it during backend intialization and deletes it before the UserShare it references is destroyed. As part of its initialization, the SyncedDeviceTracker will update the DeviceInfo entry for the current device. The SyncedDeviceTracker could support sending notifications to any interested listeners when new or update DeviceInfo information arrives, but this functionality has not been implemented yet. Also included are: - Tests for the SyncedDeviceTracker - A MockTransactionObserver to support these tests - A cache_guid() accessor on the SyncManager, used to initialize the SyncedDeviceTracker - Remove support for default constructing a DeviceInfo object BUG=122825 Review URL: https://chromiumcodereview.appspot.com/11360259 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168972 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Componentize sync: Part 1: Clean up sync.gyp and update chrome / test ↵rsimha@chromium.org2012-11-141-126/+160
| | | | | | | | | | | | | | | | | | | | | | | | dependencies One of the long term goals of the sync team is to pull sync code out of chrome.dll and into its own component. As of today, several chrome tests depend on various sync targets as defined in sync.gyp. This is the first in a series of CLs to achieve the above goal. This patch does the following: - Renames / reorganizes several of the targets in sync.gyp - Updates the declarations in various chrome gyp files by depending on the smallest sync target possible to reflect the actual dependency. - Takes a step closer toward the ideal IWYU guideline. TBR=erikwright@chromium.org BUG=136928 TEST=all chrome targets build on all platforms; all tests pass. Review URL: https://chromiumcodereview.appspot.com/11348052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167558 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add datatype controller support for tracking association statszea@chromium.org2012-11-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | SyncMergeResult is a new class that allows datatypes and sync itself to record association information for later use by the debug info listener. We introduce the class and add some plumbing at the DTC level to pass these on to the model association manager (and from there to the debug listener). Similarly, to track syncer changes, we pass a SyncMergeResult weak pointer to the SharedChangeProcessor, which while it's valid will increment the deltas as changes arrive (in a future patch). The weak pointer is invalidated at the end of association by the DTC. To simplify the DTC plumbing of merge results, StartFailed has been merged into StartDone. Additionally, removed some old logging code attempting to identify which datatype was being Stopped that isn't necessary anymore. BUG=158576 Review URL: https://chromiumcodereview.appspot.com/11401002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167528 0039d316-1c4b-4281-b951-d872f2087c98
* Bring up minimal sync and sync unittest targets on iOS.blundell@chromium.org2012-11-131-2/+24
| | | | | | | | | | | | The sync implementation is not yet complete (e.g., there is not yet an invalidator_factory implementation on iOS), but enough of the structure is in place to allow for the sync target to build and a reduced set of unittests to run successfully. Review URL: https://chromiumcodereview.appspot.com/11360194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167485 0039d316-1c4b-4281-b951-d872f2087c98
* Implement a class to manage backoff timers for local invalidation reminders.dcheng@chromium.org2012-11-091-0/+3
| | | | | | | | | BUG=124149 Review URL: https://chromiumcodereview.appspot.com/11298002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166854 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Introduce DataTypeDebugListener and add plumbing to the DataTypeManagerzea@chromium.org2012-11-081-0/+3
| | | | | | | | | | | | | | | | The DataTypeDebugListener is an interface that allows glue components to pass sync debug info to the sync debug event listener, which lives in the sync internals on the sync thread. To do this we pass a WeakHandle at initialization time all the way through to the PSS, which then uses it to create the DataTypeManager. Follow up patches will plumb DTC results to the DataTypeDebugListener. BUG=158576 Review URL: https://chromiumcodereview.appspot.com/11365116 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166616 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Follow-up to conflict resolution refactorrlarocque@chromium.org2012-11-011-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is part two of r164286. That commit refactored the way we handle conflict resolution. This commit takes advantage of those changes to delete lots of code. Because this change deletes session_state.cc, I decided to move the two remaining useful tests session_state_unittest.cc into their own files, sync_session_snapshot_unittest.cc and sync_source_info_unittest.cc. The tests were not modified in any way. None of these changes should have any effect on syncer behaviour: - We can remove the simple conflict counters and related code, since we now assert that all conflicts will be resolved by the end of a successful sync cycle. - We can remove the PerModelSafeGroupState because that struct no longer has any members. - The 'conflicts_resolved' indicators are no longer set, so we can remove them. - Without those indicators, it's no longer possible to have any SYNC_CYCLE_CONTINUATION sync cycles. We can remove a few counters associated with them, as well as the 'has_more_to_sync' flag in the snapshot. - Without SYNC_CYCLE_CONTINUATION cycles, there's no longer any need for code that loops around SyncShare() in SyncSchedulerImpl. The SyncSession::PrepareForAnotherSyncCycle() function is no longer used, either. - The ScopedConflictResolver installed on the session during a sync cycle is no longer used, so all the code related to it can be deleted. BUG=147681,111280,156238 Review URL: https://chromiumcodereview.appspot.com/11314008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165474 0039d316-1c4b-4281-b951-d872f2087c98
* sync: reland scheduler ownership refactoring, now with less crashtim@chromium.org2012-10-301-0/+3
| | | | | | | | | | | | | Prevent abandoned jobs from entering DoCanaryJob by stopping the timer in TakePendingJobForCurrentMode. Original review at https://codereview.chromium.org/10917234/ BUG=158313 Review URL: https://chromiumcodereview.appspot.com/11341030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164992 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 164565 - sync: make scheduling logic and job ownership more obvious.dharani@google.com2012-10-291-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert Reason - see bug 158313 - inlines (and removes) SaveJob, to perform only the relevant "saving" bits where needed. As it turns out, most of it was only necessary for ShouldRunJob (which I'd like to rename, as it's destructive), and it's a lot easier to read what's happening and why. Note also removed TODO at SaveJob callsites. - inlines (and removes) InitOrCoalescePendingJob to perform only the relevant bits at each callsite. - pulls SyncSessionJob into a class, to handle basic responsibilities that need the job Purpose + session (like "Succeeded()" and "Finish") that were previously strewn about and partially copy/pasted in the scheduler. - meticulously transfers ownership (removes linked_ptr usage!) of jobs instead of making many implicit struct copies, as it resulted in non-obvious behavior. To do this, ownership is given to the scheduling mechanism (the MessageLoop for ScheduleSyncSessionJob, WaitInterval::timer for canary jobs), instead of jobs sitting around without knowing whether they're scheduled or not. There are a few cases where we can't actually "schedule" a job -- which wasn't even obvious from the old code, and other interesting revelations, like fact that we were actually pre-empt nudge canary jobs and "unscheduling" them in certain cases. - removes DoPendingJobIfPossible, since it is no longer needed for DoCanaryJob/Unthrottle cases, and make the behavior more explicit in the other cases (mode-switch and SCM error change), see TakePendingJobForCurrentMode. - removes the ability to create jobs as canary, since this wasn't needed and was adding complexity (see DoCanaryJob / GrantCanaryPrivilege). - removes retry_scheduled as it wasn't used anywhere - adds lots of comments. Also discovered that THROTTLED intervals seem to never fire a canary job with today's code (broken), config jobs are immune to per-data-type throttling, and the had_nudge allowance was defeated by extra IsBackingOff check in ScheduleNudgeImpl (see comment on review). BUG= Review URL: https://chromiumcodereview.appspot.com/10917234 TBR=tim@chromium.org Review URL: https://codereview.chromium.org/11347027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164780 0039d316-1c4b-4281-b951-d872f2087c98
* sync: make scheduling logic and job ownership more obvious. tim@chromium.org2012-10-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - inlines (and removes) SaveJob, to perform only the relevant "saving" bits where needed. As it turns out, most of it was only necessary for ShouldRunJob (which I'd like to rename, as it's destructive), and it's a lot easier to read what's happening and why. Note also removed TODO at SaveJob callsites. - inlines (and removes) InitOrCoalescePendingJob to perform only the relevant bits at each callsite. - pulls SyncSessionJob into a class, to handle basic responsibilities that need the job Purpose + session (like "Succeeded()" and "Finish") that were previously strewn about and partially copy/pasted in the scheduler. - meticulously transfers ownership (removes linked_ptr usage!) of jobs instead of making many implicit struct copies, as it resulted in non-obvious behavior. To do this, ownership is given to the scheduling mechanism (the MessageLoop for ScheduleSyncSessionJob, WaitInterval::timer for canary jobs), instead of jobs sitting around without knowing whether they're scheduled or not. There are a few cases where we can't actually "schedule" a job -- which wasn't even obvious from the old code, and other interesting revelations, like fact that we were actually pre-empt nudge canary jobs and "unscheduling" them in certain cases. - removes DoPendingJobIfPossible, since it is no longer needed for DoCanaryJob/Unthrottle cases, and make the behavior more explicit in the other cases (mode-switch and SCM error change), see TakePendingJobForCurrentMode. - removes the ability to create jobs as canary, since this wasn't needed and was adding complexity (see DoCanaryJob / GrantCanaryPrivilege). - removes retry_scheduled as it wasn't used anywhere - adds lots of comments. Also discovered that THROTTLED intervals seem to never fire a canary job with today's code (broken), config jobs are immune to per-data-type throttling, and the had_nudge allowance was defeated by extra IsBackingOff check in ScheduleNudgeImpl (see comment on review). BUG= Review URL: https://chromiumcodereview.appspot.com/10917234 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164565 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Merge apply updates and resolve conflictsrlarocque@chromium.org2012-10-261-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The conflict resolution code was executed after the commit for reasons which no longer apply. Because we no longer have to worry about resolving hierarchy conflicts or nigori node conflicts, we have the opportunity to move conflict resolution closer to update application. One advantage of resolving conflicts early is that we no longer require an extra sync cycle to commit any 'local wins' conflict resolutions. This makes SYNC_CYCLE_CONTINUATION sync cycles obsolete. Another advantage is that update application and conflict resolution can be performed without releasing the sync lock, which eliminates several types of races that we used to have to worry about. It's probably more efficient, too. It allows us to guarantee that there are no simple conflicts remaining after the update application step is completed. The effects might not be very noticeable to end users, but it will be nice to remove some of the conflict tracking code. Finally, it removes the last use PerModelSafeGroupState. This will let us delete some unused code and hopefully simplify StatusController. This patch does not pursue these cleanups as agressively as it could. The idea here is to keep the complex logic changes in one small CL, and perform the cleanups in a larger, but simpler, follow-up CL. BUG=147681,11280,156238 Review URL: https://chromiumcodereview.appspot.com/11192071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164286 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Merge {Verify,Process}UpdatesCommandrlarocque@chromium.org2012-10-161-3/+0
| | | | | | | | | | | | | | | | | | | | The VerifyUpdatesCommand was used to ensure the validity of each update that had been delivered from the server and to prepare for the ProcessUpdatesCommand. The ProcessUpdatesCommand would then take all updates that had been successfully verified and move them into the SERVER_ fields of the sync directory. It turns out that the logic can be greatly simplified by performing both tasks within the same command. This patch does not take full advantage of the merge. This patch is intended simply to merge the two files, with the goal of performing more significant refactorings later. BUG=154654 Review URL: https://chromiumcodereview.appspot.com/11091009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162176 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Refactor SyncSessionSnapshot to use new ProgressMarkerMap.mmontgomery@chromium.org2012-10-151-0/+2
| | | | | | | | | | | | | | This is the first step in refactoring the Sync integration tests to use progress markers to detect quiescence. This will save that mechanism from having to round-trip progress markers through multiple encodings. We can instead use protobufs' existing serialization/deserialization methods. BUG= Review URL: https://chromiumcodereview.appspot.com/10986004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161918 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for coverage=1 builds on iOSstuartmorgan@chromium.org2012-10-121-0/+9
| | | | | | | | | | | | Uses the same method as is used on Mac to enable coverage. Some sources need to be removed in coverage mode due to a toolchain bug. BUG=None Review URL: https://chromiumcodereview.appspot.com/11111014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161633 0039d316-1c4b-4281-b951-d872f2087c98
* Do not build libjingle on iOS.msarda@chromium.org2012-10-081-4/+15
| | | | | | | | | Avoid building libjingle on iOS as it is not needed. Review URL: https://chromiumcodereview.appspot.com/11027018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160659 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove ConflictProgressrlarocque@chromium.org2012-10-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | This change removes the ConflictProgress struct from the PerModelSafeGroupState. The struct was intended to pass state between the update application and conflict resolution commands. This part of its functionality has been replaced with a vector of simple conflict item IDs. The ConflictProgress struct also had an important role to play in stats gathering and unit tests. To replace it, the update applicator has been updated to store its counts directly in the StatusController. Unlike ConflictProgress, this state is not thread-local. That's acceptable because we can guarantee it will only be read or written by one thread at a time and those threads use appropriate thread-safety mechanisms to transfer control to each other. This change is another step towards merging update application and conflict resolution. BUG=147681 Review URL: https://chromiumcodereview.appspot.com/11049002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160530 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ModelType/ObjectIdStateMap to InvalidationMap.dcheng@chromium.org2012-10-041-13/+13
| | | | | | | | | | BUG=none TBR=sky Review URL: https://chromiumcodereview.appspot.com/11052007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@160073 0039d316-1c4b-4281-b951-d872f2087c98
* Do not build sync command line tools on iOS.msarda@chromium.org2012-09-251-38/+41
| | | | | | | | | Exclude the sync command line tools on iOS as they cannot be built. Review URL: https://chromiumcodereview.appspot.com/10970068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158551 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add keystore encryption info to about:synczea@chromium.org2012-09-191-0/+1
| | | | | | | | | | | | | | | | | | | This patch adds the following fields under the encryption section of about:sync - Has Keystore Key: whether the encryption handler has a keystore encryption key - Migration Time: the time migration was performed, or "Not Migrated" if migration hasn't been performed yet - Passphrase Type: the actual passphrase type (provides more detail than Is Using Explicit Passphrase, but stored at a diff layer) Added sync/api/time.h, which just includes sync/util/time.h but is accessible from chrome/ BUG=129665 Review URL: https://chromiumcodereview.appspot.com/10917246 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157499 0039d316-1c4b-4281-b951-d872f2087c98
* sync: add Google API Key to all ClientToServerMessages.tim@chromium.org2012-09-171-0/+1
| | | | | | | | | | | | | Also move setting of "must have" sync fields to PostClientToServerMessage (from DownloadUpdatesCommand & BuildCommitCommand). Needed for M23 branch. BUG= Review URL: https://chromiumcodereview.appspot.com/10916276 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157081 0039d316-1c4b-4281-b951-d872f2087c98
* Remove {base,net}_java dependencies from GYP client targets on Android.pliard@chromium.org2012-09-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | On Android, some GYP client targets were explicitly depending on both the native and Java sides of a library. This removes the dependencies to {base,net}_java and make the native side ('base' and 'net) of these libraries depend on their Java counterpart. On Android it rarely makes sense to depend on a single side of a Java/C++ library. The {base,net}_java can now be considered as "private" targets although GYP does not support this concept unfortunately (AFAICT). Note that I made sure that the resulting APKs' size is unchanged. Additionally, this CL removes 'base_java' (i.e. does not replace it with 'base') from the targets including 'build/apk_test.gypi'. This dependency should not have been there (in the wrong layer) in the first place. It's needed by ChromeNativeTestActivity.java which clients should not know about. BUG=146323 TBR=lipalani,sky,willchan,brettw Review URL: https://chromiumcodereview.appspot.com/10913083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155737 0039d316-1c4b-4281-b951-d872f2087c98
* [Invalidations] Add GetInvalidatorState() to Invalidator{,Frontend}akalin@chromium.org2012-09-071-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | Combine OnNotifications{Enabled,Disabled}() into OnInvalidatorStateChange(). Replace NotificationsDisabledReason with InvalidatorState. Rename OnIncomingNotification to OnIncomingInvalidation. Also change some references of "notification" to "invalidation". Set the initial invalidator state in ChromeToMobileService. Also remove OnNotificationsEnabled() call from OnIncomingInvalidation(). Instantiate InvalidatorTest template for ProfileSyncService. Move comments for invalidation-related functions from ProfileSyncService to InvalidatorFrontend. Put DISALLOW_COPY_AND_ASSIGN on some classes. Fix comment in invalidator.h. BUG=142475 TBR=brettw@chromium.org Review URL: https://chromiumcodereview.appspot.com/10916131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155448 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Generalize StringOrdinal to handle ordinal_in_parent fieldakalin@chromium.org2012-09-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Rename StringOrdinal to Ordinal, move it to sync/, and templatize it. Make StringOrdinal be an instantiation of Ordinal that matches its previous behavior. Create NodeOrdinal, which is another instantiation of Ordinal for the ordinal_in_parent field in SyncEntity. Rework Ordinal to handle arbitrary byte ranges and to simplify the interpolation code a bit. Generalize StringOrdinal unit tests for Ordinal. Update users of StringOrdinal to prepend syncer::. BUG=145412 TBR=estade@chromium.org,jianli@chromium.org,brettw@chromium.org, Review URL: https://chromiumcodereview.appspot.com/10920017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155368 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Rename classes in sync/ that start with Chromeakalin@chromium.org2012-09-061-6/+6
| | | | | | | | | | | There should be as few references as possible to Chrome from sync/. BUG= Review URL: https://chromiumcodereview.appspot.com/10907070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155110 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Rework Invalidator-related unit testsakalin@chromium.org2012-08-311-4/+5
| | | | | | | | | | | | | | | | | | | Introduce invalidator_test_template.h, which contains tests that should be used for each Invalidator implementation. Make all Invalidator implementations, and also InvalidatorRegistrar, instantiate that test template. Move most InvalidatorRegistrar tests and some of the other Invalidator implementation tests to the template. Make P2PInvalidator support arbitrary object IDs. Also make SendInvalidation take an ObjectIdStateMap. Simplify BridgedInvalidator a bit; it no longer requires a call to UpdateEnabledTypes (it just uses all registered types from its registrar). Rework tests for BridgedInvalidator/ChromeSyncNotifierBridge to not require functions in ChromeSyncNotifierBridge to be marked virtual. Add conversions to/from Values for InvalidationState, ObjectId, and ObjectIdStateMap. BUG=141678 Review URL: https://chromiumcodereview.appspot.com/10874096 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154538 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Introduce control data typesrlarocque@chromium.org2012-08-311-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nigori node has always been treated specially. It is downloaded during early sync initialization. It has custom encryption, update application, and conflict resolution logic. It is not user-selectable, but is instead always implicitly enabled. This patch replaces a lot of if (NIGORI)' code branches and creates the infrastructure we will need to support other data types that have these properties. These types will be used to store metadata required for the normal operation of the syncer. Notable changes include: - Introduce mutually exclusive lists of control types and user types in model_type.cc. - Create an ApplyControlDataUpdates() function, which will be used to apply changes and resolve conflicts for control data types. - Add some if statements to skip processing of control data updates in the regular conflict resolution code path. - Move around some code to accomodate the above changes. Introduce apply_control_data_updates_unittest.cc and conflict_util.cc - Have SyncBackendHost download all control types during init, not just the NIGORI. - Introduce a PurgeForMigration() function on the DataTypeManagerImpl class to support migration of control data types. This replaces ConfigureWithoutNigori(), which would not have scaled well as additional control data types were addded. - Modify the encryption logic so that only user types may be set to be encrypted. The Nigori is no longer expected to be in the set of encrypted types, though it is no less encrypted than it was before this change. - Use the list of user types to help calculate the list of registered sync prefs. BUG=122825,111297 Review URL: https://chromiumcodereview.appspot.com/10832286 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154522 0039d316-1c4b-4281-b951-d872f2087c98
* Rename SyncNotifier->Invalidator and SyncNotifierObserver->InvalidationHandler.dcheng@chromium.org2012-08-281-18/+18
| | | | | | | | | | | | | This makes the naming more consistent with how the various classes and interfaces are used, since they are not sync-specific anymore. BUG=none TBR=sky Review URL: https://chromiumcodereview.appspot.com/10875064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153619 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Use fakes for SyncNotifier{,Observer} instead of mocksakalin@chromium.org2012-08-241-2/+4
| | | | | | | | | | | An upcoming CL will require more complex functionality, so fakes are better suited. BUG=141678 Review URL: https://chromiumcodereview.appspot.com/10868061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153243 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ModelTypePayloadMap and ObjectIdPayloadMap to StateMaps.dcheng@chromium.org2012-08-241-5/+12
| | | | | | | | | | | | | This lays the groundwork for allowing us to pass ack handles for object IDs to SyncNotifierObservers. BUG=124149 TEST=none, there should be no behavior change. Review URL: https://chromiumcodereview.appspot.com/10837214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153158 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add SyncEncryptionHandlerzea@chromium.org2012-08-161-0/+12
| | | | | | | | | | | | | | | | | | All sync-specific encryption state (types, encrypt everything, explicit passphrase, keys) is now tracked within the new class SyncEncryptionHandler. It's owned by the sync manager, and unifies some of the observer logic we previously had. In addition, it's capable of creating its own transactions, taking us a step closer to have a nigori datatype. In addition, we add a NigoriHandler to abstract the chrome-side of encryption from the sync visible side of encryption. BUG=139848 Review URL: https://chromiumcodereview.appspot.com/10827266 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151833 0039d316-1c4b-4281-b951-d872f2087c98
* sync: add InternalComponentsFactory::Switches to simplify passing switches ↵tim@chromium.org2012-08-151-0/+3
| | | | | | | | | | | | | | | | | | to internal components. Cleans up backoff retry override code to use InternalComponentsFactory::Switches rather than global bool hack. Also puts keystore encryption flag atop new mechanism. (TBR sky for new chrome_switch). TBR=sky@chromium.org BUG=142029, 139839 Review URL: https://chromiumcodereview.appspot.com/10837231 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151664 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Avoid unregistering object IDs on shutdownakalin@chromium.org2012-08-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | Add RegisterHandler() and UnregisterHandler(), which should be called before and after calls to UpdateRegisteredIds(). Use UnregisterHandler() on shutdown instead of UpdateRegisteredIds(_, ObjectIdSet()). Make SyncNotifierHelper non-thread-safe. Fix test breakages that this revealed. Also add GetAllRegisteredIds() instead of making it the return value of UpdateRegisteredIds(). Propagate UpdateRegisteredIds()/RegisterHandler()/UnregisterHandler() all the way up to ProfileSyncService. Make FakeSyncManager be created on the sync thread. Clean up SyncBackendHost startup/shutdown behavior a bit. BUG=140325 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=150990 Review URL: https://chromiumcodereview.appspot.com/10824161 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151107 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 150990 - [Sync] Avoid unregistering object IDs on shutdownjeremya@chromium.org2012-08-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Add RegisterHandler() and UnregisterHandler(), which should be called before and after calls to UpdateRegisteredIds(). Use UnregisterHandler() on shutdown instead of UpdateRegisteredIds(_, ObjectIdSet()). Make SyncNotifierHelper non-thread-safe. Fix test breakages that this revealed. Also add GetAllRegisteredIds() instead of making it the return value of UpdateRegisteredIds(). Propagate UpdateRegisteredIds()/RegisterHandler()/UnregisterHandler() all the way up to ProfileSyncService. Make FakeSyncManager be created on the sync thread. Clean up SyncBackendHost startup/shutdown behavior a bit. BUG=140325 Review URL: https://chromiumcodereview.appspot.com/10824161 TBR=akalin@chromium.org Review URL: https://chromiumcodereview.appspot.com/10824252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150992 0039d316-1c4b-4281-b951-d872f2087c98