diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-02 17:32:31 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-02 17:32:31 +0000 |
commit | ccf456dc41e2977ba48d4fc12ddfb25e867e0d8d (patch) | |
tree | 5e69073c593c2131ac877284aea0ec15dd5d87f1 /sync/sessions | |
parent | 8cc71d4c48873554d6fb6aeed64a71900dd1c9ad (diff) | |
download | chromium_src-ccf456dc41e2977ba48d4fc12ddfb25e867e0d8d.zip chromium_src-ccf456dc41e2977ba48d4fc12ddfb25e867e0d8d.tar.gz chromium_src-ccf456dc41e2977ba48d4fc12ddfb25e867e0d8d.tar.bz2 |
Separate invalidator and sync client ID (part 1/2)
This change implements support for setting the sync client ID and
invalidator client ID separately. The two IDs are managed separately
and both of them are sent up to the server. This change includes some
additional changes to support the transition, such as a new field in
the about:sync UI.
At this point, the IDs are not different. Both are initialized from the
same source: the sync database. The work to store and manage the
invalidator's ID separate from sync was begun in r180907 and will be
finished in a separate commit. We will not be able to complete that
work until the server supports separate IDs.
BUG=124142
Review URL: https://chromiumcodereview.appspot.com/12256033
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@185721 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r-- | sync/sessions/sync_session_context.cc | 6 | ||||
-rw-r--r-- | sync/sessions/sync_session_context.h | 13 | ||||
-rw-r--r-- | sync/sessions/sync_session_unittest.cc | 3 |
3 files changed, 18 insertions, 4 deletions
diff --git a/sync/sessions/sync_session_context.cc b/sync/sessions/sync_session_context.cc index f4f625b..f931f4c 100644 --- a/sync/sessions/sync_session_context.cc +++ b/sync/sessions/sync_session_context.cc @@ -23,7 +23,8 @@ SyncSessionContext::SyncSessionContext( const std::vector<SyncEngineEventListener*>& listeners, DebugInfoGetter* debug_info_getter, TrafficRecorder* traffic_recorder, - bool keystore_encryption_enabled) + bool keystore_encryption_enabled, + const std::string& invalidator_client_id) : connection_manager_(connection_manager), directory_(directory), workers_(workers), @@ -33,7 +34,8 @@ SyncSessionContext::SyncSessionContext( throttled_data_type_tracker_(throttled_data_type_tracker), debug_info_getter_(debug_info_getter), traffic_recorder_(traffic_recorder), - keystore_encryption_enabled_(keystore_encryption_enabled) { + keystore_encryption_enabled_(keystore_encryption_enabled), + invalidator_client_id_(invalidator_client_id) { std::vector<SyncEngineEventListener*>::const_iterator it; for (it = listeners.begin(); it != listeners.end(); ++it) listeners_.AddObserver(*it); diff --git a/sync/sessions/sync_session_context.h b/sync/sessions/sync_session_context.h index d47c3e2..755e574 100644 --- a/sync/sessions/sync_session_context.h +++ b/sync/sessions/sync_session_context.h @@ -56,7 +56,8 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext { const std::vector<SyncEngineEventListener*>& listeners, DebugInfoGetter* debug_info_getter, TrafficRecorder* traffic_recorder, - bool keystore_encryption_enabled); + bool keystore_encryption_enabled, + const std::string& invalidator_client_id); ~SyncSessionContext(); @@ -130,6 +131,10 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext { return client_status_; } + const std::string& invalidator_client_id() const { + return invalidator_client_id_; + } + private: // Rather than force clients to set and null-out various context members, we // extend our encapsulation boundary to scoped helpers that take care of this @@ -178,6 +183,12 @@ class SYNC_EXPORT_PRIVATE SyncSessionContext { // the experiment is not enabled. bool keystore_encryption_enabled_; + // This is a copy of the identifier the that the invalidations client used to + // register itself with the invalidations server during startup. We need to + // provide this to the sync server when we make changes to enable it to + // prevent us from receiving notifications of changes we make ourselves. + const std::string invalidator_client_id_; + DISALLOW_COPY_AND_ASSIGN(SyncSessionContext); }; diff --git a/sync/sessions/sync_session_unittest.cc b/sync/sessions/sync_session_unittest.cc index 008e893..bb4a3d5 100644 --- a/sync/sessions/sync_session_unittest.cc +++ b/sync/sessions/sync_session_unittest.cc @@ -64,7 +64,8 @@ class SyncSessionTest : public testing::Test, std::vector<SyncEngineEventListener*>(), NULL, NULL, - true /* enable keystore encryption */)); + true, // enable keystore encryption + "fake_invalidator_client_id")); context_->set_routing_info(routes_); session_.reset(MakeSession()); |