summaryrefslogtreecommitdiffstats
path: root/sync
Commit message (Collapse)AuthorAgeFilesLines
* [Sync] Move keystore key handling to SyncEncryptionHandlerImplzea@chromium.org2012-08-2926-197/+237
| | | | | | | | | | | | The cryptographer has no notion of keystore keys, and we now persist the keystore key by reusing the OnBoostrapTokenUpdated method (which now takes an enum as an extra param specifying the type of token). BUG=129665 Review URL: https://chromiumcodereview.appspot.com/10878015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154007 0039d316-1c4b-4281-b951-d872f2087c98
* Rename SyncNotifier->Invalidator and SyncNotifierObserver->InvalidationHandler.dcheng@chromium.org2012-08-2831-537/+530
| | | | | | | | | | | | | 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
* Fix sync unit test.qsr@chromium.org2012-08-271-0/+1
| | | | | | | | | | | | | OnDiskSyncableDirectory::FailInitialWrite was using a ScopedTempDir without calling any Create method. TEST=None BUG=144537,144422 R=rlarocque@chromium.org Review URL: https://chromiumcodereview.appspot.com/10873062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153461 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Refactor passphrase state handlingzea@chromium.org2012-08-2617-69/+153
| | | | | | | | | | | | | | We now have an enum describing passphrase state, and cache the current value on the UI thread via a new OnPassphraseStateChanged method. Additionally, we log the OnPassphraseStateChanged event in the debug log info. BUG=139848, 129665 Review URL: https://chromiumcodereview.appspot.com/10824410 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153397 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Refactor GetEncryptedTypes usage.zea@chromium.org2012-08-2430-392/+560
| | | | | | | | | | | | | | | | | | | | | | | | The cryptographer is now owned by the SyncEncryptionHandlerImpl, and no longer needs any connection to the nigori handler or encrypted types. Those are accessed via the directory, which now has a GetNigoriHandler method. Because of this, we can now clean up the thread safety guarantees in the sync encryption handler impl, enforcing that everything except GetEncryptedTypes (and IsUsingExplicitPassphrase, which will be fixed in a followup patch) are invoked on the syncer thread. This lets us not have to open unnecessary transactions. At the chrome layer, encrypted types are accessed via BaseTransaction:: GetEncryptedTypes(). At the syncer layer, they're accessed via directory:: GetNigoriHandler()->GetEncryptedTypes(BaseTransaction* trans const). BUG=142476,139848 Review URL: https://chromiumcodereview.appspot.com/10844005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153335 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Use fakes for SyncNotifier{,Observer} instead of mocksakalin@chromium.org2012-08-2415-273/+450
| | | | | | | | | | | 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-2469-614/+1011
| | | | | | | | | | | | | 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
* Update next_id when loading sync DBrlarocque@chromium.org2012-08-223-50/+158
| | | | | | | | | | | | | | | | | | | | | | | | The directory code is smart enough to maintain a bit of extra slack in the next_id so we don't accidentally reuse IDs if we crash. However, it only works after we've saved changes to the directory at least once. This change ensures that we save changes immediately after we load the directory, so that we can recover from crashes that occur before we would otherwise save changes due to natural causes. This won't do anything to help users who've gotten into a bad state because next_id was corrupted by an early crash, but it will prevent us from corrupting databases in the future. BUG=142987 TEST=See below: Examine 'next_id' in sync DB. Open chrome and close it within two to ten seconds. Verify 'next_id' has been incremented. Review URL: https://chromiumcodereview.appspot.com/10832329 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152706 0039d316-1c4b-4281-b951-d872f2087c98
* Fix Sync.DirectoryOpenResult histogramrlarocque@chromium.org2012-08-211-3/+3
| | | | | | | | | | | This was intended to be a UMA_HISTOGRAM_ENUM. See also r150465. BUG=129825 Review URL: https://chromiumcodereview.appspot.com/10828261 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152633 0039d316-1c4b-4281-b951-d872f2087c98
* Prefix match CHROMEOS_RELEASE_BOARD for checking chromebox.kochi@chromium.org2012-08-161-3/+5
| | | | | | | | | | | | | | It used to conatin only "stumpy", but recently official image contains some suffix, and looks like "stumpy-signed-mp-v2keys". That change caused regression, and this should fix it. BUG=chromium:126732 TEST=Open some tabs on stumpy and sync, then on the other machine you should see "Chromebox" instead of "Chromebook" in "ohter devices" menu in new tab page. Review URL: https://chromiumcodereview.appspot.com/10836257 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151839 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Add SyncEncryptionHandlerzea@chromium.org2012-08-1635-1635/+2496
| | | | | | | | | | | | | | | | | | 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-1523-201/+371
| | | | | | | | | | | | | | | | | | 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
* Fix SyncNotifierRegistrarHelper test in official builds.dcheng@chromium.org2012-08-141-2/+3
| | | | | | | | | | | CHECK() messages get stripped out in official builds. BUG=none Review URL: https://chromiumcodereview.appspot.com/10826290 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151457 0039d316-1c4b-4281-b951-d872f2087c98
* sync: raise initial backoff interval from 1 second to 5 minutes.tim@chromium.org2012-08-135-3/+101
| | | | | | | | | | | | | | | | | | | Long term, we'd like to drop this further (i.e. 1 minute) and trust THROTTLED responses in the event of widespread backend outages. We'd like to run some stress tests of that infrastructure (at scale / under load), but in the meantime we want to address the problem for beta channel users / M22. We chose 5 minutes, which is a little more aggressive than the recommended value, but we believe is safe -- happy to discuss offline. This patch is very low risk (stability wise). although 5 minutes is a long time to wait for users who hit this due to transient failures. Current data suggests 500s occur around 0.02% of the time, and although backoff isn't limited to 500s it's unlikely to get hit frequently, and the user experience doesn't break down significantly. Effectiveness wise, We can run an experiment once it hits dev channel by returning 500s and watching for expected drops in QPS. BUG=139733,142029 Review URL: https://chromiumcodereview.appspot.com/10826194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151216 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Avoid unregistering object IDs on shutdownakalin@chromium.org2012-08-1025-417/+733
| | | | | | | | | | | | | | | | | | | | | | 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-1025-733/+417
| | | | | | | | | | | | | | | | | | | | | | | | 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
* [Sync] Avoid unregistering object IDs on shutdownakalin@chromium.org2012-08-1025-417/+733
| | | | | | | | | | | | | | | | | | | | | 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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150990 0039d316-1c4b-4281-b951-d872f2087c98
* Make java.gypi export jar path to input_jars_paths variablecjhopman@chromium.org2012-08-091-1/+0
| | | | | | | | | | | | | | | | | Both java.gypi and apk_test.gypi expect the jar path in input_jars_paths. This means that we were specifying the dependence in both 'dependencies' and 'input_jars_paths'. This change makes it so that we don't need that redundancy. Also, make java.gypi use input_jars_paths in its input so that we actually rebuild targets when we should. BUG=136756 Review URL: https://chromiumcodereview.appspot.com/10837143 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150850 0039d316-1c4b-4281-b951-d872f2087c98
* Remove SyncManager::Init() return valuerlarocque@chromium.org2012-08-095-8/+7
| | | | | | | | | | | | The return value was almost entirely unusued. Success or failure is reported through a parameter in the asynchronous callback function. BUG=140180 Review URL: https://chromiumcodereview.appspot.com/10826193 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150763 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Rework unit tests for ChromeInvalidationClientakalin@chromium.org2012-08-0913-317/+803
| | | | | | | | | | | | | | | | | In particular, add unit tests that would have caught bug 139424. Dep-inject InvalidationClient into ChromeInvalidationClient. Use the function name 'UpdateRegisteredIds' consistently. Replace some mocks with fakes. BUG=139424 Review URL: https://chromiumcodereview.appspot.com/10827133 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150665 0039d316-1c4b-4281-b951-d872f2087c98
* Fix mem leak in DirectoryBackingStore unit testsrlarocque@chromium.org2012-08-081-1/+2
| | | | | | | | | | | This is a follow-up to r150465. TBR=tim@chromium.org BUG=109668,129825 Review URL: https://chromiumcodereview.appspot.com/10827212 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150490 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Attempt to recover from directory corruptionrlarocque@chromium.org2012-08-088-48/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | Sync when sqlite fails to maintain databsae integrity, most likely due to unexpected shutdowns or flaky storage devices. They can also be corrupted by logic errors in the sync code, though we hope that's a rare occurence. This patch attempts to improve a user's experience in this scenario by transparently deleting the old directory and re-downloading all their data. This will be much better than the old behaviours, which included silently signing a user out of sync, triggering an unrecoverable error, or crashing. To help catch sync logic bugs, debug builds are set to crash when they detect directory corruption. Also included in this patch is a new test. The DirectoryBackingStore.MinorCorruption test exercises the code invoked when the directory is successfully re-created. BUG=109668, 129825 Review URL: https://chromiumcodereview.appspot.com/10821121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150465 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Print out notification state explicitly in about:syncakalin@chromium.org2012-08-073-40/+60
| | | | | | | | | BUG=139430 Review URL: https://chromiumcodereview.appspot.com/10837111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150251 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Address msw's comments for r149747akalin@chromium.org2012-08-048-19/+22
| | | | | | | | | | | See http://codereview.chromium.org/10805002/. BUG=137087 Review URL: https://chromiumcodereview.appspot.com/10828158 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150008 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Set transport_security_state for sync_{client,listen_notifications}akalin@chromium.org2012-08-032-0/+6
| | | | | | | | | | | Currently, the DCHECK added by r148251 fires. BUG= Review URL: https://chromiumcodereview.appspot.com/10830164 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149928 0039d316-1c4b-4281-b951-d872f2087c98
* Correct const accessors in base/values.(h|cc), Part II (ListValue)vabr@chromium.org2012-08-033-9/+9
| | | | | | | | | | | | | | For problem description and other info please see the BUG page. This is for ListValue. BUG=138946 TEST=N/A (no fix & no new feature) TBR=jar,zelidrag,scottbyer,mpcomplete,darin,achuith,sky,estade,atwilson,grt,thakis,jamesr,hans,sadrul,pastarmovj Review URL: https://chromiumcodereview.appspot.com/10837044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149819 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Enable adding notifier observers from ProfileSyncServiceakalin@chromium.org2012-08-0211-43/+170
| | | | | | | | | | | | | | | | Plumb the registrations from the UI thread to the sync thread, and plumb the invalidations back. Add ObjectIdSet <-> ObjectIdPayloadMap conversions. Rename syncapi_unittest.cc to sync_manager_impl_unittest.cc. BUG=137087 TEST= Review URL: https://chromiumcodereview.appspot.com/10805002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149747 0039d316-1c4b-4281-b951-d872f2087c98
* Try to fix a crash in the new sync machine codethakis@chromium.org2012-08-021-3/+26
| | | | | | | | | | | | This adds back the fallback code that was deleted after the 10.6 migration in https://chromiumcodereview.appspot.com/10807052, it's necessary again. BUG=140256,138570 Review URL: https://chromiumcodereview.appspot.com/10824151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149715 0039d316-1c4b-4281-b951-d872f2087c98
* 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