summaryrefslogtreecommitdiffstats
path: root/sync
Commit message (Collapse)AuthorAgeFilesLines
* Added crypto random-number generatormniknami@chromium.org2012-08-021-11/+3
| | | | | | | | | | | Added a cryptographic random-number generator to crypto/. Modified sync to use this function instead. May also be used by Cloud Print in the future. Review URL: https://chromiumcodereview.appspot.com/10698177 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149689 0039d316-1c4b-4281-b951-d872f2087c98
* mac: Don't use |NSHost currentHost|, as it takes 4s per testthakis@chromium.org2012-08-021-9/+8
| | | | | | | | | | | Also see http://codereview.chromium.org/7000022 BUG=81634,138570 Review URL: https://chromiumcodereview.appspot.com/10827126 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149543 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Improve tracking of useless updatesrlarocque@chromium.org2012-08-011-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our counts of non-useless updates are wrong in part because of the way we track deletions. When an item is deleted, we flip the IS_DEL bit. On restart, we purge all fully synced IS_DEL items from our directory. However, we might still receive some re-deliveries of the tombstone for that item. The old algorithm would consider tombstones of non-existent items to be "useful", despite the fact that they're often just reflections of updates we've already received. The updated algorithm isn't perfect. There's no easy way to distinguish between a tombstone created by another client where this client never saw the original (which one could argue is useful, and definitely not a reflection) and the re-delivery of a tombstone created by another client which this client has already received and processed long ago (which is definitely not useful). Both scenarios look the same, and both will be counted as 'reflections' under the new algorithm. A similar issue arises with UNIQUE_CLIENT_TAG items. When we delete them we force their version to 0 locally. This makes our regular reflection detection algorithm ineffective. This change updates the algorithm to consider tombstones to items that have UNIQUE_CLIENT_TAG and are locally deleted to be reflections. It's not perfect, but it should be good enough for our purposes. BUG=139684 Review URL: https://chromiumcodereview.appspot.com/10834095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149368 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Persist keystore key across restartszea@chromium.org2012-08-0111-26/+117
| | | | | | | | | | | | | | | | Adds the preference for the bootstrap token and the bootstrapping functionality in the cryptographer so that we persist the keystore key across restarts. With this, we should only ever do one GetKey per client, and only on the first time that client signs in/restarts on a version with GetKey support (although it's not persisted across signouts/profile nukes) BUG=129665 TEST=unit_tests Review URL: https://chromiumcodereview.appspot.com/10540149 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149344 0039d316-1c4b-4281-b951-d872f2087c98
* Fix SyncManager initialization failure crash.rlarocque@chromium.org2012-07-317-23/+85
| | | | | | | | | | | | | | | | | | | | This crash was introduced in r148926, which changes SyncManager init behaviour. Previously, the SyncManager would end up with a valid SyncScheduler regardless of whether or not the initialization failed. This SyncScheduler would later play an important role in shutting down the syncer. Without a scheduler, the shutdown process crashes. The ProfileSyncServiceTest.CorruptDatabase test simulates the scenario we fail to load a sync directory. This will result in a SyncManager initialization failure. It is intended to test that this failure is handled by the ProfileSyncService, SyncBackendHost and SyncManager. BUG=139723 Review URL: https://chromiumcodereview.appspot.com/10830100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149306 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add support for performing a GetKey on startup.zea@chromium.org2012-07-3135-74/+250
| | | | | | | | | | | | | | | | | The functionality is behind the --sync-keystore-encryption flag, and the key is not currently consumed by anything, but this lays the groundwork for testing the server and client interaction. We request a key anytime we perform a GetUpdates while the cryptographer does not have a keystore key. But, it is considered an error to request a key and not receive one, putting us into a state of backoff. BUG=129665 TEST=sync_unit_tests, running against python server Review URL: https://chromiumcodereview.appspot.com/10455012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149248 0039d316-1c4b-4281-b951-d872f2087c98
* Change protoc build rule to not use cygwin bash.iannucci@chromium.org2012-07-316-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now protoc.exe will be directly invoked. This rolls cacheinvalidation from r218:r219 ------------------------------------------------------------------------ r219 | ghcooper@gmail.com | 2012-07-20 17:44:14 -0700 (Fri, 20 Jul 2012) | 1 line move protos out of v2/; use relative paths for proto imports ------------------------------------------------------------------------ This also rolls gyp from r1440:r1441 ------------------------------------------------------------------------ r1441 | iannucci@chromium.org | 2012-07-26 17:54:17 -0700 (Thu, 26 Jul 2012) | 8 lines Fix bug: non-cygwin actions incorrectly run options through _FixPath. This adds an additional heuristic to the existing one. Now if an option begins with either a '/' OR a '-', it assumes it's not a strict path. Added a TODO which notes that the existing (and new) behavior will miss options such as '--opt=a/posix/path', and '/opt:a/posix/path'. Review URL: https://chromiumcodereview.appspot.com/10829049 ------------------------------------------------------------------------ BUG=123026,113339 R=scottmg@chromium.org,cmp@chromium.org,nsylvain@chromium.org,jar@chromium.org,akalin@chromium.org,maruel@chromium.org TEST= Review URL: https://chromiumcodereview.appspot.com/10796051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149100 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Fix disabling of tests from 149074zea@chromium.org2012-07-301-2/+2
| | | | | | | | | TBR=sergeyu@chromium.org BUG=139726 Review URL: https://chromiumcodereview.appspot.com/10837012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149076 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Disable purge/configuration tests on windowszea@chromium.org2012-07-301-0/+12
| | | | | | | | | | | Failing on buildbots, but not locally/trybots. BUG=139726 TBR=sergeyu@chromium.org Review URL: https://chromiumcodereview.appspot.com/10836021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149074 0039d316-1c4b-4281-b951-d872f2087c98
* Fix leak in JsSyncManagerObserverrlarocque@chromium.org2012-07-301-3/+5
| | | | | | | | | | | This leak was introduced in r148926. BUG=129825,139635 Review URL: https://chromiumcodereview.appspot.com/10821091 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149062 0039d316-1c4b-4281-b951-d872f2087c98
* Reland 148792zea@chromium.org2012-07-3013-331/+185
| | | | | | | | | | | | | | | | Relanding after rebasing. [Sync] Remove CleanupDisabledTypes command and move purge logic into SyncManager." Original codereview at http://codereview.chromium.org/10541079/ BUG=131433, 90868 TBR=tim@chromium.org Review URL: https://chromiumcodereview.appspot.com/10829086 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149052 0039d316-1c4b-4281-b951-d872f2087c98
* Make SyncBackendRegistrar aware of loaded datarlarocque@chromium.org2012-07-3024-138/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a parameter to the SyncManager::Initialize() callback to inform the caller which sync data types were successfully loaded from disk. This allows the SyncBackendHost and related classes make better decisions during initialization. If necessary, the SyncBackendHost will send a configure request to the syncer during early initialization asking it to download the nigori node. Now we can guarantee that the node will be available by the type ProfileSyncService::OnBackendInitialized() is called. The SyncBackendHost test expectations had to be amended to account for this test. Most of the changes are related to the fact that our behaviour no longer depends on the SyncPrefs. The ProfileSyncService*Tests were very much affected by this change. Those tests are parameterized with a callback that is used to initialize the sync DB and pretend that it had been loaded from disk. Previously, this callback would be executed later on during initialization, around the time of ProfileSyncService::OnBackendInitialize(). That approach was incompatible with this change, which requires that we have access to the fully initialized database around the time we return from SyncBackendHost::Initialize(). The callback had to be moved, which meant that it now required an explicit UserShare parameter, which meant that a lot of call sites had to be updated. BUG=129825 TEST= Review URL: https://chromiumcodereview.appspot.com/10804039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148926 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Fix race condition with notification startupakalin@chromium.org2012-07-281-1/+4
| | | | | | | | | | | | | | | This fixes a race condition which may cause notifications to not work on startup. This is a minimal change for ease of merging. Unit tests will be landed in a separate patch. BUG=139424 Review URL: https://chromiumcodereview.appspot.com/10836002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148907 0039d316-1c4b-4281-b951-d872f2087c98
* Correct const accessors in base/values.(h|cc)vabr@chromium.org2012-07-273-3/+3
| | | | | | | | | | | | | For problem description and other info please see the BUG page. This is for DictionaryValue. BUG=138946 TEST=N/A (no fix & no new feature) TBR=jar scottbyer achuith agl mnissler davemoore garykac akalin hans bulach phajdan.jr jamesr Review URL: https://chromiumcodereview.appspot.com/10834004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148833 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 148792 - [Sync] Remove CleanupDisabledTypes command and move purge ↵sergeyu@chromium.org2012-07-2713-204/+333
| | | | | | | | | | | | | | | | | | logic into SyncManager. We were only ever performing a meaningful cleanup on reconfigurations or restart, so we make that explicit by purging from within the SyncManager's loading and configuration methods. BUG=131433, 90868 TEST=manual Review URL: https://chromiumcodereview.appspot.com/10541079 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10823061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148812 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Remove CleanupDisabledTypes command and move purge logic into ↵zea@chromium.org2012-07-2713-333/+204
| | | | | | | | | | | | | | | SyncManager. We were only ever performing a meaningful cleanup on reconfigurations or restart, so we make that explicit by purging from within the SyncManager's loading and configuration methods. BUG=131433, 90868 TEST=manual Review URL: https://chromiumcodereview.appspot.com/10541079 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148792 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor sync-specific parts out of SyncNotifier/SyncNotifierObserverdcheng@chromium.org2012-07-2726-257/+575
| | | | | | | | | | | | | | | | Sort of. SendNotification() is still there. Perhaps we want to split the interfaces completely. BUG=124149 TEST=tests should still pass, no observable behavior change NOTRY=true Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=147801 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=148496 Review URL: https://chromiumcodereview.appspot.com/10702074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148697 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a typo in RealModelTypeToNotificationType.dcheng@chromium.org2012-07-271-1/+1
| | | | | | | | | BUG=139229 TEST=sync_integration_tests should still pass Review URL: https://chromiumcodereview.appspot.com/10825047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148695 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r148496 "Refactor sync-specific parts out of ↵maruel@chromium.org2012-07-2626-575/+257
| | | | | | | | | | | | | | | | | SyncNotifier/SyncNotifierObserver" It broke sync_integration_tests: TwoClientExtensionSettingsAndAppSettingsSyncTest.AppsStartWithSameSettings TwoClientExtensionSettingsAndAppSettingsSyncTest.AppsStartWithDifferentSettings TBR=dcheng@chromium.org BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10823037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148536 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Don't send notifications with no changed typesakalin@chromium.org2012-07-261-0/+5
| | | | | | | | | | | | They would get dropped by the recipients anyway. BUG=138893 TEST= Review URL: https://chromiumcodereview.appspot.com/10830023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148503 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor sync-specific parts out of SyncNotifier/SyncNotifierObserverdcheng@chromium.org2012-07-2626-257/+575
| | | | | | | | | | | | | | Sort of. SendNotification() is still there. Perhaps we want to split the interfaces completely. BUG=124149 TEST=tests should still pass, no observable behavior change NOTRY=true Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=147801 Review URL: https://chromiumcodereview.appspot.com/10702074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148496 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Make P2PNotifier emit a notification only if some enabled types changedakalin@chromium.org2012-07-252-12/+13
| | | | | | | | | | | | | | | | Relaxed some integrations tests that failed because of this. A client with type X disabled shouldn't be expected to quiesce with other clients that with X enabled given a change to X. Cleaned up indentation in preferences integration test. BUG=138893 TEST= Review URL: https://chromiumcodereview.appspot.com/10833004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148379 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Pass the correct set of enabled types to the sync notifierakalin@chromium.org2012-07-242-1/+14
| | | | | | | | | | | | | | | | | | | | | | | This fixes a bug where only the newly-configured types were being passed to the sync notifier to enable. In the common case, there is an empty configuration cycle, which effectively causes notifications to turn off. For now, read the set of enabled types from the registrar and use that. Add unit test expectations to catch the bug above. Move updating of the notification bridge's data types to the sync thread. Also clean up its unit tests a bit. BUG=138595 TEST= Review URL: https://chromiumcodereview.appspot.com/10817023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148188 0039d316-1c4b-4281-b951-d872f2087c98
* Tidy up Android's is-tablet functionality.benm@chromium.org2012-07-242-8/+0
| | | | | | | | | | | | | | | | Remove the code in sync/ that checks if the device is a tablet and perform the check in the chrome/ layer based upon a command line switch. Additionally, rather than looking for a tablet when (not) setting the Mobile specific user agent, look for --use-mobile-user-agent. The embedder should set these command line switches as appropriate, so remove the code that used to set them in the generic process startup. Review URL: https://chromiumcodereview.appspot.com/10808052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148091 0039d316-1c4b-4281-b951-d872f2087c98
* Move ChromeAsyncSocket to jingle/gluesergeyu@chromium.org2012-07-241-0/+1
| | | | | | | | | | | | ChromeAsyncSocket will be reused by chromoting for XMPP connections, moving it to jingle/glue. BUG=137140 Review URL: https://chromiumcodereview.appspot.com/10817013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148028 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r147801 "Refactor sync-specific parts out of ↵maruel@chromium.org2012-07-2226-579/+261
| | | | | | | | | | | | | | | | SyncNotifier/SyncNotifierObserver" This broke sync_integration_tests like it had never been run. Note that sync_integration_tests is not on GateKeeper but redness is still sad. TBR=dcheng@chromium.org BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10806060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147817 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor sync-specific parts out of SyncNotifier/SyncNotifierObserverdcheng@chromium.org2012-07-2126-261/+579
| | | | | | | | | | | Sort of. SendNotification() is still there. Perhaps we want to split the interfaces completely. BUG=124149 TEST=tests should still pass, no observable behavior change Review URL: https://chromiumcodereview.appspot.com/10702074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147801 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Expose change location in GenericChangeProcessor errorszea@chromium.org2012-07-212-0/+5
| | | | | | | | | | BUG=135108 TEST=manual Review URL: https://chromiumcodereview.appspot.com/10803061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147754 0039d316-1c4b-4281-b951-d872f2087c98
* sync: get rid of *ForTest() methods in SyncManagerImpl.tim@chromium.org2012-07-213-79/+64
| | | | | | | | | BUG=117836 TEST=sync_unit_tests Review URL: https://chromiumcodereview.appspot.com/10800043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147751 0039d316-1c4b-4281-b951-d872f2087c98
* mac: Remove code that was only needed on 10.5thakis@chromium.org2012-07-201-25/+1
| | | | | | | | | BUG=137676 TEST=none Review URL: https://chromiumcodereview.appspot.com/10807052 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147738 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Remove unneeded 'using syncer::' lines and 'syncer::' scopingsakalin@chromium.org2012-07-20169-1714/+1564
| | | | | | | | | | | | | | | | | Since (almost) everything in sync/ is now in the 'syncer' namespace, all of these are redundant. Clean up indentation. Put sync_{client,listen_notifications} into syncer namespace. BUG=128060 TEST= Review URL: https://chromiumcodereview.appspot.com/10795018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147675 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove SyncInternaltim@chromium.org2012-07-208-792/+559
| | | | | | | | | | | | | Also removes unnecessary functions (like UpdateCryptographerAndNigori). An additional bonus of removing this is that we can remove the ForTest* functions (previously they depended on SyncInternal behavior which wasn't defined in headers). I already had a patch in the works to remove those, so I'll upload that part separately. This is based off of http://codereview.chromium.org/10701046/ BUG=137740 TEST=sync_unit_tests, unit_test Review URL: https://chromiumcodereview.appspot.com/10810020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147582 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove SyncManager::TestingMode in favour of InternalComponentsFactory.tim@chromium.org2012-07-1922-1734/+2188
| | | | | | | | | | | Turns SyncScheduler into an interface and adds a FakeSyncScheduler class for tests. BUG=117836 TEST= Review URL: https://chromiumcodereview.appspot.com/10701046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147553 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Track validity of about:sync fieldsrlarocque@chromium.org2012-07-192-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way we initialize the fields which get exported to about:sync's about tab. The goal was to pre-declare all the data which would be exported in a complete snapshot, and to track which of these fields were actually set. Unset fields will have a default value and be specially highlighted on about:sync. This commit includes the changes necessary to perform this highlighting. Also in this commit are a few backend changes that are used to determine from sync_ui_util which fields are properly initialized and which fields have been unset by anything other than a default constructor. The signature for ProfileSyncService::QueryDetailedSyncStatus() has been modified to return an additional parameter indicating whether or not the returned status actually came from the backend. The SyncSesionSnapshot takes a different approach. The object is immutable and has two constructors. If it is constructed with the zero-argument constructor it is clearly uninitialized, and will remain so. This change adds a flag which is set or unset based on which constructor is used. Finally, the ConstructAboutInforation function and all its helpers have been moved out of sync_ui_util.cc and into their own file. BUG=134927 TEST= Review URL: https://chromiumcodereview.appspot.com/10696107 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147531 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add sync_export.h (Step 1 for componentizing sync)akalin@chromium.org2012-07-1811-22/+101
| | | | | | | | | | | | | | | | Add SYNC_EXPORT{,_PRIVATE} annotations to stuff in internal_api/public/{base,engine} in the 'sync' target. Add some componentization-related TODOs. Annotate sync-related test executables with SYNC_TEST. BUG=136928 TEST= Review URL: https://chromiumcodereview.appspot.com/10700180 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147325 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Refactor SyncBackendHost unit tests.zea@chromium.org2012-07-183-0/+342
| | | | | | | | | | | | | | We introduce a fake sync manager to let us properly unit test the SyncBackendHost and a bunch of tests verifying Initialize/Configure behavior. BUG=none TEST=self Review URL: https://chromiumcodereview.appspot.com/10790018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147146 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Refactor sync manager into interface.zea@chromium.org2012-07-1713-288/+477
| | | | | | | | | | | | | | | | | | sync_manager.h now defines a pure interface. The actual implementation is in sync_manager_impl.h/cc. In order to support this, we also create a SyncManagerFactory, which allows us to dependency inject a SyncManager implementation into the SyncBackendHost. Follow up patches will make use of this injection, as well as split the SyncManager tests out of syncapi_unittest. R=akalin@chromium.org BUG=133061 TEST= Review URL: https://chromiumcodereview.appspot.com/10704214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147076 0039d316-1c4b-4281-b951-d872f2087c98
* Finish commit 146665: [Sync] Refactor sync configuration logic.zea@chromium.org2012-07-1312-256/+614
| | | | | | | | | | | | | | Only the last patchset (which was a partial diff) was committed.. Original codereview at: https://chromiumcodereview.appspot.com/10780002/ TBR=rlarocque@chromium.org BUG=129665 TEST= Review URL: https://chromiumcodereview.appspot.com/10791002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146677 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 146262 - Revert "Revert 142517 - [Sync] Refactor sync configuration ↵zea@chromium.org2012-07-1312-614/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | logic." Relanding with improved tests and support for cleaning up partial nigori. The original patch was reverted due to users who needed to download a new nigori node, but who had since been migrated. We do not handle migration before the backend is initialized, so we now go ahead and detect+delete partial nigori nodes before redownloading them. By blowing away the old progress marker, we're no longer at risk of receiving the migration done response. In order to test this the SyncBackendHost unit tests have been substantially upgraded. original review at: https://chromiumcodereview.appspot.com/10483015 BUG=129665,133061,133219 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10701085 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10689185 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146501 0039d316-1c4b-4281-b951-d872f2087c98
* Remove syncproto.hrlarocque@chromium.org2012-07-1235-290/+277
| | | | | | | | | | | | | | | | | | | | | | Replace sync/engine/syncproto.h with sync/syncable/syncable_proto_util.h and .cc. The tasks that used to be performed by member functions of the syncer:: proto wrapper classes are now handled by static member functions. Unfortunately, serialization and de-serialization of syncable::Id to/from proto fields has gotten a bit uglier. On the other hand, it's now much less magical and mysterious. The test intended to prevent regressions of crbug.com/134715 has been replaced with a DCHECK. We'll have to rely on it to ensure that the protocol_version field is always explicitly set. BUG=136454 TEST= Review URL: https://chromiumcodereview.appspot.com/10735041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146393 0039d316-1c4b-4281-b951-d872f2087c98
* Switch to TimeDelta interfaces for TestTimeouts in sync code.tedvessenes@gmail.com2012-07-122-3/+2
| | | | | | | | | | | R=akalin@chromium.org BUG=108171 TEST= Review URL: https://chromiumcodereview.appspot.com/10689157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146282 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Revert 142517 - [Sync] Refactor sync configuration logic."zea@chromium.org2012-07-1212-256/+614
| | | | | | | | | | | | | | | | | | | | | Relanding with improved tests and support for cleaning up partial nigori. The original patch was reverted due to users who needed to download a new nigori node, but who had since been migrated. We do not handle migration before the backend is initialized, so we now go ahead and detect+delete partial nigori nodes before redownloading them. By blowing away the old progress marker, we're no longer at risk of receiving the migration done response. In order to test this the SyncBackendHost unit tests have been substantially upgraded. original review at: https://chromiumcodereview.appspot.com/10483015 BUG=129665,133061,133219 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10701085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146262 0039d316-1c4b-4281-b951-d872f2087c98
* Remove #pragma once from syncajwong@chromium.org2012-07-11144-144/+0
| | | | | | Review URL: https://chromiumcodereview.appspot.com/10700154 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146074 0039d316-1c4b-4281-b951-d872f2087c98
* Reland r145993.zea@chromium.org2012-07-113-8/+25
| | | | | | | | | | | | | | | | | | | | Original codereview at http://codereview.chromium.org/10766016/ [Sync] Add location parameter to SyncChange in Sync API. SyncChanges now require the location they were created as a parameter. This is then used in the case that the change violates and invariant. We display the location and type of erroneous change in about:sync, in addition to disabling the offending datatype. TBR=stevet@chromium.org, rlarocque@chromium.org BUG=135108 TEST=unit_tests Review URL: https://chromiumcodereview.appspot.com/10690128 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146050 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 145993 - [Sync] Add location parameter to SyncChange in Sync API.zea@chromium.org2012-07-103-25/+8
| | | | | | | | | | | | | | | | | | | SyncChanges now require the location they were created as a parameter. This is then used in the case that the change violates and invariant. We display the location and type of erroneous change in about:sync, in addition to disabling the offending datatype. TBR=kalman@chromium.org, mnissler@chromium.org, isherman@chromium.org BUG=135108 TEST=unit_tests Review URL: https://chromiumcodereview.appspot.com/10766016 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10698141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145996 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add location parameter to SyncChange in Sync API.zea@chromium.org2012-07-103-8/+25
| | | | | | | | | | | | | | | | SyncChanges now require the location they were created as a parameter. This is then used in the case that the change violates and invariant. We display the location and type of erroneous change in about:sync, in addition to disabling the offending datatype. TBR=kalman@chromium.org, mnissler@chromium.org, isherman@chromium.org BUG=135108 TEST=unit_tests Review URL: https://chromiumcodereview.appspot.com/10766016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145993 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Move ModelType and related classes to 'syncer' namespaceakalin@chromium.org2012-07-03132-1218/+1078
| | | | | | | | | | | | | | Previously they were in 'syncer::syncable'. Also remove aliases to those classes from 'syncable'. BUG=128060 TEST= TBR=pkasting@chromium.org,jhawkins@chromium.org, Review URL: https://chromiumcodereview.appspot.com/10696087 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145399 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Fix and test delete of server-unknown itemsrlarocque@chromium.org2012-07-033-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | The fix we settled on for issue 125381 was to unset the unsynced bit for items which were created and deleted locally, before the server was ever iuformed of their existence. The server doesn't like being notified of deletions to items it never knew existed, as we learned with issue 132905. It turns out that the syncapi was deleting items in a way that bypassed the originally attempted fix for issue 125381 in r137476. This shows that the testing of the original fix was inadequate. This commit fixes the bug and improves testing, with the hope of preventing these bugs from reoccuring in the future. The fix is so subtle that I doubt anything other than lots and lots of tests will be able to prevent regressions. BUG=134934,125381 TEST= Review URL: https://chromiumcodereview.appspot.com/10703060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145380 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add sync_client toolakalin@chromium.org2012-07-034-43/+444
| | | | | | | | | | | | | | | | sync_client is a command-line sync client. Currently, it just downloads the sync data for the given user and listens for new changes. Fix logging in server_connection_manager.cc. Clean up sync_listen_notifications a bit. BUG=135536 TEST= Review URL: https://chromiumcodereview.appspot.com/10704071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145254 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Move MarkForSyncing to mutable_entry.ccrlarocque@chromium.org2012-07-032-10/+10
| | | | | | | | | | | | | | | Prior to this change, the function was declared in mutable_entry.h and defined in syncable_util.cc. This was the result of an error in r143218, which split syncable.cc into several files. This commit fixes the error by moving the defintion of the function. BUG=103332 TEST= Review URL: https://chromiumcodereview.appspot.com/10696083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145252 0039d316-1c4b-4281-b951-d872f2087c98