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/engine | |
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/engine')
-rw-r--r-- | sync/engine/all_status.cc | 10 | ||||
-rw-r--r-- | sync/engine/all_status.h | 3 | ||||
-rw-r--r-- | sync/engine/sync_scheduler_unittest.cc | 3 | ||||
-rw-r--r-- | sync/engine/sync_scheduler_whitebox_unittest.cc | 3 | ||||
-rw-r--r-- | sync/engine/sync_session_job_unittest.cc | 3 | ||||
-rw-r--r-- | sync/engine/syncer_proto_util.cc | 1 | ||||
-rw-r--r-- | sync/engine/syncer_unittest.cc | 3 |
7 files changed, 19 insertions, 7 deletions
diff --git a/sync/engine/all_status.cc b/sync/engine/all_status.cc index 12a5a09..10201f8 100644 --- a/sync/engine/all_status.cc +++ b/sync/engine/all_status.cc @@ -167,9 +167,15 @@ void AllStatus::SetKeystoreMigrationTime(const base::Time& migration_time) { status_.keystore_migration_time = migration_time; } -void AllStatus::SetUniqueId(const std::string& guid) { +void AllStatus::SetSyncId(const std::string& sync_id) { ScopedStatusLock lock(this); - status_.unique_id = guid; + status_.sync_id = sync_id; +} + +void AllStatus::SetInvalidatorClientId( + const std::string& invalidator_client_id) { + ScopedStatusLock lock(this); + status_.invalidator_client_id = invalidator_client_id; } void AllStatus::IncrementNudgeCounter(NudgeSource source) { diff --git a/sync/engine/all_status.h b/sync/engine/all_status.h index 6d3e52b..76ce3073 100644 --- a/sync/engine/all_status.h +++ b/sync/engine/all_status.h @@ -58,7 +58,8 @@ class AllStatus : public SyncEngineEventListener { void SetHasKeystoreKey(bool has_keystore_key); void SetKeystoreMigrationTime(const base::Time& migration_time); - void SetUniqueId(const std::string& guid); + void SetSyncId(const std::string& sync_id); + void SetInvalidatorClientId(const std::string& invalidator_client_id); void IncrementNudgeCounter(NudgeSource source); diff --git a/sync/engine/sync_scheduler_unittest.cc b/sync/engine/sync_scheduler_unittest.cc index 4718952..3fe4c0d 100644 --- a/sync/engine/sync_scheduler_unittest.cc +++ b/sync/engine/sync_scheduler_unittest.cc @@ -128,7 +128,8 @@ class SyncSchedulerTest : public testing::Test { connection_.get(), directory(), workers, &extensions_activity_monitor_, throttled_data_type_tracker_.get(), std::vector<SyncEngineEventListener*>(), NULL, NULL, - true /* enable keystore encryption */)); + true, // enable keystore encryption + "fake_invalidator_client_id")); context_->set_routing_info(routing_info_); context_->set_notifications_enabled(true); context_->set_account_name("Test"); diff --git a/sync/engine/sync_scheduler_whitebox_unittest.cc b/sync/engine/sync_scheduler_whitebox_unittest.cc index 5a9d774..8b0f7ef 100644 --- a/sync/engine/sync_scheduler_whitebox_unittest.cc +++ b/sync/engine/sync_scheduler_whitebox_unittest.cc @@ -53,7 +53,8 @@ class SyncSchedulerWhiteboxTest : public testing::Test { workers, &extensions_activity_monitor_, throttled_data_type_tracker_.get(), std::vector<SyncEngineEventListener*>(), NULL, NULL, - true /* enable keystore encryption */)); + true, // enable keystore encryption + "fake_invalidator_client_id")); context_->set_notifications_enabled(true); context_->set_account_name("Test"); scheduler_.reset( diff --git a/sync/engine/sync_session_job_unittest.cc b/sync/engine/sync_session_job_unittest.cc index f19ade8..7a3f2ba 100644 --- a/sync/engine/sync_session_job_unittest.cc +++ b/sync/engine/sync_session_job_unittest.cc @@ -57,7 +57,8 @@ class SyncSessionJobTest : public testing::Test { std::vector<SyncEngineEventListener*>(), NULL, // |debug_info_getter| NULL, // |traffic_recorder| - true /* |enable keystore encryption| */)); + true, // |enable keystore encryption| + "fake_invalidator_client_id")); context_->set_routing_info(routes_); } diff --git a/sync/engine/syncer_proto_util.cc b/sync/engine/syncer_proto_util.cc index fd856fc..47a17da 100644 --- a/sync/engine/syncer_proto_util.cc +++ b/sync/engine/syncer_proto_util.cc @@ -363,6 +363,7 @@ SyncerError SyncerProtoUtil::PostClientToServerMessage( AddBagOfChips(session->context()->directory(), msg); msg->set_api_key(google_apis::GetAPIKey()); msg->mutable_client_status()->CopyFrom(session->context()->client_status()); + msg->set_invalidator_client_id(session->context()->invalidator_client_id()); syncable::Directory* dir = session->context()->directory(); diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc index b85f652..304dd5a 100644 --- a/sync/engine/syncer_unittest.cc +++ b/sync/engine/syncer_unittest.cc @@ -226,7 +226,8 @@ class SyncerTest : public testing::Test, mock_server_.get(), directory(), workers, &extensions_activity_monitor_, throttled_data_type_tracker_.get(), listeners, NULL, &traffic_recorder_, - true /* enable keystore encryption */)); + true, // enable keystore encryption + "fake_invalidator_client_id")); context_->set_routing_info(routing_info); syncer_ = new Syncer(); session_.reset(MakeSession()); |