summaryrefslogtreecommitdiffstats
path: root/sync/tools
diff options
context:
space:
mode:
authorpavely <pavely@chromium.org>2015-05-19 17:27:10 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-20 00:27:52 +0000
commit8131d2b4b0c296269c8f1bb8e0ed9dfbd5e852ba (patch)
tree493d2b7465312158179de682aac93bfee6ace517 /sync/tools
parent5e096ae82760009e5435785ca7fb2f96b0f0f473 (diff)
downloadchromium_src-8131d2b4b0c296269c8f1bb8e0ed9dfbd5e852ba.zip
chromium_src-8131d2b4b0c296269c8f1bb8e0ed9dfbd5e852ba.tar.gz
chromium_src-8131d2b4b0c296269c8f1bb8e0ed9dfbd5e852ba.tar.bz2
[Sync] InvalidationService shouldn't CHECK when registering ObjectId for more than one handler
Before this change InvalidationService CHECKs that object id is only registered with one handler. This causes browser crash when object id is received from network already registered. Solution is to let each component that uses InvalidationService decide how to react to duplicate registration. In this change: - InvalidationService::UpdateRegisteredInvalidationIds doesn't CHECK inside, but returns boolean that indicates if update was successful. - All places that call this function do CHECK to preserve existing behavior. - Internal implementations and tests are updated accordingly. BUG=475941 R=maniscalco@chromium.org Review URL: https://codereview.chromium.org/1146533005 Cr-Commit-Position: refs/heads/master@{#330654}
Diffstat (limited to 'sync/tools')
-rw-r--r--sync/tools/sync_client.cc4
-rw-r--r--sync/tools/sync_listen_notifications.cc4
2 files changed, 4 insertions, 4 deletions
diff --git a/sync/tools/sync_client.cc b/sync/tools/sync_client.cc
index 1106460..99a2a48 100644
--- a/sync/tools/sync_client.cc
+++ b/sync/tools/sync_client.cc
@@ -445,8 +445,8 @@ int SyncClientMain(int argc, char* argv[]) {
invalidator->UpdateCredentials(credentials.email, credentials.sync_token);
scoped_ptr<InvalidatorShim> shim(new InvalidatorShim(sync_manager.get()));
invalidator->RegisterHandler(shim.get());
- invalidator->UpdateRegisteredIds(
- shim.get(), ModelTypeSetToObjectIdSet(model_types));
+ CHECK(invalidator->UpdateRegisteredIds(
+ shim.get(), ModelTypeSetToObjectIdSet(model_types)));
sync_manager->StartSyncingNormally(routing_info, base::Time());
sync_loop.Run();
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc
index 13468a4..c6cc11f 100644
--- a/sync/tools/sync_listen_notifications.cc
+++ b/sync/tools/sync_listen_notifications.cc
@@ -201,8 +201,8 @@ int SyncListenNotificationsMain(int argc, char* argv[]) {
// Listen for notifications for all known types.
invalidator->RegisterHandler(&notification_printer);
- invalidator->UpdateRegisteredIds(
- &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
+ CHECK(invalidator->UpdateRegisteredIds(
+ &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All())));
ui_loop.Run();