diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-25 00:29:32 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-25 00:29:32 +0000 |
commit | 389f566a8d88ba4849dc1c2179e00bf64b1d1b39 (patch) | |
tree | ad64c2dbf6b004f43fe3e8a0e7bd539f223a51f4 /sync/notifier/invalidator_factory.h | |
parent | ccdcf4375d9a79dcea5d92692db30ae199ffff28 (diff) | |
download | chromium_src-389f566a8d88ba4849dc1c2179e00bf64b1d1b39.zip chromium_src-389f566a8d88ba4849dc1c2179e00bf64b1d1b39.tar.gz chromium_src-389f566a8d88ba4849dc1c2179e00bf64b1d1b39.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208315 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/notifier/invalidator_factory.h')
-rw-r--r-- | sync/notifier/invalidator_factory.h | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/sync/notifier/invalidator_factory.h b/sync/notifier/invalidator_factory.h deleted file mode 100644 index 782850e..0000000 --- a/sync/notifier/invalidator_factory.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef SYNC_NOTIFIER_INVALIDATOR_FACTORY_H_ -#define SYNC_NOTIFIER_INVALIDATOR_FACTORY_H_ - -#include <string> - -#include "base/memory/weak_ptr.h" -#include "jingle/notifier/base/notifier_options.h" -#include "sync/base/sync_export.h" -#include "sync/internal_api/public/util/weak_handle.h" -#include "sync/notifier/invalidation_state_tracker.h" - -namespace syncer { - -class Invalidator; - -// Class to instantiate various implementations of the Invalidator -// interface. -class SYNC_EXPORT InvalidatorFactory { - public: - // |client_info| is a string identifying the client, e.g. a user - // agent string. |invalidation_state_tracker| may be NULL (for - // tests). - InvalidatorFactory( - const notifier::NotifierOptions& notifier_options, - const std::string& client_info, - const base::WeakPtr<InvalidationStateTracker>& - invalidation_state_tracker); - ~InvalidatorFactory(); - - // Creates an invalidator. Caller takes ownership of the returned - // object. However, the returned object must not outlive the - // factory from which it was created. Can be called on any thread. - Invalidator* CreateInvalidator(); - - // Returns the unique ID that was (or will be) passed to the invalidator. - std::string GetInvalidatorClientId() const; - - private: - const notifier::NotifierOptions notifier_options_; - - // Some of these should be const, but can't be set up in member initializers. - InvalidationStateMap initial_invalidation_state_map_; - const std::string client_info_; - std::string invalidator_client_id_; - std::string invalidation_bootstrap_data_; - WeakHandle<InvalidationStateTracker> invalidation_state_tracker_; -}; - -} // namespace syncer - -#endif // SYNC_NOTIFIER_INVALIDATOR_FACTORY_H_ |