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

Side by Side Diff: sync/tools/null_invalidation_state_tracker.cc

Issue 11415049: Implement features needed for local ack handling in InvalidationStateTracker. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ...... Created 8 years 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/tools/null_invalidation_state_tracker.h ('k') | sync/tools/sync_client.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/tools/null_invalidation_state_tracker.h"
6
7 #include "base/base64.h"
8 #include "base/bind.h"
9 #include "base/callback.h"
10 #include "base/location.h"
11 #include "base/logging.h"
12 #include "base/task_runner.h"
13 #include "sync/notifier/invalidation_util.h"
14
15 namespace syncer {
16
17 NullInvalidationStateTracker::NullInvalidationStateTracker() {}
18 NullInvalidationStateTracker::~NullInvalidationStateTracker() {}
19
20 InvalidationStateMap
21 NullInvalidationStateTracker::GetAllInvalidationStates() const {
22 return InvalidationStateMap();
23 }
24
25 void NullInvalidationStateTracker::SetMaxVersionAndPayload(
26 const invalidation::ObjectId& id,
27 int64 max_invalidation_version,
28 const std::string& payload) {
29 LOG(INFO) << "Setting max invalidation version for "
30 << ObjectIdToString(id) << " to " << max_invalidation_version
31 << " with payload " << payload;
32 }
33
34 void NullInvalidationStateTracker::Forget(const ObjectIdSet& ids) {
35 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) {
36 LOG(INFO) << "Forgetting invalidation state for " << ObjectIdToString(*it);
37 }
38 }
39
40 std::string NullInvalidationStateTracker::GetBootstrapData() const {
41 return std::string();
42 }
43
44 void NullInvalidationStateTracker::SetBootstrapData(const std::string& data) {
45 std::string base64_data;
46 CHECK(base::Base64Encode(data, &base64_data));
47 LOG(INFO) << "Setting bootstrap data to: " << base64_data;
48 }
49
50 void NullInvalidationStateTracker::GenerateAckHandles(
51 const ObjectIdSet& ids,
52 const scoped_refptr<base::TaskRunner>& task_runner,
53 base::Callback<void(const AckHandleMap&)> callback) {
54 AckHandleMap ack_handles;
55 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) {
56 ack_handles.insert(std::make_pair(*it, AckHandle::InvalidAckHandle()));
57 }
58 CHECK(task_runner->PostTask(FROM_HERE, base::Bind(callback, ack_handles)));
59 }
60
61 void NullInvalidationStateTracker::Acknowledge(const invalidation::ObjectId& id,
62 const AckHandle& ack_handle) {
63 LOG(INFO) << "Received ack for " << ObjectIdToString(id);
64 }
65
66 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/tools/null_invalidation_state_tracker.h ('k') | sync/tools/sync_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698