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

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

Issue 294123004: Move some sync/notifier to components/invalidation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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
« no previous file with comments | « sync/notifier/fake_invalidator.h ('k') | sync/notifier/fake_invalidator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "sync/notifier/object_id_invalidation_map.h"
8
9 namespace syncer {
10
11 FakeInvalidator::FakeInvalidator() {}
12
13 FakeInvalidator::~FakeInvalidator() {}
14
15 bool FakeInvalidator::IsHandlerRegistered(InvalidationHandler* handler) const {
16 return registrar_.IsHandlerRegisteredForTest(handler);
17 }
18
19 ObjectIdSet FakeInvalidator::GetRegisteredIds(
20 InvalidationHandler* handler) const {
21 return registrar_.GetRegisteredIds(handler);
22 }
23
24 const std::string& FakeInvalidator::GetCredentialsEmail() const {
25 return email_;
26 }
27
28 const std::string& FakeInvalidator::GetCredentialsToken() const {
29 return token_;
30 }
31
32 void FakeInvalidator::EmitOnInvalidatorStateChange(InvalidatorState state) {
33 registrar_.UpdateInvalidatorState(state);
34 }
35
36 void FakeInvalidator::EmitOnIncomingInvalidation(
37 const ObjectIdInvalidationMap& invalidation_map) {
38 registrar_.DispatchInvalidationsToHandlers(invalidation_map);
39 }
40
41 void FakeInvalidator::RegisterHandler(InvalidationHandler* handler) {
42 registrar_.RegisterHandler(handler);
43 }
44
45 void FakeInvalidator::UpdateRegisteredIds(InvalidationHandler* handler,
46 const ObjectIdSet& ids) {
47 registrar_.UpdateRegisteredIds(handler, ids);
48 }
49
50 void FakeInvalidator::UnregisterHandler(InvalidationHandler* handler) {
51 registrar_.UnregisterHandler(handler);
52 }
53
54 InvalidatorState FakeInvalidator::GetInvalidatorState() const {
55 return registrar_.GetInvalidatorState();
56 }
57
58 void FakeInvalidator::UpdateCredentials(
59 const std::string& email, const std::string& token) {
60 email_ = email;
61 token_ = token;
62 }
63
64 void FakeInvalidator::RequestDetailedStatus(
65 base::Callback<void(const base::DictionaryValue&)> callback) const {
66 base::DictionaryValue value;
67 callback.Run(value);
68 }
69 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/notifier/fake_invalidator.h ('k') | sync/notifier/fake_invalidator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698