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

Side by Side Diff: sync/notifier/fake_invalidator.cc

Issue 13197004: Draft: InvalidationService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Passes tests Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "sync/notifier/fake_invalidator.h"
6
7 namespace syncer {
8
9 FakeInvalidator::FakeInvalidator() {}
10
11 FakeInvalidator::~FakeInvalidator() {}
12
13 bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler* handler) const {
14 return registrar_.IsHandlerRegisteredForTest(handler);
15 }
16
17 ObjectIdSet FakeInvalidator::GetRegisteredIds(
18 InvalidationHandler* handler) const {
19 return registrar_.GetRegisteredIds(handler);
20 }
21
22 const std::string& FakeInvalidator::GetCredentialsEmail() const {
23 return email_;
24 }
25
26 const std::string& FakeInvalidator::GetCredentialsToken() const {
27 return token_;
28 }
29
30 const ObjectIdInvalidationMap&
31 FakeInvalidator::GetLastSentInvalidationMap() const {
32 return last_sent_invalidation_map_;
33 }
34
35 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) {
36 registrar_.UpdateInvalidatorState(state);
37 }
38
39 void FakeInvalidator::EmitOnIncomingInvalidation(
40 const ObjectIdInvalidationMap& invalidation_map) {
41 registrar_.DispatchInvalidationsToHandlers(invalidation_map);
42 }
43
44 void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) {
45 registrar_.RegisterHandler(handler);
46 }
47
48 void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
49 const ObjectIdSet& ids) {
50 registrar_.UpdateRegisteredIds(handler, ids);
51 }
52
53 void FakeInvalidator::UnregisterHandler(InvalidationHandler* handler) {
54 registrar_.UnregisterHandler(handler);
55 }
56
57 void FakeInvalidator::Acknowledge(const invalidation::ObjectId& id,
58 const AckHandle& ack_handle) {
59 // Do nothing.
60 }
61
62 InvalidatorState FakeInvalidator::GetInvalidatorState() const {
63 return registrar_.GetInvalidatorState();
64 }
65
66 void FakeInvalidator::UpdateCredentials(
67 const std::string& email, const std::string& token) {
68 email_ = email;
69 token_ = token;
70 }
71
72 void FakeInvalidator::SendInvalidation(
73 const ObjectIdInvalidationMap& invalidation_map) {
74 last_sent_invalidation_map_ = invalidation_map;
75 }
76
77 } // namespace syncer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698