summaryrefslogtreecommitdiffstats
path: root/sync
Commit message (Collapse)AuthorAgeFilesLines
* 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
* sync: Remove GetPossibleLastChildForTest()rlarocque@chromium.org2012-07-032-32/+1
| | | | | | | | | | | | | | | | Remove GetPossibleLastChildForTest(). Its only use was in GetLastChildForTest() to make an informed guess as to which entry was the last one under a given parent. That function will return the same results if we use GetPossibleFirstChild() to initialize our guess. In theory this new approach will be slower, but in practice the change will be imperceptible. BUG=135483 TEST= Review URL: https://chromiumcodereview.appspot.com/10703064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145250 0039d316-1c4b-4281-b951-d872f2087c98
* Improve logging in server_connection_manager.ccakalin@chromium.org2012-07-031-1/+2
| | | | | | | | | | | | Convert enum to string before logging. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10698075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145249 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Move model_type* from syncable/ to base/akalin@chromium.org2012-07-0394-199/+202
| | | | | | | | | | | | | | | | | | | Also move enum_set* to base/. This is the first step in moving ModelType et al. to the syncer namespace (from syncer::syncable). Move PurgeStalePayload() back to sync_session.cc. Move ModelTypePayloadMapFromRoutingInfo() to model_safe_worker.* and rename it to ModelSafeRoutingInfoToPayloadMap(). BUG=128060 TEST= Review URL: https://chromiumcodereview.appspot.com/10690071 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145236 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove unused IdFilter classrlarocque@chromium.org2012-07-032-23/+0
| | | | | | | | | | | | In r145032, we removed all uses of the IdFilter class, but forgot to remove its definition. This commit corrects that error. BUG=134934 TEST= Review URL: https://chromiumcodereview.appspot.com/10702069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145234 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Move sync/{internal_api,syncable} into syncer namespaceakalin@chromium.org2012-07-02107-269/+419
| | | | | | | | | | | | | | Add temporary aliases from syncable::* to syncer::syncable::* for ModelType and related classes until those are ported to syncer proper. Disambiguate names in MockConnectionManager. BUG=128060 TEST= Review URL: https://chromiumcodereview.appspot.com/10699044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145211 0039d316-1c4b-4281-b951-d872f2087c98
* base: Remove dereference structure operator (i.e ->) from ScopedVector.tfarina@chromium.org2012-06-301-5/+5
| | | | | | | | | BUG=128663 R=brettw@chromium.org,willchan@chromium.org Review URL: https://chromiumcodereview.appspot.com/10669038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145073 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Move invariant check logic into Directoryrlarocque@chromium.org2012-06-294-103/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | The goal of this change is to allow runtime changes to the level of invariant checking. This will allow us to write unit tests which better protect us against issue 125381. We failed to prevent issue 134934 in part because our tests against this scenario were not sufficiently strict. In the future, it may allow us to raise the level of checking that we enforce in test code by letting us increase the strictness on a case-by-case basis, thus saving us the trouble of having to fix all our tests at once. Along the way, this change modifies the way the invariant-checking functions are invoked. The end result is a bit simpler, though it does have the side-effect of slightly increasing the strictness of the tests. The CHANGES_ONLY checks will now ensure that all modified entries have valid parents. This level of checking would previously be performed only if the item's parent was also changed. The change also removes the invariant check timeout. BUG=134934 TEST=sync_unit_tests, unit_tests --gtest_filter='*Sync*' Review URL: https://chromiumcodereview.appspot.com/10693041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145032 0039d316-1c4b-4281-b951-d872f2087c98
* Remove syncable::ModelType usage from ChromeInvalidationClientdcheng@chromium.org2012-06-296-117/+134
| | | | | | | | | BUG=124149 TEST=sync_unit_tests Review URL: https://chromiumcodereview.appspot.com/10622002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145026 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Move nigori_util* to sync/syncableakalin@chromium.org2012-06-2924-201/+179
| | | | | | | | | | | | | | | | | | | | | | It's already in the syncable namespace, so syncable/ seems like a better place for it. Move a function from syncer_util.h. to syncable_util.h. Remove pseudo-namespace class SyncerUtil. After this change, everything in sync/engine will be in the syncer namespace. Also clean up some whitespace. BUG=128060 TEST= Review URL: https://chromiumcodereview.appspot.com/10704034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144977 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Rename csync namespace to syncerakalin@chromium.org2012-06-28303-1063/+1059
| | | | | | | | | | | | | | | Everyone was confused by 'csync'. 'syncer' seems more understandable. (Note that we can't use the 'sync' namespace since sync() is a function from unistd.h.) BUG=10662035 TEST= TBR=jhawkins@chromium.org,pkasting@chromium.org Review URL: https://chromiumcodereview.appspot.com/10698014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144820 0039d316-1c4b-4281-b951-d872f2087c98
* Include <iterator>.hbono@chromium.org2012-06-281-0/+1
| | | | | | | | | | This change includes <iterator>, which is needed by std::inserter, to fix build errors on VS2010. BUG=none TEST=fix builds. Review URL: https://chromiumcodereview.appspot.com/10702020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144666 0039d316-1c4b-4281-b951-d872f2087c98
* Convert sync_notifier::RegistrationManager to use object IDs.dcheng@chromium.org2012-06-286-329/+361
| | | | | | | | | | | | | This is part of the continued effort to refactor the sync code out of the invalidation client. BUG=124149 TEST=sync_unit_tests --gtest_filter=RegistrationManagerTest.* Review URL: https://chromiumcodereview.appspot.com/10548063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144660 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Make Login class listen to connection and DNS changesakalin@chromium.org2012-06-282-3/+13
| | | | | | | | | | | | | | | | | | Make sync_listen_notifications listen for network changes. Add a scoped NSAutoreleasePool to sync_listen_notifications. Relax DEPS for sync/tools a bit. BUG=106034 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=144382 Review URL: https://chromiumcodereview.appspot.com/10675012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144622 0039d316-1c4b-4281-b951-d872f2087c98
* Remove unused fields found by clang's new Wunused-private-fields.thakis@chromium.org2012-06-272-3/+1
| | | | | | | | | | | | Test file edition. BUG=none TEST=none TBR=remaining owners Review URL: https://chromiumcodereview.appspot.com/10680013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144464 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 144382 - [Sync] Make Login class listen to connection and DNS changesnkostylev@chromium.org2012-06-272-13/+3
| | | | | | | | | | | | | | | | | | | | | | Reason: http://build.chromium.org/p/chromium/builders/Mac10.6%20Sync/builds/19046 Make sync_listen_notifications listen for network changes. Add a scoped NSAutoreleasePool to sync_listen_notifications. Relax DEPS for sync/tools a bit. BUG=106034 TEST= Review URL: https://chromiumcodereview.appspot.com/10675012 TBR=akalin@chromium.org Review URL: https://chromiumcodereview.appspot.com/10690007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144439 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Put everything in sync/api into csync namespaceakalin@chromium.org2012-06-2718-4/+72
| | | | | | | | | | BUG=128060 TEST= TBR=pkasting@chromium.org Review URL: https://chromiumcodereview.appspot.com/10662035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144385 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Make Login class listen to connection and DNS changesakalin@chromium.org2012-06-272-3/+13
| | | | | | | | | | | | | | | | Make sync_listen_notifications listen for network changes. Add a scoped NSAutoreleasePool to sync_listen_notifications. Relax DEPS for sync/tools a bit. BUG=106034 TEST= Review URL: https://chromiumcodereview.appspot.com/10675012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144382 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Set explicit protocol_version on commitrlarocque@chromium.org2012-06-272-0/+4
| | | | | | | | | | | | | | The use of Message::Clear() function in commit.cc was unsetting this field. This change explicitly sets the field to the current default value following the Clear(). It also adds a test assertion to verify that the field is properly set. BUG=134769,134715 TEST=Run against the test server and verify the field is in the logs. Review URL: https://chromiumcodereview.appspot.com/10679010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144339 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Create sync entry factory class for testsrlarocque@chromium.org2012-06-265-244/+334
| | | | | | | | | | | | | | | | | Move some of the helper functions embedded in ApplyUpdatesCommandUnittest into a separate class. This will make it easier to reuse this code in other test cases. This CL is a prerequisite for some upcoming changes that move Nigori update application out of ApplyUpdatesCommand. BUG=111297 TEST= Review URL: https://chromiumcodereview.appspot.com/10658006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144326 0039d316-1c4b-4281-b951-d872f2087c98
* Use base::ThreadChecker as a member var, rather than base::NonThreadSafersleevi@chromium.org2012-06-252-15/+15
| | | | | | | | | | BUG=123295 TEST=existing Review URL: https://chromiumcodereview.appspot.com/10663016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144011 0039d316-1c4b-4281-b951-d872f2087c98
* sync: inject DirectoryBackingStore to Directory and remove ↵tim@chromium.org2012-06-226-113/+100
| | | | | | | | | | | | | | "OpenInMemoryForTest" method from production code. This resulted in consolidated some SyncManager::TestingMode code to the Init code path from OpenDirectory. This is a step towards removing TestingMode in favor of some SyncManager init factories. See bug 117836 BUG=117836 TEST=sync_unit_tests Review URL: https://chromiumcodereview.appspot.com/10641025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143688 0039d316-1c4b-4281-b951-d872f2087c98
* More fixes to address missing symbols when building unit-tests on Android.jcivelli@chromium.org2012-06-221-2/+2
| | | | | | | | | | BUG=None TEST=None Review URL: https://chromiumcodereview.appspot.com/10641007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143685 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Refactor session tracking rlarocque@chromium.org2012-06-2229-477/+255
| | | | | | | | | | | | | | | | | | | | | | | This change refactors the related structs ErrorCounters, SyncerStatus, and SyncCycleControlParameters. Their values have all been merged into AllModelTypeState, which has been renamed to ModelNeutralState. All the functions which depend on this data have been updated to use the new struct. This change also removes the DirtyOnWrite template class, the is_dirty flag, and the SyncerCommand logic to send change events if it detects a change in the syncer's status. The changes are so frequent and predictable that it's easier to just send the snapshots manually after any major syncer steps. Finally, this change removes the 'invalid_store' status member, which was never set nor read outside of unit tests. BUG=132630 TEST= Review URL: https://chromiumcodereview.appspot.com/10636010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143675 0039d316-1c4b-4281-b951-d872f2087c98
* Removes reference counting of syncable::Directory::Kernelrlarocque@chromium.org2012-06-222-22/+2
| | | | | | | | | | | No longer required, syncable::Directory is responsible now for deleting the dir kernel BUG=119360 Review URL: https://chromiumcodereview.appspot.com/10540089 Patch from Sergio Carlos Morales Angeles <carloschilazo@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143610 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Move HttpBridge to sync/akalin@chromium.org2012-06-2216-34/+971
| | | | | | | | | | | | | | Remove all references to content in HttpBridge. Clean up handling of HTTP user agent in HttpBridge. BUG=133791 TEST= Review URL: https://chromiumcodereview.appspot.com/10645004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143575 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Rename sync_api to csyncakalin@chromium.org2012-06-2256-295/+292
| | | | | | | | | | BUG=128060 TEST= Review URL: https://chromiumcodereview.appspot.com/10601002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143557 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Rename browser_sync to csync in sync/akalin@chromium.org2012-06-21241-703/+708
| | | | | | | | | | | | | | | Update all references from chrome. Leave possibly-extraneous csync:: qualifications in sync/ for now. (This will be cleaned up once everything in sync/ is in csync::.) BUG=128060 TEST= TBR=jhawkins@chromium.org Review URL: https://chromiumcodereview.appspot.com/10600002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143449 0039d316-1c4b-4281-b951-d872f2087c98
* Convert InvalidationStateTracker to use invalidation::ObjectId instead of ↵dcheng@chromium.org2012-06-209-42/+66
| | | | | | | | | | | syncable::ModelType BUG=124145,124149 TEST=unit tests Review URL: https://chromiumcodereview.appspot.com/10545168 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143249 0039d316-1c4b-4281-b951-d872f2087c98
* Split syncable.{h,cc} into several filesrlarocque@chromium.org2012-06-2079-1967/+2243
| | | | | | | | | | | | | | | | The only functional change was to remove the dirkernel_ member from BaseTransaction, which was to reduce the number of includes required. Everything else is just moving code around, and updating includes, forward declarations, and 'using' statements. BUG=103332 TEST= Review URL: https://chromiumcodereview.appspot.com/10579036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143218 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Rename sync_notifier namespace to csyncakalin@chromium.org2012-06-2040-108/+108
| | | | | | | | | | | | There's already a function in the global namespace named 'sync', so we can't use it as a namespace name. :( BUG=128060 TEST= Review URL: https://chromiumcodereview.appspot.com/10581019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143124 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove ClearUserData command.tim@chromium.org2012-06-2026-396/+15
| | | | | | | | | BUG=131336 TEST=none Review URL: https://chromiumcodereview.appspot.com/10584019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143088 0039d316-1c4b-4281-b951-d872f2087c98
* Remove hard_dependency=1 from cacheinvalidation targetakalin@chromium.org2012-06-181-5/+4
| | | | | | | | | | | | | | | | | Since cacheinvalidation headers avoid including proto headers, we can do this. Add explicit dependencies on cacheinvalidation_proto_cpp from the targets that still depend on it. (See http://code.google.com/p/gyp/issues/detail?id=215 for reference.) BUG=79848 TEST= Review URL: https://chromiumcodereview.appspot.com/10577003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142843 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142517 - [Sync] Refactor sync configuration logic.zea@chromium.org2012-06-189-504/+228
| | | | | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10583002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142814 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Propagate XMPP auth errors to SyncNotifierObserversakalin@chromium.org2012-06-1825-132/+466
| | | | | | | | | | | | | | | | | | | | | | | | Detect XMPP auth errors and add new notifications to SingleLoginAttempt and Login. Replace PushClientObserver::OnNotificationStateChange with OnNotifications{Enabled,Disabled} notifications. Change SyncNotifierObserver similarly. Handle InvalidationClient errors and propagate auth errors from that, too. Propagate XMPP auth errors all the way up to SyncManager. It will be handled in a future CL. BUG=38091 TEST= Review URL: https://chromiumcodereview.appspot.com/10545170 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142806 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142794 - Revert 142517 - [Sync] Refactor sync configuration logic.kkania@chromium.org2012-06-188-213/+481
| | | | | | | | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10536194 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10581005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142798 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142517 - [Sync] Refactor sync configuration logic.zea@chromium.org2012-06-188-481/+213
| | | | | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 TBR=zea@chromium.org Review URL: https://chromiumcodereview.appspot.com/10536194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142794 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 142563 - Handle sync database corruption with re-downloadzea@chromium.org2012-06-182-17/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent change allowed us to handle a missing sync database by creating a new directory and repopulating it by requesting an initial sync from the server. This commit builds on that work by intentionally deleting the sync database if it is found to be corrupt or unusable. The client will then recognize that the database is empty and repopulate it, just as it would had the directory not existed in the first place. BUG=109668 TEST=Manual. Three cases, see below: - Delete 'Sync Data/SyncData.sqlite3' from the profile directory. Start chromium and observe that all data is redownloaded from the server. - Corrupt an existing sync directory. The SQL command 'DELETE FROM metas WHERE metahandle = 1' should be sufficient. Start chromium and observe that the directory is deleted then recreated and all data is redownloaded from the server. - Ensure that no directory can be created. You could do this by marking the 'Sync Data' folder as read-only. Start chrome, and observe that sync is unusable, but the browser still works. NOTE: This only works in release builds, debug builds will DCHECK. It's debatable whether or not this scenario is worth testing. Review URL: https://chromiumcodereview.appspot.com/10554016 TBR=rlarocque@chromium.org Review URL: https://chromiumcodereview.appspot.com/10578003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142793 0039d316-1c4b-4281-b951-d872f2087c98
* sync: move internal_api components used by chrome/browser into ↵tim@chromium.org2012-06-1769-160/+171
| | | | | | | | | | | | | | internal_api/public TBR=jhawkins@chromium.org BUG=131130 TEST= Review URL: https://chromiumcodereview.appspot.com/10534080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142626 0039d316-1c4b-4281-b951-d872f2087c98
* Handle sync database corruption with re-downloadrlarocque@chromium.org2012-06-162-25/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recent change allowed us to handle a missing sync database by creating a new directory and repopulating it by requesting an initial sync from the server. This commit builds on that work by intentionally deleting the sync database if it is found to be corrupt or unusable. The client will then recognize that the database is empty and repopulate it, just as it would had the directory not existed in the first place. BUG=109668 TEST=Manual. Three cases, see below: - Delete 'Sync Data/SyncData.sqlite3' from the profile directory. Start chromium and observe that all data is redownloaded from the server. - Corrupt an existing sync directory. The SQL command 'DELETE FROM metas WHERE metahandle = 1' should be sufficient. Start chromium and observe that the directory is deleted then recreated and all data is redownloaded from the server. - Ensure that no directory can be created. You could do this by marking the 'Sync Data' folder as read-only. Start chrome, and observe that sync is unusable, but the browser still works. NOTE: This only works in release builds, debug builds will DCHECK. It's debatable whether or not this scenario is worth testing. Review URL: https://chromiumcodereview.appspot.com/10554016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142563 0039d316-1c4b-4281-b951-d872f2087c98
* Replace GetIOMessageLoopProxy() with GetNetworkTaskRunner() in ↵sergeyu@chromium.org2012-06-162-37/+39
| | | | | | | | | | | | UrlRequestContextGetter. Also updated all code that depends on that methods. TBR=mnissler@chromium.org Review URL: https://chromiumcodereview.appspot.com/10539148 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142560 0039d316-1c4b-4281-b951-d872f2087c98
* Protect against sync entries left by old clientsrlarocque@chromium.org2012-06-163-4/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old clients would sometimes end up with items that were deleted before their existence was ever reported to the server. For a while, we let these entries accumulate in the database, and just filtered them out of the list of items to commit when we created that list in GetCommitIds. Then we learned that a subset of these entries could be deleted in such a manner that they would be detected as database corruption. The client was udpated so it would delete these entries in a timely manner. The filter in GetCommitIds was removed. See crbug.com/125381 for details. It turns out that a lot of clients have some deleted local items in their sync database created by older clients. When they update to the new client which doesn't have the GetCommitIds filter, they will try to commit the local tombstones. This is bad. This commit addresses the problem in two ways: 1. Drop any server-unknown deleted items when we open the database. 2. As a fallback, put the filter back into GetCommitIds. The filter should not be required, so it will trigger a NOTREACHED() if it is executed. BUG=132905,125381 TEST=SyncableDirectoryTest.OldClientLeftUnsyncedDeletedLocalItem Review URL: https://chromiumcodereview.appspot.com/10559018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142555 0039d316-1c4b-4281-b951-d872f2087c98
* [Sync] Refactor sync configuration logic.zea@chromium.org2012-06-159-228/+504
| | | | | | | | | | | | | | | | | | | We remove all the pending download/configure state in SBH, in addition to the split transaction nature of configurations themselves. This allows us to have a single SyncScheduler::ScheduleConfiguration command that is both synchronous (assuming it doesn't fail) and can handle CleanupDisabledTypes and GetKey commands. This also now keys which datatypes need downloading by checking the initial sync ended bits directly. This allows us to recover from a new sync db gracefully. BUG=129665,133061,129825 TEST=unit/integration tests Review URL: https://chromiumcodereview.appspot.com/10483015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142517 0039d316-1c4b-4281-b951-d872f2087c98