Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Side by Side Diff: chrome/browser/invalidation/fake_invalidation_service.cc

Issue 1146533005: [Sync] InvalidationService shouldn't CHECK when registering ObjectId for more than one handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments from Bartosz. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/invalidation/fake_invalidation_service.h" 5 #include "chrome/browser/invalidation/fake_invalidation_service.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/invalidation/invalidation_service_util.h" 9 #include "components/invalidation/invalidation_service_util.h"
10 #include "components/invalidation/object_id_invalidation_map.h" 10 #include "components/invalidation/object_id_invalidation_map.h"
11 11
12 namespace invalidation { 12 namespace invalidation {
13 13
14 FakeInvalidationService::FakeInvalidationService() 14 FakeInvalidationService::FakeInvalidationService()
15 : client_id_(GenerateInvalidatorClientId()), 15 : client_id_(GenerateInvalidatorClientId()),
16 identity_provider_(&token_service_) { 16 identity_provider_(&token_service_) {
17 invalidator_registrar_.UpdateInvalidatorState(syncer::INVALIDATIONS_ENABLED); 17 invalidator_registrar_.UpdateInvalidatorState(syncer::INVALIDATIONS_ENABLED);
18 token_service_.set_auto_post_fetch_response_on_message_loop(true); 18 token_service_.set_auto_post_fetch_response_on_message_loop(true);
19 } 19 }
20 20
21 FakeInvalidationService::~FakeInvalidationService() { 21 FakeInvalidationService::~FakeInvalidationService() {
22 } 22 }
23 23
24 void FakeInvalidationService::RegisterInvalidationHandler( 24 void FakeInvalidationService::RegisterInvalidationHandler(
25 syncer::InvalidationHandler* handler) { 25 syncer::InvalidationHandler* handler) {
26 invalidator_registrar_.RegisterHandler(handler); 26 invalidator_registrar_.RegisterHandler(handler);
27 } 27 }
28 28
29 void FakeInvalidationService::UpdateRegisteredInvalidationIds( 29 bool FakeInvalidationService::UpdateRegisteredInvalidationIds(
30 syncer::InvalidationHandler* handler, 30 syncer::InvalidationHandler* handler,
31 const syncer::ObjectIdSet& ids) { 31 const syncer::ObjectIdSet& ids) {
32 invalidator_registrar_.UpdateRegisteredIds(handler, ids); 32 return invalidator_registrar_.UpdateRegisteredIds(handler, ids);
33 } 33 }
34 34
35 void FakeInvalidationService::UnregisterInvalidationHandler( 35 void FakeInvalidationService::UnregisterInvalidationHandler(
36 syncer::InvalidationHandler* handler) { 36 syncer::InvalidationHandler* handler) {
37 invalidator_registrar_.UnregisterHandler(handler); 37 invalidator_registrar_.UnregisterHandler(handler);
38 } 38 }
39 39
40 syncer::InvalidatorState FakeInvalidationService::GetInvalidatorState() const { 40 syncer::InvalidatorState FakeInvalidationService::GetInvalidatorState() const {
41 return invalidator_registrar_.GetInvalidatorState(); 41 return invalidator_registrar_.GetInvalidatorState();
42 } 42 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 syncer::ObjectIdInvalidationMap invalidation_map; 84 syncer::ObjectIdInvalidationMap invalidation_map;
85 invalidation_map.Insert(invalidation_copy); 85 invalidation_map.Insert(invalidation_copy);
86 invalidator_registrar_.DispatchInvalidationsToHandlers(invalidation_map); 86 invalidator_registrar_.DispatchInvalidationsToHandlers(invalidation_map);
87 } 87 }
88 88
89 syncer::MockAckHandler* FakeInvalidationService::GetMockAckHandler() { 89 syncer::MockAckHandler* FakeInvalidationService::GetMockAckHandler() {
90 return &mock_ack_handler_; 90 return &mock_ack_handler_;
91 } 91 }
92 92
93 } // namespace invalidation 93 } // namespace invalidation
OLDNEW
« no previous file with comments | « chrome/browser/invalidation/fake_invalidation_service.h ('k') | chrome/browser/policy/cloud/cloud_policy_invalidator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698