summaryrefslogtreecommitdiffstats
path: root/sync/sync_tests.gypi
Commit message (Collapse)AuthorAgeFilesLines
* Add some unit tests for SyncData.maniscalco@chromium.org2014-02-221-0/+1
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/174443002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@252763 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Add interfaces for per-type syncrlarocque@chromium.org2014-02-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | Puts the DirectoryCommitContributor and DirectoryUpdateHandler classes behind interfaces. These classes were always intended to form the basis of an abstract interface. Now we can start to introduce alternate implementations of them. This CL includes one such alternate implementation. It adds the MockUpdateHandler and uses it to remove some unnecessary boilerplate from the download unit tests. This CL also resolves an old TODO. It renames the SyncDirectory* classes to Directory*, since the 'Sync' part of the name is redundant. This should have no effect on program behavior. BUG=278484 Review URL: https://codereview.chromium.org/161253002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251969 0039d316-1c4b-4281-b951-d872f2087c98
* Remove duplicated code from sync related unit tests.maniscalco@chromium.org2014-02-191-0/+2
| | | | | | | | | | | | | Consolidate the various implementations of SyncChangeProcessorDelegate and fake into sync/api. Replace many of the fake SyncChangeProcessor implementations with a slightly more advanced FakeSyncChangeProcessor. TBR=brettw@chromium.org BUG= Review URL: https://codereview.chromium.org/151963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@251926 0039d316-1c4b-4281-b951-d872f2087c98
* Added a basic AttachmentStore interface and fake implementation for use in ↵maniscalco@chromium.org2014-02-051-1/+2
| | | | | | | | | | | | | | | | some forthcoming unit tests. AttachmentStore will likely change a lot in a future CL. Renamed SyncAttachment to Attachment. Renamed SyncAttachmentId to AttachmentId. Added CreateId method to Attachment. BUG= Review URL: https://codereview.chromium.org/104813004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@249160 0039d316-1c4b-4281-b951-d872f2087c98
* Client-to-server messages in GCMNetworkChannelpavely@chromium.org2014-01-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change implements sending client-to-server messages in GCMNetworkChannel. Implementation mimics what android implementation is doing. To send message to server GCMNetworkChannel needs GCM registration Id and access token. Registration Id is requested during initialization and doesn’t change through process lifetime. Access token is requested for every message. Errors are not handled, cacheinvalidations will retry sending message if it doesn’t see confirmation from server that the message was received. The only handled error is HTTP_UNAUTHORIZED from tango server since access token needs to be invalidated in this case. Actual work of requesting registration id and access token is delegated to GCMNetworkChannelDelegate interface. Implementation of this interface will live in chrome/browser/invalidation directory and will use GCMProfileService for registration and ProfileOAuth2TokenService for token functions. There are two things that are still not implemented: - Register error handling: will need to implement retry. - Building url for tango endpoint: this involves preparing and base64 encoding NetworkEndpointId protobuf from cacheinvalidations library. Will address both in next CL. BUG=325020 Review URL: https://codereview.chromium.org/140513002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246377 0039d316-1c4b-4281-b951-d872f2087c98
* Basic implementation of the Sync C++ fake server (attempt #2)pvalenzuela@chromium.org2014-01-181-0/+26
| | | | | | | | | | | | | | This CL provides just enough functionality so that PrototypeFakeServerTest will pass. This was originally committed as r245326, but was reverted due to compile errors. BUG=323265 Review URL: https://codereview.chromium.org/139783006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245732 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Introduce ModelTypeRegistry and helpersrlarocque@chromium.org2014-01-171-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Introduce the ModelTypeRegistry class and use it to manage the creation of UpdateHandlers and CommitContributors. The ModelTypeRegistry also gets some help from the newly introduced UpdaterList and CommitterList classes. This lets us move the verbose iteration logic out of the code that's focused on building and executing commits and updates, which should make those functions easier to read. It gives us more freedom to experiment with other ways to manage the lists of commit contributors and update handlers, should we choose to do so. It prevents us from leaking the set of enabled types through the per-type maps. This patch is one of the last in the stack related to building a per-type abstraction into the sync engine, and also one of the first steps towards implementing run-time enable and disable logic for the new-style sync types. BUG=278484 Review URL: https://codereview.chromium.org/93433006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245654 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 245326 "Basic implementation of the Sync C++ fake server"pvalenzuela@chromium.org2014-01-161-25/+0
| | | | | | | | | | | | | | | | | > Basic implementation of the Sync C++ fake server > > This CL provides just enough functionality so that > PrototypeFakeServerTest will pass. > > BUG=323265 > > Review URL: https://codereview.chromium.org/115243007 TBR=pvalenzuela@chromium.org Review URL: https://codereview.chromium.org/130503007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245341 0039d316-1c4b-4281-b951-d872f2087c98
* Basic implementation of the Sync C++ fake serverpvalenzuela@chromium.org2014-01-161-0/+25
| | | | | | | | | | | This CL provides just enough functionality so that PrototypeFakeServerTest will pass. BUG=323265 Review URL: https://codereview.chromium.org/115243007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245326 0039d316-1c4b-4281-b951-d872f2087c98
* Control invalidations network channel from TiclInvalidationService pavely@chromium.org2014-01-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This change introduces boilerplate GCMNetworkChannel implementation and switches sync/notifier classes to refer network channel through base class SyncNetworkChannel. TiclInvalidationService can initialize invalidator with either PushClient or GCM channel. On one hand goal was to not expose network channel implementation to TiclInvalidationService, on the other hand to avoid passing channel specific parameters across sync/notifier classes during initialization. The solution is to introduce NetworkChannelCreator callback that takes no parameters and returns scoped_ptr to SyncNetworkChannel. There are helper functions in SyncNetworkChannel to create implementations for Puch/GCM clients and helper functions in NonBlockingInvalidator to createNetworkChannelCreator. The alternative was to create NetworkChannel factory interface and write implementations of it for each channel type. This would provide more expressive names, but requires interface and two implementations for simple purpose. Review URL: https://codereview.chromium.org/116533006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242991 0039d316-1c4b-4281-b951-d872f2087c98
* Checkpointing some Sync Attachment work. Added SyncAttachment and ↵maniscalco@chromium.org2014-01-021-0/+1
| | | | | | | | SyncAttachmentId. The interfaces are still in flux and will likely change. Review URL: https://codereview.chromium.org/102193004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242818 0039d316-1c4b-4281-b951-d872f2087c98
* sync: make sessions sync v2 worktim@chromium.org2013-12-181-0/+2
| | | | | | | | | | | | | | | | | | Summary of work: - get tests passing with or without --enable-sync-sessions-v2 (unit_tests, browser_tests, sync_integration_tests) - did not deal with the disabled sessions perf test. requires non-trival changes, and I'm not sure it's worthwhile yet. - impelement StopSyncing, GetAllSyncData - fixed a bug discovered by manual testing where the client tag for a tab node was using an invalid tab_node_id on update. - remove most remaining references to SessionModelAssociator - ran some manual coverage of backwards compatibility with v1 This patch does add temporary complexity to a few tests, namely WrenchMenuControllerTest and RecentTabsSubMenuModelTest. The goal was to make things work with or without the flag to minimize diffs during rollout, if we have to swap flag values. I'll remove the extra code once SessionModelAssociator is no more. BUG=98892 Review URL: https://codereview.chromium.org/110583002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241582 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Per-type update applicationrlarocque@chromium.org2013-12-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement new invalidations ack tracking systemrlarocque@chromium.org2013-11-261-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Don't clear debug info until after it has been sent to the server.maniscalco@chromium.org2013-11-211-0/+2
| | | | | | | | | | | | 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
* 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
* Add code for new invalidation local ack systemrlarocque@chromium.org2013-10-311-0/+2
| | | | | | | | | | | | 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
* sync: Implement per-type update processingrlarocque@chromium.org2013-10-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* sync: Init backend without UI thread taskrlarocque@chromium.org2013-10-231-0/+4
| | | | | | | | | | | | | | | | | | | | | | 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-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* sync: Implement per-type commit interfacerlarocque@chromium.org2013-10-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Refactor common invalidation framework typesrlarocque@chromium.org2013-10-041-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert the Invalidation struct into a class. This allows us to hide its members, so we can do things like add a DCHECK to make sure we never access the payload field of an unknown version invalidation. It also lets us use factory methods and constructors to initialize it rather than having to initialize its fields one by one. Convert the ObjectIdInvalidationMap from a typedef into a class. Unlike the typedef, the class supports multiple invalidations for the same object ID. It uses the newly introduced SingleObjectInvalidationSet to manage the set of invalidations belonging to a particular ID. Note that the current code still sends only one invalidation per type; that will be changed in a future commit. The end goal of this refactoring is to make these classes smarter so they can help manage the complexity that will be introduced when we implement invalidation 'trickles' support. Note that this commit changes the on-disk format for invalidations, so any invalidations currently stored in the profile may be lost on upgrade. There should be no other notable changes to invalidations behavior in this CL. TBR=brettw BUG=233437 Review URL: https://codereview.chromium.org/23441042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226949 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Gracefully handle early shutdownrlarocque@chromium.org2013-09-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new object to communicate cross-thread cancellation signals. This new object, the CancellationSignal, is protected by a lock. It allows the receiving thread to query whether or not a stop has been requested. It also allows the receiving thread to safely register a cross-thread callback to be invoked immediately when a stop is requested. We use two instances of this class to ensure we meet all the requirements for a safe and fast sync backend shutdown. The first instance is used with the HttpBridgeFactory to allow the UI thread to force it to drop all refereces to its RequestContextGetter immediately. This is an important part of our plan to ensure that all references to that object are released before ProfileSyncService::Shutdown() returns, which is necessary to avoid racy crashes at shutdown. (See crbug.com/236451) The second instance is used with the ServerConnectionManager and the Syncer. Once signalled, it ensures that any active connections are released (possibly decrementing another ref to the RequestContextGetter), that any blocking I/O is aborted, and that no more connections will be instantiated. It's important to prevent the creation of more connections because the HttpBridgeFactory might trigger a crash if we asked it to create another connection after it had been shut down. The syncer's interaction with the second cancelation signal is more passive. It does not execute any callbacks when the signal is sent. Instead, it queries the signal as it performs sync cycles, and will cut short any existing sync cycle if it notices the signal has been sent. Finally, this CL includes one important change to the initialization of the HttpBridgeFactory. In order to properly register with the cancellation signal while still allowing the creation of the user agent to occur on the sync thread, its initialization had to be split into two parts. This class now has an Init() method in addition to its constructor. BUG=236451 Review URL: https://chromiumcodereview.appspot.com/23717047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@224014 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 222154 "sync: Gracefully handle very early shutdown"vitalybuka@chromium.org2013-09-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes tests very Flaky. http://test-results.appspot.com/dashboards/flakiness_dashboard.html#group=%40ToT%20Chromium&testType=sync_integration_tests&tests=TwoClientPasswordsSyncTest.SetPassphraseAndThenSetupSync Can reproduce on local build. > sync: Gracefully handle very early shutdown > > Introduce a new object to communicate cross-thread cancellation signals. > This new object, the CancellationSignal, is protected by a lock. It > allows the receiving thread to query whether or not a stop has been > requested. It also allows the receiving thread to safely register a > cross-thread callback to be invoked immediately when a stop is > requested. > > This class is used to reimplement the UI thread to sync thread early > shutdown signal. Previously, the UI thread would try to call in to > objects owned by the sync thread. This required a workaround if the > signal arrived very early, since we couldn't guarantee the sync thread > had actually created those objects until later. The CancellationSignal > is owned by the UI thread, so it is safe to call its RequestStop() at > any point during sync initialization. The sync thread will receive the > signal when it's ready. > > The new scheme has a few advantages over the old: > - Thread ownership is simpler. The SyncBackendHost::Core, SyncManager, > ServerConnectionManager, SyncScheduler and Syncer can now claim that > all their member functions run on the sync thread. > - We no longer need to implement special case logic for when a shutdown > is requested before the SyncManager has initialized. > - In a future CL, we can take advantage of the fact that we no longer > require the special case to reduce inter-thread communication during > sync startup. This will make startup simpler and, in some cases, > improve sync startup time by as much as a few hundred milliseconds. > - This will make it easier to address crbug.com/236451. > > BUG=236451 > > Review URL: https://chromiumcodereview.appspot.com/23189021 TBR=rlarocque@chromium.org Review URL: https://codereview.chromium.org/23658030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222205 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Gracefully handle very early shutdownrlarocque@chromium.org2013-09-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a new object to communicate cross-thread cancellation signals. This new object, the CancellationSignal, is protected by a lock. It allows the receiving thread to query whether or not a stop has been requested. It also allows the receiving thread to safely register a cross-thread callback to be invoked immediately when a stop is requested. This class is used to reimplement the UI thread to sync thread early shutdown signal. Previously, the UI thread would try to call in to objects owned by the sync thread. This required a workaround if the signal arrived very early, since we couldn't guarantee the sync thread had actually created those objects until later. The CancellationSignal is owned by the UI thread, so it is safe to call its RequestStop() at any point during sync initialization. The sync thread will receive the signal when it's ready. The new scheme has a few advantages over the old: - Thread ownership is simpler. The SyncBackendHost::Core, SyncManager, ServerConnectionManager, SyncScheduler and Syncer can now claim that all their member functions run on the sync thread. - We no longer need to implement special case logic for when a shutdown is requested before the SyncManager has initialized. - In a future CL, we can take advantage of the fact that we no longer require the special case to reduce inter-thread communication during sync startup. This will make startup simpler and, in some cases, improve sync startup time by as much as a few hundred milliseconds. - This will make it easier to address crbug.com/236451. BUG=236451 Review URL: https://chromiumcodereview.appspot.com/23189021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222154 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove ModelTypeInvalidationMaprlarocque@chromium.org2013-09-031-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | Removes the definition and all uses of ModelTypeInvalidationMap. The ModelTypeInvalidationMap was useful only for sync-related invalidations. Its existence made sense when sync was the only client for invalidations. Now that we have many invalidations clients, it makes sense to replace it with the more generic ObjectIdInvalidationMap. The reason for doing this now is that the ObjectIdInvalidationMap will soon be modified to be incompatible with the current definition of ModelTypeInvalidationMap. In order to support trickles it will be modified to allow it to contain several invalidations per ObjectId. Although it would have been possible to maintain compatibility by making a corresponding modification to ModelTypeInvalidationMap, there's really no point in having two invalidation map types. In the long run, it makes more sense to deprecate ModelTypeInvalidationMap. BUG=233437 Review URL: https://chromiumcodereview.appspot.com/23238005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221025 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Remove SyncSourceInforlarocque@chromium.org2013-08-031-1/+0
| | | | | | | | | | | | | | | | | | The SyncSourceInfo was a struct that contained a GetUpdatesSource and a ModelTypeInvalidationMap. Both of these types are in the process of being deprecated. The SyncSourceInfo itself was used only for debugging (about:sync), tests (mostly sync_scheduler_unittest.cc) and maintaining compatibility with some old function signatures. Removing the SyncSourceInfo allow us to remove dependencies on ModelTypeInvalidationMap, which is a step towards enabling invalidation "trickles" support. BUG=233437 Review URL: https://chromiumcodereview.appspot.com/19982002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215446 0039d316-1c4b-4281-b951-d872f2087c98
* Lock-free shutdown of profile sync service. Changes include:haitaol@chromium.org2013-07-311-2/+0
| | | | | | | | | | | | | | | | | | | | | | * Disconnect non-frontend processor/associator to stop accessing directory so that sync backend can be shut down without waiting. * Change non-frontend controller so that creation/destruction of processor/associator doesn't depend on valid controller. So scoped wait on stopping controller can be removed. * Move sync thread to PSS. It's created when starting first backend and destroyed on last browser thread. BUG=19757 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210333 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210955 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=213642 Review URL: https://chromiumcodereview.appspot.com/16770005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214500 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 213642 "Lock-free shutdown of profile sync service. Chang..."earthdok@chromium.org2013-07-251-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reverting due to memory leaks. BUG=264325 > Lock-free shutdown of profile sync service. Changes include: > * Disconnect non-frontend processor/associator to stop accessing directory > so that sync backend can be shut down without waiting. > * Change non-frontend controller so that creation/destruction of > processor/associator doesn't depend on valid controller. So > scoped wait on stopping controller can be removed. > * Move sync thread to PSS. It's created when starting first backend and > destroyed on last browser thread. > > BUG=19757 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210333 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210955 > > Review URL: https://chromiumcodereview.appspot.com/16770005 TBR=haitaol@chromium.org Review URL: https://codereview.chromium.org/20374005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213671 0039d316-1c4b-4281-b951-d872f2087c98
* Lock-free shutdown of profile sync service. Changes include:haitaol@chromium.org2013-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | * Disconnect non-frontend processor/associator to stop accessing directory so that sync backend can be shut down without waiting. * Change non-frontend controller so that creation/destruction of processor/associator doesn't depend on valid controller. So scoped wait on stopping controller can be removed. * Move sync thread to PSS. It's created when starting first backend and destroyed on last browser thread. BUG=19757 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210333 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=210955 Review URL: https://chromiumcodereview.appspot.com/16770005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213642 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Expose sync functionality as functionsrlarocque@chromium.org2013-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is a refactor to clean up ugliness introduced in previous commits and prepare for future features. The most notable change is the removal of "state machine" logic from syncer.cc. This allows us to remove the SyncerSteps enum and related code. The SyncShare function + enum parameters have been replaced with the functions NormalSyncShare(), ConfigureSyncShare() and PollSyncShare(). These changes should make it possible to address crbug.com/109422, and to re-enable commits during poll-triggered sync cycles (if desrired, see r206475). The logic for fetching and applying updates has been modified, too. Since the behaviour of GetUpdates varies depending on the type of cycle (Configure, GetUpdates, or Poll) the logic to build and execute these GetUpdate requests has been split up. This enables us to remove the NudgeTracker from the SyncSession (an ugly hack introduced in r199136). It should make it easier to implement crbug.com/147685. In the interest of keeping this change as small and simple as possible some obvious refactorings have not been intentionally excluded from this CL. For example, the logic around when to send SYNC_CYCLE_ENDED events or when to return true or false frome the SyncShare functions remains very complicated. Untangling that mess would require some non-trivial changes to the SyncScheduler, so they've been deferred until later. BUG=147685,109422 Review URL: https://chromiumcodereview.appspot.com/17052007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209867 0039d316-1c4b-4281-b951-d872f2087c98
* Use InvalidationService (retry of r208315)rlarocque@chromium.org2013-06-291-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The InvalidationService was introduced r199520. That commit added the InvalidationService interface and several implementations of it, but made no use of the new code. This commit builds on that work. Up until now, TICL invalidations were handled on the sync thread. The related objects were instantiated and owned by the SyncBackendHost and SyncManager. All requests to update the set of object registrations had to be passed to the sync thread. Components that wanted to receive invalidations but were not part of sync had to route their communication with the invalidations server through ProfileSyncService to get to the sync thread. Things were a bit different on Android, but the system still tried to pretend that invalidations were owned by the sync thread. The new InvalidationService implementation is a ProfileKeyedService that is mostly independent from sync. It still relies on sync to manage sign in and fetch the appropriate auth tokens. However, it's now much easier for components outside of sync to communication with the invalidations server. The new system allows us to remove a lot of invalidations-related code from the ProfileSyncService, SyncBackendHost and SyncManager. Sync is now just one of many clients of the InvalidationService. The SyncBackendHost is responsible for forwarding messages back and forth between the InvalidationService and the sync thread. TBR=dcheng,satorux1,battre,rsimha,bauerb,sky,erg BUG=124137 Review URL: https://chromiumcodereview.appspot.com/17699005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209264 0039d316-1c4b-4281-b951-d872f2087c98
* components/autofill: Break the dependency on sync utility file.tfarina@chromium.org2013-06-271-1/+0
| | | | | | | | | | | | | | Do this moving data_encryption_win* into core/browser, since it's only used from there. BUG=140037 TEST=unit_tests,checkdeps.py R=joi@chromium.org,isherman@chromium.org,akalin@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/17745004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208948 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 208315 "Make use of InvalidationService"rlarocque@chromium.org2013-06-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | > Make use of InvalidationService > > The InvalidationService was introduced r199520. That commit added the > InvalidationService interface and several implementations of it, but > made no use of the new code. This commit builds on that work. > > Up until now, TICL invalidations were handled on the sync thread. The > related objects were instantiated and owned by the SyncBackendHost and > SyncManager. All requests to update the set of object registrations had > to be passed to the sync thread. Components that wanted to receive > invalidations but were not part of sync had to route their communication > with the invalidations server through ProfileSyncService to get to the > sync thread. Things were a bit different on Android, but the system > still tried to pretend that invalidations were owned by the sync thread. > > The new InvalidationService implementation is a ProfileKeyedService that > is mostly independent from sync. It still relies on sync to manage sign > in and fetch the appropriate auth tokens. However, it's now much easier > for components outside of sync to communication with the invalidations > server. > > The new system allows us to remove a lot of invalidations-related code > from the ProfileSyncService, SyncBackendHost and SyncManager. Sync is > now just one of many clients of the InvalidationService. The > SyncBackendHost is responsible for forwarding messages back and forth > between the InvalidationService and the sync thread. > > TBR=sky,erg > BUG=124137 > > Review URL: https://chromiumcodereview.appspot.com/15580002 TBR=rlarocque@chromium.org Review URL: https://codereview.chromium.org/17610004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208347 0039d316-1c4b-4281-b951-d872f2087c98
* Make use of InvalidationServicerlarocque@chromium.org2013-06-251-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The InvalidationService was introduced r199520. That commit added the InvalidationService interface and several implementations of it, but made no use of the new code. This commit builds on that work. Up until now, TICL invalidations were handled on the sync thread. The related objects were instantiated and owned by the SyncBackendHost and SyncManager. All requests to update the set of object registrations had to be passed to the sync thread. Components that wanted to receive invalidations but were not part of sync had to route their communication with the invalidations server through ProfileSyncService to get to the sync thread. Things were a bit different on Android, but the system still tried to pretend that invalidations were owned by the sync thread. The new InvalidationService implementation is a ProfileKeyedService that is mostly independent from sync. It still relies on sync to manage sign in and fetch the appropriate auth tokens. However, it's now much easier for components outside of sync to communication with the invalidations server. The new system allows us to remove a lot of invalidations-related code from the ProfileSyncService, SyncBackendHost and SyncManager. Sync is now just one of many clients of the InvalidationService. The SyncBackendHost is responsible for forwarding messages back and forth between the InvalidationService and the sync thread. TBR=sky,erg BUG=124137 Review URL: https://chromiumcodereview.appspot.com/15580002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208315 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Handle type throttling in NudgeTrackerrlarocque@chromium.org2013-06-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removes the ThrottledDataTypeTracker and moves much of its functionality into the NudgeTracker. This allows us to better control throttling behavior and fix crbug.com/155296. This CL re-routes syncer_proto_util type throttling callbacks through the SyncSession::Delegate to the SyncScheduler. It adds a timer and some related functions to the SyncScheduler, so the scheduler can now wake up, unthrottle types, and attempt a sync cycle at the exact time when throttling expires. The information about which types are currently throttled has been moved to the NudgeTracker. This allows the NudgeTracker to take type throttling into account in functions like NudgeTracker::IsSyncRequired() and NudgeTracker::RecordSuccessfulSyncCycle(). The DownloadUpdatesCommand's special case for nudge-type syncs has been extended to take throttling into account. GetCommitIdsCommand has been updated to fetch its list of throttled types from the nudge tracker. Unfortunately, this meant that committing from poll-triggered sync sessions had to be disabled, since poll sync cycles do not have access to the nudge tracker. BUG=155296, 116184 Review URL: https://chromiumcodereview.appspot.com/16402013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206475 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Cleanups in and around directory.hrlarocque@chromium.org2013-06-071-2/+0
| | | | | | | | | | | | | | | | | | | - Remove MockDirectorySyncerCommand (not used). - Remove MockDirectory (used only by MockDirectorySyncerCommand). - Remove Directory::InitKernelForTest (used only by MockDirectory). - Merge ChildHandles and UnsyncedMetahandles typedefs into a single Metahandles typedef. - Rearrange declarations in directory.h to match Google C++ style. - Create scoped_kernel_lock.cc; move related definitions from directory.cc to this new file. - Use DISALLOW_COPY_AND_ASSIGN instead of declaring an undefined Directory::operator= manually. BUG=245931 Review URL: https://chromiumcodereview.appspot.com/16591002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204828 0039d316-1c4b-4281-b951-d872f2087c98
* Roll DEPS for googleurl. Second try.tfarina@chromium.org2013-06-031-2/+2
| | | | | | | | | | | | | | | - Update all the references from build/temp_gyp/googleurl.gyp to url/url.gyp. r184: Fix C++11 compilation on iOS r185: Forward includes to url/ BUG=229660 R=thestig@chromium.org,brettw@chromium.org TBR=darin@chromium.org Review URL: https://chromiumcodereview.appspot.com/15421002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203672 0039d316-1c4b-4281-b951-d872f2087c98
* Initial version of Test Accounts service client (attempt #2)pvalenzuela@chromium.org2013-05-131-0/+38
| | | | | | | | | | | | | | | | | | This version uses URLFetcher instead of curl. Original description (committed/reverted r198019): """ Initial version of Test Accounts service client. This client will allow Chrome Sync tests to utilize the upcoming Test Accounts service that allows short-term, exclusive access to test accounts for the purpose of testing against real servers. """ BUG= Review URL: https://chromiumcodereview.appspot.com/14591008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@199805 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Initial version of Test Accounts service client. This client will" ↵mattm@chromium.org2013-05-031-41/+0
| | | | | | | | | | | | which failed compile on Mac bot. This reverts commit r198019. TBR=pvalenzuela@chromium.org Review URL: https://codereview.chromium.org/14892003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198039 0039d316-1c4b-4281-b951-d872f2087c98
* Initial version of Test Accounts service client. This client willpvalenzuela@chromium.org2013-05-031-0/+41
| | | | | | | | | | | | allow Chrome Sync tests to utilize the upcoming Test Accounts service that allows short-term, exclusive access to test accounts for the purpose of testing against real servers. BUG= Review URL: https://chromiumcodereview.appspot.com/14295014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198019 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Finish the SyncScheduler refactorrlarocque@chromium.org2013-04-181-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change removes SyncSessionJob entirely. The first step towards this goal was to refactor all functions that depended on SyncSessionJob. All these functions have either been inlined or modified to take different parameters instead. DoSyncSessionJob was split into two separate functions, one for configure jobs and one for nudge jobs, which removes the need for SyncSessionJob's "purpose" member. The SyncScheduler's pending_configure_job_ has been replaced with a ConfigParams member, since that was the only part of the job still being referenced. The pending_nudge_job_ has been replaced with scheduled_nudge_time_ (which is similar to the old scheduled_start_ member of SyncSessionJob) and a new object called a NudgeTracker. The NudgeTracker inherits the SyncSessionJob's responsibilities with respect to coalescing nudge sources. The plan is to extend this class to support more sophisticated nudge coalescing in the future. For now it tries to emulate the old SyncSessionJob behaviour as closely as possible. Some of the refactoring does change behaviour. In particular, the decision-making logic has been updated to fix issues 179515 and 155296. BUG=175024,179515,155296 Review URL: https://chromiumcodereview.appspot.com/13743003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194766 0039d316-1c4b-4281-b951-d872f2087c98
* sync: Bookmark unique position end-to-end supportrlarocque@chromium.org2013-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change rewrites the bookmark positioning system to use absolute, arbitrary-precision, unique positions from end-to-end. First, it introduces the concept of a UNIQUE_BOOKMARK_TAG. This has a similar format to the UNIQUE_CLIENT_TAG, though bookmarks have never supported unique tags previously. For new items, it is initialized based on the bookmark's originator client item ID (ie. the "c-" style ID) and the originator's cache_guid. These values should be globally unique. Many previously created items that exist in the database do not have this information available. Non-committed items will still have this information, and will have their tags set correctly. Previously committed items will have server style IDs and no hint as to what the originator_cache_guid is. In that common case, we will initialize the tag with a "fake" one based solely on the server ID. This has the advantage of being something that all existing clients will agree on, even it if new clients and updated items/the server will disagree with them. To bring everyone back into sync, whenever they receive an update clients will access the included originator_cache_guid and originator_client_item_id fields and reset the UNIQUE_BOOKMARK_TAG field according to the values they find there. Over time, clients should converge towards the same tag values. Next, this change adds the UNIQUE_POSITION and SERVER_UNIQUE_POSITION fields to each entry. See the UniquePosition class documentation for more information on their behaviour. New items should have their local position updated when they are first inserted into the list, which should happen shortly after they are initialized. Existing items will have these fields populated from the SERVER_ORDINAL_IN_PARENT field and the genrated UNIQUE_BOOKMARK_TAG. Unfortunately, all outstanding local changes will be lost during the migration. With the addition of UNIQUE_POSITION fields comes the removal of the PREV_ID and NEXT_ID fields. This required significant refactoring of the Directory so it could continue to support the PutPredecessor(), GetPredecessorId(), GetSuccessorId() and GetFirstChildId() functions. A new class, ParentChildIndex, has been introduced to contain some of the complexity introduced by the new system. See that class' documentation for more information. Communication with the server has also been affected by this change. The client will now set the unique_position field on every update. It will also set the legacy server_position_in_parent field with a value derrived from a truncation of its local UNIQUE_POSITION. This replaces the existing server position in parent calculation through interpolation. The receipt of updates has been changed as well. If the client receives an update with a unique_position, it will apply it. If the update was written by an older client, it will contain only the server_position_in_parent. In that case, the client will use that position and the unique tag derrived from the update to construct a unique position that approximates the server_position_in_parent value. This will work well if the clients have not exceeded the available precision in an int64. Otherwise, some spurious re-positioning may occur. Finally, all these changes required some updates to the tests. Some arbitrary position assertions had to be updated, since the arbitrary ordering has changed. Some test helpers have been updated to no longer automatically place bookmarks at the end of the list; that logic has been moved to the tests themselves. BUG=145412, 126505, 147715, 101852, 107744, 112203, 123429, 177521, 20011 Review URL: https://chromiumcodereview.appspot.com/11885024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191767 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 190128 "Reland libjingle.gyp changes."tommi@chromium.org2013-03-241-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | > Reland libjingle.gyp changes. > The changes are the same as in the previous review: > https://codereview.chromium.org/12457027/ > > I had to revert due to build problems but eventually tracked > them down to chromeos dependencies in sync. For 'sync', this > is a problem for shared_library builds but not otherwise. > For sync_unit_tests, this is a problem since sync_unit_tests > is always built as an executable. > > Previously these problems were masked since the dependencies > were being pulled in via libjingle. > > TBR=ronghuawu,akalin > > Review URL: https://codereview.chromium.org/12930010 TBR=tommi@chromium.org Review URL: https://codereview.chromium.org/13009009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190131 0039d316-1c4b-4281-b951-d872f2087c98
* Reland libjingle.gyp changes.tommi@chromium.org2013-03-241-0/+6
| | | | | | | | | | | | | | | | | | | | The changes are the same as in the previous review: https://codereview.chromium.org/12457027/ I had to revert due to build problems but eventually tracked them down to chromeos dependencies in sync. For 'sync', this is a problem for shared_library builds but not otherwise. For sync_unit_tests, this is a problem since sync_unit_tests is always built as an executable. Previously these problems were masked since the dependencies were being pulled in via libjingle. TBR=ronghuawu,akalin Review URL: https://codereview.chromium.org/12930010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190128 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Upstream the code that triggers the InvalidationControllernyquist@chromium.org2013-02-221-0/+13
| | | | | | | | | | | | | | | The InvalidationController needs to be started and stopped based on when the main activity is resumed and paused. This upstreams the listener part of that. It also adds a test for the new functionality and a mock implementation of the SyncContentResolverDelegate. BUG=159203 Review URL: https://chromiumcodereview.appspot.com/12310008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183975 0039d316-1c4b-4281-b951-d872f2087c98
* Use _target_name instead of package_name for java*.gypicjhopman@chromium.org2013-02-201-1/+0
| | | | | | | | | | | | | | | We were using package_name as a unique name for naming output files and directories. package_name was typically the same as _target_name or a variation of it (like dropping _apk). Using _target_name instead means we need to specify one less thing and it is (maybe?) guaranteed to be unique. TBR=brettw,joi,jar,fischman,zea,sky BUG= Review URL: https://chromiumcodereview.appspot.com/11308030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183639 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Extract Android-specific prod Java GYP-target to a separate file.nyquist@chromium.org2013-02-201-17/+0
| | | | | | | | | | | | | Currently, both Android Java-targets live within sync_tests.gypi. This CL moves the prod target sync_java out to a separate file, and also adds per-file OWNERS entries for that file, using the same owners as in sync/android/OWNERS. BUG=None Review URL: https://chromiumcodereview.appspot.com/12303034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@183498 0039d316-1c4b-4281-b951-d872f2087c98
* Add retry function to AccountManagerHelper when called from foregroundclamy@chromium.org2013-02-061-0/+1
| | | | | | | | | | | | | On Android, after encountering an IO exception, the AccountManagerHelper method to get the authentication token from foreground now retries when the network is back. BUG=165687 Review URL: https://chromiumcodereview.appspot.com/12091069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180961 0039d316-1c4b-4281-b951-d872f2087c98
* [sync] Componentize sync: Part Final: Target 'sync' is now its own componentrsimha@chromium.org2013-02-011-0/+617
One of the long term goals of the sync team has been to pull sync out of chrome_dll and into its own component. This should result in faster link times for component builds, and cleaner demarcation between sync code and the rest of chrome. This patch does the following: - Splits off sync.gyp into gypi files for sync_core, sync_api, sync_internal_api, sync_notifier and sync_proto. - Audits the dependencies of various targets in sync.gyp, sync_tests.gyp, and other chrome gyp files, and makes sure all dependencies are explicitly declared. - Makes targets declared in gyp files outside sync.gyp directly depend on sync.gyp:sync instead of inner sync targets. - Implements two versions of the target 'sync.gyp:sync': 1) In static mode, the public 'sync' target has a target type of 'none', and is composed of the static library targets 'sync_api', 'sync_core', 'sync_internal_api', 'sync_notifier', and 'sync_proto'. 2) In component mode, we build the public 'sync' target into a single shared library, which includes the contents of sync_api.gypi, sync_core.gypi, sync_internal_api.gypi, sync_notifier.gypi, and sync_proto.gypi. TBR=akalin,robertshield,thakis BUG=136928 TEST=Set GYP_DEFINES="component=shared_library" and build the 'all' target on all platforms. Review URL: https://codereview.chromium.org/11412211 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@180034 0039d316-1c4b-4281-b951-d872f2087c98