summaryrefslogtreecommitdiffstats
path: root/sync
Commit message (Collapse)AuthorAgeFilesLines
* Add an HTML page to the Sync test server to trigger synced notificationspvalenzuela@chromium.org2013-12-063-46/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This change also fixes a bug where AddSyncedNotification returned a binary-encoded string instead of ASCII. Directions for triggering synced notifications in test server (Linux): 1) Build and run the test server: ninja -C out/Debug run_sync_testserver out/Debug/run_sync_testserver --port=1337 2) Run the browser against the test server: google-chrome --enable-logging --enable-synced-notifications \ --sync-url=http://127.0.0.1:1337/chromiumsync 3) Go to browser settings. If you are already signed in, click "Set up sync..." and hit OK on the subsequent dialog. Otherwise, sign in and complete Sync setup. 4) Navigate to http://127.0.0.1:1337/syncednotifications and follow the directions on the page. BUG=248332 Review URL: https://codereview.chromium.org/100053007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239159 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Per-type update applicationrlarocque@chromium.org2013-12-0434-1367/+833
| | | | | | | | | | | | | | | | | | | | | | | | | This change moves the update application functionality from the ApplyUpdatesAndResolveConflictsCommand into the SyncDirectoryUpdateHandler class. This change will allow us to implement update application differently for different types. Because update application happens on the model threads, the ApplyUpdatesAndResolveConflictsCommand had to be aware of ModelSafeRoutingInfo, ModelSafeWorkers, and other concepts intended to hide threading details. The new code takes a different approach. It hides the threading details specific to each type inside its SyncDirectoryUpateHandler by initializing it with a scoped_refptr to its associated ModelSafeWorker. The ApplyUpdatesAndResolveConflictsCommand was the last SyncerCommand. With its removal, we can also remove the definitions of SyncerCommand, ModelChangingSyncerCommand and SyncerCommandTest. BUG=278484 Review URL: https://codereview.chromium.org/72403003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238532 0039d316-1c4b-4281-b951-d872f2087c98
* Move RemoveChars, ReplaceChars, TrimString, and TruncateUTF8ToByteSize to ↵brettw@chromium.org2013-12-032-2/+2
| | | | | | | | | | | base namespace. BUG= R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/102843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238465 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 238348 "Clean up TestProfileSyncService and related tests"dubroy@chromium.org2013-12-035-52/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL appeared to be the cause of a link failure on Win dbg: http://goo.gl/PTFpFF > Clean up TestProfileSyncService and related tests > > This CL refactors many of the tests in profile_sync_service_unittest.cc. > It continues the refactoring work begun in r233533, r235661, and > r235854. > > The JsController tests have been deleted. There is not much point in > testing the JsController here; it can be more easily tested on its own > in sync_js_controller_uniittest.cc. The SyncJsController unit tests > have been updated so they now cover the few cases that were formerly > only exercised in the ProfileSyncService unit tests. > > It converts all remaining uncoverted tests from relying on the > TestProfileSyncService to using a real ProfileSyncService with an > injected backend. The injected backend makes it easier to create the > scenarios we want to test. We can inject a specially crafted SBH rather > than fiddling with "synchronous init" and "fail initial download" flags. > > Since the TestProfileSyncService no longer needs to support the wide > variety of test scenarios required by the tests in > profile_sync_service_unittest.cc, we can greatly simplify its > implementation. Many of its parameters and associated code have been > removed. > > BUG=140354,312994 > > Review URL: https://codereview.chromium.org/67683005 TBR=rlarocque@chromium.org Review URL: https://codereview.chromium.org/98323003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238368 0039d316-1c4b-4281-b951-d872f2087c98
* Clean up TestProfileSyncService and related testsrlarocque@chromium.org2013-12-035-44/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL refactors many of the tests in profile_sync_service_unittest.cc. It continues the refactoring work begun in r233533, r235661, and r235854. The JsController tests have been deleted. There is not much point in testing the JsController here; it can be more easily tested on its own in sync_js_controller_uniittest.cc. The SyncJsController unit tests have been updated so they now cover the few cases that were formerly only exercised in the ProfileSyncService unit tests. It converts all remaining uncoverted tests from relying on the TestProfileSyncService to using a real ProfileSyncService with an injected backend. The injected backend makes it easier to create the scenarios we want to test. We can inject a specially crafted SBH rather than fiddling with "synchronous init" and "fail initial download" flags. Since the TestProfileSyncService no longer needs to support the wide variety of test scenarios required by the tests in profile_sync_service_unittest.cc, we can greatly simplify its implementation. Many of its parameters and associated code have been removed. BUG=140354,312994 Review URL: https://codereview.chromium.org/67683005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238348 0039d316-1c4b-4281-b951-d872f2087c98
* Implement new invalidations ack tracking systemrlarocque@chromium.org2013-11-2648-1682/+912
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the new invalidation ack tracking API. This system allows the invalidations system to remember invalidations that have not been acted upon yet across browser restarts. New features include: - Supports saving multiple invalidation payloads per ObjectID. - Supports tracking lost or dropped invalidations. - Remembers "unknown version" invalidations across restarts. - Can send multiple payloads in a single callback. - Does not periodically ping unacked invalidations. A series of commits prior to this one have put much of the framework in place already. This CL does not change the types and signatures of client-facing APIs very much, but it does enable perviously disbaled behavior. This CL includes updates to the client code to allow them to support the new semantics with (hopefully) few changes to externally visible behavior. Most of the big changes are in the classes and tests associated with the internals of Invalidations. Large parts of the SyncInvalidationListener and InvalidatorStorage have been rewritten. BUG=233437 Review URL: https://codereview.chromium.org/56113003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237421 0039d316-1c4b-4281-b951-d872f2087c98
* Send debug event info on Commit requests, not just GetUpdates requests.maniscalco@chromium.org2013-11-232-13/+109
| | | | | | | | BUG=318439 Review URL: https://codereview.chromium.org/82303002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236914 0039d316-1c4b-4281-b951-d872f2087c98
* Attempt to fix Invalidations client name crashrlarocque@chromium.org2013-11-227-29/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first attempt at setting consistent invalidator IDs, r234524, has turned out to be a failure. It was based on the assumption that the InvalidationController was the only object that would start the InvalidationService. That assumption was wrong. This CL takes a new approach. Rather than having the InvalidationController manage the ID and send it to the InvalidationService, we now managed it in the InvalidationClientNameProvider class, which is avialable to both the InvalidationController and InvalidationService. This allows both classes to synchronously request a client name as they need it. The InvalidationClientNameProvider is, by default, backed by an InvalidationClientNameGenerator that provides it with fully random IDs. This is not ideal, but it's better than the other alternatives. Once this change is fully implemented, the downstream code will invoke UniqueIdInvalidationClientNameGenerator.doInitializeAndInstallGenerator() during early init. This will initialize a UniqueIdInvalidationClientNameGenerator with a UuuidBasedUniqueIdentificationGenerator that will provide a consistent identifier across restarts, and inject this InvalidationClientNameGenerator into the InvalidationClientNameProvider. BUG=320873 Review URL: https://codereview.chromium.org/77243002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236681 0039d316-1c4b-4281-b951-d872f2087c98
* Add the ability to trigger synced notifications in the Sync test server.pvalenzuela@chromium.org2013-11-212-1/+191
| | | | | | | | | | | This CL also adds the option of changing the ClientCommand sent back to the client in order to modify the commit delay for sessions. After this change is submitted, a frontend will be added to allow easy triggering of canned notifications. Review URL: https://codereview.chromium.org/70933002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236619 0039d316-1c4b-4281-b951-d872f2087c98
* Don't clear debug info until after it has been sent to the server.maniscalco@chromium.org2013-11-2117-103/+219
| | | | | | | | | | | | Replaced DebugInfoGetter::GetAndClearDebugInfo with GetDebugInfo and ClearDebugInfo so we can clear the debug info only after we have successfully sent it to the server. Moved MockDebugInfoGetter into its own file so it can be used by other tests. BUG=319937 Review URL: https://codereview.chromium.org/61213009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236591 0039d316-1c4b-4281-b951-d872f2087c98
* Avoid SEGFAULT when scheduler is stopped as part of sync cycle.pavely@chromium.org2013-11-202-1/+38
| | | | | | | | | | | | Sync cycle might receive response from server that causes scheduler to stop and draws pending_configure_params_ invalid. Check started_ before dereferencing pending_configure_params_ to avoid SEGFAULT. BUG=320738 Review URL: https://codereview.chromium.org/62263003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236138 0039d316-1c4b-4281-b951-d872f2087c98
* Introduce AppListSyncableService, owns AppListModel and builderstevenjb@chromium.org2013-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | This introduces AppListSyncableService, but does not implement any syncing yet. The purpose is to move ownership of AppListModel so that we can maintain and sync the model state independent of the view. It also made sense to move ExtensionAppModelBuilder ownership to AppListSyncableService. This required a fair bit of (smallish) re-factoring. Here is a simplified diagram that may help: https://docs.google.com/a/google.com/drawings/d/1NgaQzdqddTh1W7altZ6P6t4dNxZDRO0e_HgJqa8V36A/edit BUG=315887 For minor ash/shell/ changes: R=jennyz@chromium.org, tapted@chromium.org, xiyuan@chromium.org TBR=jamescook@chromium.org Review URL: https://codereview.chromium.org/66023003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236020 0039d316-1c4b-4281-b951-d872f2087c98
* ProfileSyncServiceTest refactoringpavely@chromium.org2013-11-181-5/+33
| | | | | | | | | | | | | | | | | | | | | | Move following tests: TestStartupWithOldSyncData FailToOpenDatabase FailToDownloadControlTypes Remove redundant parameters from StartSyncServiceAndSetInitialSyncEnded and remove StartSyncService function. TestStartupWithOldSyncData goes to SyncBackendHost tests. It verifies that SyncBackendHost cleans Sync Data directory before initialization. FailToOpenDatabase goes to SyncManagerImpl test. It verifies that if SyncManager fails to open database it reports initialization failure. FailToDownloadControlTypes is already covered by SyncBackendHostTest.SilentlyFailToDownloadControlTypes BUG=312994 Review URL: https://codereview.chromium.org/68483005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235854 0039d316-1c4b-4281-b951-d872f2087c98
* Channel all low lever scheduling calls through single functionpavely@chromium.org2013-11-182-28/+48
| | | | | | | | | | | | | | | | | | | The idea of this change is to only call Do***SyncSessionJob from single function TryJob and have all other functions in class call it. The hope is that maybe someday we'll call it asynchronously. Previously it would look like this: http://www.plantuml.com/plantuml/svg/ZP5HJiCm38RVSue-0jAkW0JRa8OGJCquGDQuRKPg5pUTbjkJfXfQrzBnvlZ_REUtfLFiaiLZygGFRUEsPAt1GWYPbQ1R2s-KAVlUwWAIHQ3EwPZPLBKTWYda34sPmdSBZRjHiS6ZiaOhPmZd9eXHAe9Ru9ouMe5L7dJKnC14JuLuPohWfR9shx8lyOckP7BEzlDsx9SA5VjNselrgIO4T4RPvy1IdgVWs8_13vJ0nz2L427h7AoPYL_C2VIO5fUlAAyeLEQcQ3dQbnup2KqJmewVmAE_srXdzueIiZ_ntsry3LTBcGOdDZv3_vvjuFGVxiNePZFcPbl5khk7Up7vmmjrtFai_W00 Now it will look like this: http://www.plantuml.com/plantuml/svg/XP5HJiGW48RVEKKVrMIlOAAxQxB6wARK0x1bsg9Jg5FOBBUNqbHRsTGtcE-3uH-u5MIppNts83zSRuy6KUcQCLus81t2Yoa5lZfPGxO9rbIEbKFRuLBCeIBecno-7FJsdnC7VHQefB3AwBKEB2b5yGXK6MftWCA3Z8mjGenMM1Ug1TeAn9CeFzcxjWqPQt7iLv3V2Yt8FviJsryweq5R9V0nkAQgSh3aK_5DSw1pkDLe3UMGO4zaw4bTGAOsc-ycF83Yjx8puQvArOxYGBZN9OU-3yj4Z5dNX27q7yxu-D6pthw3T1O3kJBPEVxvZyM35qOozGLTZHhDcxjRTZNdZAOX9_WD The change should be roughly equivalent to today's behavior. BUG=259913 Review URL: https://codereview.chromium.org/68013007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235814 0039d316-1c4b-4281-b951-d872f2087c98
* Remove SyncSchedulerImpl::OnShouldStopSyncingPermanentlypavely@chromium.org2013-11-1810-34/+0
| | | | | | | | Nobody calls it anyway. Review URL: https://codereview.chromium.org/73623003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235696 0039d316-1c4b-4281-b951-d872f2087c98
* Set DebugInfoEventListener's kMaxEntries to ModelType::MODEL_TYPE_COUNT to ↵maniscalco@chromium.org2013-11-181-2/+4
| | | | | | | | | | ensure we don't lose debug info. BUG=319463 Review URL: https://codereview.chromium.org/68893022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235654 0039d316-1c4b-4281-b951-d872f2087c98
* Pass retry_task to SyncScheduler::ScheduleConfigurationpavely@chromium.org2013-11-178-99/+106
| | | | | | | | | | | | | | | | Pass retry_task through ConfigurationParams to SyncScheduler::ScheduleConfiguration. We might in the future do configuration asynchronously and passing retry_task through asynchronous calls will be handy. SyncManagerTestWithMockScheduler.ConfigurationRetry is no longer needed, SyncSchedulerTest.ConfigWithBackingOff tests this functionality. BUG=259913 Review URL: https://codereview.chromium.org/62283011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235541 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove test dependencies on SyncerCommandrlarocque@chromium.org2013-11-1510-180/+341
| | | | | | | | | | | | | | | | | | | | | | | Refactor the ApplyControlDataUpdates and Download unit tests to no longer depend on SyncerCommand and related concepts, including ModelSafeRoutingInfo, SyncSession, and SyncSessionContext. The refactoring required rewriting some non-test code to expose new or different signatures. These changes should have no effect on non-test behavior. This CL also removes a useless field from the StatusController. Removing that field made the refactoring of download.cc a bit easier. These changes prepare for a refactoring that will remove ModelChangingSyncerCommand. This is one more step on the path to hiding threading details from the sync engine. BUG=278484 Review URL: https://codereview.chromium.org/53763002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235401 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Deprecate old UniquePosition formatrlarocque@chromium.org2013-11-153-49/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop support for legacy UniquePosition encoding. Some old clients (M28 and M29) only understand the uncompressed and gzip encodings of UniquePositions. To maintain compatibility with them, clients that supported the newer and better custom compression algorithm (M30 and above) wrote protobufs that contained both the old and new encodings. Maintaining backwards compatibility in this way is expensive. It's not a big deal for clients that have a reasonable number of bookmarks, but for the few users that have thousands of them this could be a real problem. Since those old clients are now much rarer, it should be safe to no longer write the extra encoding just for them. If any of those older clients do come across protobufs that are newer than what they support, they will fail to apply the position updates. In other words, bookmarks modified on newer clients will have randomly assigned positions on older clients. Those older clients will also run over a NOTREACHED(), but I don't think this will do any harm in practice. BUG=260394 Review URL: https://codereview.chromium.org/68533007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235380 0039d316-1c4b-4281-b951-d872f2087c98
* Remove linux coverage scripts.thakis@chromium.org2013-11-141-14/+0
| | | | | | | | | BUG=318423 TBR=owners Review URL: https://codereview.chromium.org/68193002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235208 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Limit DirectoryBackingStore database cache size.feng@chromium.org2013-11-131-0/+2
| | | | | | | | | | | SQLite allocates more than 1MB cache for the DB. We should limit the cache size to a few hundred KBs like other tables. BUG=280909 Review URL: https://codereview.chromium.org/66413006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234900 0039d316-1c4b-4281-b951-d872f2087c98
* Rename stale SyncContentResolverWrapper occurrences to ↵cimamoglu@chromium.org2013-11-132-25/+25
| | | | | | | | | | SyncContentResolverDelegate. The relevant CL where renaming was done: https://chromiumcodereview.appspot.com/11929040/ Review URL: https://codereview.chromium.org/59883009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234816 0039d316-1c4b-4281-b951-d872f2087c98
* Android: moves sync to use long for JNIbulach@chromium.org2013-11-131-0/+1
| | | | | | | | BUG=317523 Review URL: https://codereview.chromium.org/63623003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234804 0039d316-1c4b-4281-b951-d872f2087c98
* Support for shared invalidator client IDsrlarocque@chromium.org2013-11-123-42/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allow the Java side of the Andorid invalidations implementation to share its client ID with its associated C++ classes. The InvalidationController class will prefer to use an ID from a provided UniqueIdentificationGeneratorFactory. This ID would have the advantage of persisting across restarts, which is necessary to ensure effective reflection blocking. If the UniqueIdentificationGeneratorFactory has not been provided, as may be the case in tests, the InvalidationController will generate its own temporary ID. This will effectievely disable reflection blocking, but it's better than returning a consistent ID (since that would risk blocking notifications that we actually need). This randomly generated ID is not much different from the randomly generated ID created by the InvalidationService prior to this CL. At the time of this writing, the code to set up the UniqueIDGeneratorFactory is not in place. This will be added in a later commit. Until then, reflection blocking will remain broken. BUG=172391 Review URL: https://codereview.chromium.org/54923003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234524 0039d316-1c4b-4281-b951-d872f2087c98
* Fix one case that can make sync backend stuck in auth error state.haitaol@chromium.org2013-11-081-1/+13
| | | | | | | | | | | | | | In case like server outage/bug, sync backend can receive same invalid token in a row and stay in auth error state without frontend knowing it. This change makes backend report auth error again if this happens. Frontend will request token again but also use exponetial backoff to protect againest hammering token server too often. BUG=311420 Review URL: https://codereview.chromium.org/62423002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233938 0039d316-1c4b-4281-b951-d872f2087c98
* sync: treat gaia http 500s as retriable.tim@chromium.org2013-11-081-0/+2
| | | | | | | | | | Both OAuth2TokenService and ProfileSyncService will now retry on HTTP 500s. Note that ProfileSyncService retries will only kick in if OA2TS gives up after a fixed number of attempts. BUG=311420 Review URL: https://codereview.chromium.org/61833003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233908 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 231221 - "Remove enabled/disabled state from extension and app sync."yoz@chromium.org2013-11-081-5/+0
| | | | | | | | | | | Some differences to account for ExtensionService's sync handling moving to ExtensionSyncService. BUG=303311,316368 TBR=zea@chromium.org Review URL: https://codereview.chromium.org/65983002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233885 0039d316-1c4b-4281-b951-d872f2087c98
* Reveal information about sync server connection and token on about tab.haitaol@chromium.org2013-11-071-0/+1
| | | | | | | | | | | | | The information includes server connection status, token request/response time, error message and next scheduled request time if in exponential backoff state. BUG=309103,311414 NOTRY=true Review URL: https://codereview.chromium.org/60703002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233665 0039d316-1c4b-4281-b951-d872f2087c98
* Fix sync_client to work with oauth2 tokens.pavely@chromium.org2013-11-061-0/+1
| | | | | | | | | When initializing invalidator pass parameter that says that token is OAuth2 access token. Review URL: https://codereview.chromium.org/54353005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233289 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Serve fake OAuth2 tokens from python sync serverrsimha@chromium.org2013-11-062-4/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds a new handler to the python sync server so it can serve fake OAuth2 tokens to chrome. It is meant to be used for manual testing with the python sync server, using the workflow described below: - Build the "run_sync_testserver" target. - Run the python sync server: "out/Debug/run_sync_testserver --port=8010" - Launch chrome, sign in, and set up sync - Re-launch chrome with "--lso-url=http://127.0.0.1:8010" Chrome will now fetch OAuth2 tokens from the fake gaia server. You may change the fake OAuth2 token returned by the python sync server on the fly via the setfakeoauth2token handler like so: http://127.0.0.1:8010/setfakeoauth2token?response_code=200&expires_in=2400&request_token=rt&access_token=at&token_type=Bearer You may skip or include any of the query params. Params that are skipped will remain unchanged. BUG=none TEST=Build and run the "run_sync_testserver" target. Test the /o/oauth2/token and /setfakeoauth2token handlers. R=pavely@chromium.org Review URL: https://codereview.chromium.org/58093002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233271 0039d316-1c4b-4281-b951-d872f2087c98
* Add code for new invalidation local ack systemrlarocque@chromium.org2013-10-3110-18/+350
| | | | | | | | | | | | Commits classes that are part of the infrastructure of the new local acknowledgement system for invalidations, which will be based on WeakHandles to AckHandlers. BUG=233437 Review URL: https://codereview.chromium.org/40303005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231983 0039d316-1c4b-4281-b951-d872f2087c98
* (2 of 2) Move InvalidationController to chrome/rlarocque@chromium.org2013-10-311-128/+0
| | | | | | | | | | | | | | | Remove InvalidationController from its old location. This completes the move that was started in r231232. The downstream code has been updated to point to the InvalidationController in its new location. Now that the class defined in the old location is completely unused, we can safely remove it. BUG=172391 Review URL: https://codereview.chromium.org/49833004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231975 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed SyncStatusHelper not updating observers on changes.apiccion@chromium.org2013-10-313-51/+369
| | | | | | | | | | | * SyncStatusHelper now updates observers whenever cached contents changes, previously only updated on content resolver notifications. BUG=299123 Review URL: https://codereview.chromium.org/26116009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231960 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Implement per-type update processingrlarocque@chromium.org2013-10-3021-557/+631
| | | | | | | | | | | | | | | | | | | | | | | Introduces a new class that represents a syncable::Directory's udpate requesting and processing capabilities. The intention is that this will eventually be expanded to cover commits as well. Eventually, this will be used as the basis for an interface between sync and Some update logic has been moved into this SyncDirectoryUpdateHandler class or download.cc. The rest of it can be found in process_update_util.cc, the successor to the old ProcessUpdatesCommand. The StoreTimestampsCommand has been entirely removed. The unit tests associated with these SyncerCommands have been ported to sync_directory_update_handler_unittest.cc. Except for a few error scenarios that are now handled differently, the observable behavior of the client should not be changed by this CL. BUG=278484 Review URL: https://codereview.chromium.org/38803003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231878 0039d316-1c4b-4281-b951-d872f2087c98
* Replace kChromeOSReleaseBoard with SysInfo::GetLsbReleaseBoard()stevenjb@chromium.org2013-10-283-46/+8
| | | | | | | | BUG=126732 Review URL: https://codereview.chromium.org/32043003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231396 0039d316-1c4b-4281-b951-d872f2087c98
* (1 of 2) Move InvalidationController to chrome/rlarocque@chromium.org2013-10-277-521/+185
| | | | | | | | | | | | | | | | | | | | | | | Move the InvalidationController Java class from sync/notifier to chrome/browser/invalidation. Move its IntentProtocol inner class into its own class, InvalidationIntentProtocol, and keep it in sync/notifier. In order to prevent this change from breaking the downstream build, a reduced version of InvalidationController has been left behind in the old location. The second part of this patch will remove it. An unfortunate side effect of having two InvalidationControllers is that they may be double-notified when the when the activity state changes, and this may cause the start or stop signals to be sent to the InvalidationService twice. This is wasteful, but otherwise mostly harmless. TBR=jhawkins BUG=172391 Review URL: https://codereview.chromium.org/45103003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231232 0039d316-1c4b-4281-b951-d872f2087c98
* Remove enabled/disabled state from extension and app sync.yoz@chromium.org2013-10-271-0/+5
| | | | | | | | BUG=303311 Review URL: https://codereview.chromium.org/30223003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231221 0039d316-1c4b-4281-b951-d872f2087c98
* Remove references to GaiaConstants::kSyncService from syncpavely@chromium.org2013-10-2512-56/+0
| | | | | | | | | | | | | | | | This CL is followup after https://codereview.chromium.org/22342003/ I've removed references to GaiaConstants::kSyncService from ProfileSyncService unittests, SyncBackendHost and ProfileSyncService.java There are still references in TokenService, TokenService unittests and chrome/browser/chromeos/login/online_attempt.cc. The last one should not block TokenService migration as it doesn't refer TokenService, but I don't understand that code so decided not to change it. Review URL: https://codereview.chromium.org/31213004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230899 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Force LOCAL GUs if invalidations disabledrlarocque@chromium.org2013-10-242-153/+152
| | | | | | | | | | | | | | | If the invalidations system is not working or has been not working for some time in the recent past, we should not allow the syncer to skip making the "LOCAL" request for updates prior to each commit request. Currently, all pre-commit update avoidance is hidden behind a flag, so this change will have no effect on normal users. BUG=309815 Review URL: https://codereview.chromium.org/33723003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230639 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Init backend without UI thread taskrlarocque@chromium.org2013-10-237-6/+162
| | | | | | | | | | | | | | | | | | | | | | Remove the part of sync backend initialize flow that posts a task to the UI thread. The only part of this task that could not easily be moved on to the sync thread or defered for later was the setting of the initialization_state_ flag. However, as of r224014 that flag is no longer useful, so the refactoring can proceed. Replace the initialization_state_ variable with a bool. The code no longer requires a set of enum values to represent the backend's initialization state. This change broke the TestProfileSyncService pretty badly. That test class was fixed by moving around some code in order to allow us to inject testable hooks into SyncManager. BUG=295806 Review URL: https://codereview.chromium.org/23698015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230550 0039d316-1c4b-4281-b951-d872f2087c98
* Add UnackedInvalidationSet classrlarocque@chromium.org2013-10-2312-27/+788
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a class that holds all locally unacknowledged invalidations and their state. It is not used anywhere outside of tests. This class is part of an attempt to refactor the InvalidatorStorage class. That class stores pieces of the invalidations component's state in preferences. It currently has some simple getter and setter methods for things like the client ID and bootstrat data, and some more complicated methods that related to storing unacked invalidations. The goal is to eventually move the complex logic related to invalidations out of the InvalidationStorage class, and into the UnackedInvalidationSet class. The UnackedInvalidationSet class can be owned by the SyncInvalidationListener, and periodically passed back to the InvalidationStorage class on a separate thread for serialization. The motivation for this refactoring is not merely aesthetic. The UnackedInvalidationSet handles certain trickles related use cases that the current storage system can not. Extending the existing storage system to support these features would have made the code much harder to understand. This approach lets us add functionality and simplify the code at the same time. BUG=233437 Review URL: https://codereview.chromium.org/26141004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230529 0039d316-1c4b-4281-b951-d872f2087c98
* [Android] Consolidate and upgrade OWNERS for test filesmiguelg@chromium.org2013-10-231-0/+1
| | | | | | | | | | | Part of a bigger change that can be seen here for context https://codereview.chromium.org/27311005/ BUG=308421 Review URL: https://codereview.chromium.org/26880007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230400 0039d316-1c4b-4281-b951-d872f2087c98
* Remove OAuth2 token commandline switchpavely@chromium.org2013-10-2314-33/+10
| | | | | | | | | Switch sync to always use OAuth2 tokens and remove corresponding flags and command line switch. Review URL: https://codereview.chromium.org/22342003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230343 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Refactor update verification and processingrlarocque@chromium.org2013-10-236-53/+60
| | | | | | | | | | | | | | | | | | | | | Define a new function for partitioning an update response into per-type chunks and use it to refactor ProcessUpdateCommand's functions. This is part of the preparation to move towards maintaining a set of per-type objects that we can use to process updates in different ways for different types. This commit also updates the GetModelTypeFromSpecifics() so it no longer reports the type of deleted items as "UNSPECIFIED". The old behavior was implemented in a time when the server would not set the type of tombstone items. The current server will always populate that information. BUG=278484 Review URL: https://codereview.chromium.org/27765002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@230266 0039d316-1c4b-4281-b951-d872f2087c98
* Add visibility check to [ActivityStatus]dfalcantara@chromium.org2013-10-171-8/+1
| | | | | | | | | | | | | | | | | | Some Java code checks to see whether Chrome is in the foreground when it should really be checking if the Application's top Activity is visible for scenarios where a little popup partially covers Chrome. Add a method to make the check more explicit, then change obvious places that do checks on whether Chrome is running to use the new function. Precursor to https://gerrit-int.chromium.org/#/c/45073/ BUG=308211 R=nyquist@chromium.org, tedchoc@chromium.org, yfriedman@chromium.org Review URL: https://codereview.chromium.org/27509007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229172 0039d316-1c4b-4281-b951-d872f2087c98
* Cleanup for refactored ActivityStatus.tedchoc@chromium.org2013-10-161-1/+1
| | | | | | | | | R=yfriedman BUG= Review URL: https://codereview.chromium.org/24795004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228834 0039d316-1c4b-4281-b951-d872f2087c98
* Remove deprecated methods.shashishekhar@chromium.org2013-10-161-18/+0
| | | | | | | | | | These methods are no longer used. TBR=nyquist Review URL: https://codereview.chromium.org/26155005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228811 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Implement per-type commit interfacerlarocque@chromium.org2013-10-1627-1574/+1137
| | | | | | | | | | | | | | | | | | | | | | | | | | Move most commit logic into per-type instances of SyncDirectoryCommitContributor and SyncDirectoryCommitContribution classes. Make GetCommitIdsCommand and ProcessCommitResponseCommand into container classes with only static methods. Remove OrderedCommitSet. The point of these changes is to make way for different kinds of entity committers. The SyncDirectoryCommitContributor and SyncDirectoryCommitContribution will eventually refactored into implementations of more generic "commit contributor" and "commit contribution" interfaces. This commit leaves us with some structures that might look a bit odd to someone unfamiliar with the history of this code. In particular, many of the old SyncerCommands look out of place. We plan to refactor them in future CLs. For now, it's more important to make sure this CL has an easy to read diff. BUG=278484 Review URL: https://codereview.chromium.org/25638003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228810 0039d316-1c4b-4281-b951-d872f2087c98
* Fix issue with sync status observer for testshell.nyquist@chromium.org2013-10-111-2/+20
| | | | | | | | | | | | Also adds a test to ensure the sync status observer behaves correctly. Depends on: https://codereview.chromium.org/23686014/ BUG=272584 Review URL: https://codereview.chromium.org/23450036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228237 0039d316-1c4b-4281-b951-d872f2087c98
* Chrome sync: Put WeakPtrFactory members at the enddmichael@chromium.org2013-10-1015-46/+48
| | | | | | | | | | BUG=303818 R=akalin@chromium.org, nhiroki@chromium.org TBR=nhiroki@chromium.org Review URL: https://codereview.chromium.org/26594002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227944 0039d316-1c4b-4281-b951-d872f2087c98