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

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

Issue 12847003: Separate invalidator and sync client ID (part 2/2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_listen_notifications utility Created 7 years, 9 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/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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 "sync/tools/null_invalidation_state_tracker.h" 5 #include "sync/tools/null_invalidation_state_tracker.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 25 matching lines...) Expand all
36 LOG(INFO) << "Forgetting invalidation state for " << ObjectIdToString(*it); 36 LOG(INFO) << "Forgetting invalidation state for " << ObjectIdToString(*it);
37 } 37 }
38 } 38 }
39 39
40 void NullInvalidationStateTracker::SetInvalidatorClientId( 40 void NullInvalidationStateTracker::SetInvalidatorClientId(
41 const std::string& data) { 41 const std::string& data) {
42 LOG(INFO) << "Setting invalidator client ID to: " << data; 42 LOG(INFO) << "Setting invalidator client ID to: " << data;
43 } 43 }
44 44
45 std::string NullInvalidationStateTracker::GetInvalidatorClientId() const { 45 std::string NullInvalidationStateTracker::GetInvalidatorClientId() const {
46 // The caller of this function is probably looking for an ID it can use to
47 // identify this client as the originator of some notifiable change. It does
48 // this so the invalidation server can prevent it from being notified of its
49 // own changes. This invalidation state tracker doesn't remember its ID, so
50 // it can't support this feature.
51 NOTREACHED() << "This state tracker does not support reflection-blocking";
46 return std::string(); 52 return std::string();
47 } 53 }
48 54
49 std::string NullInvalidationStateTracker::GetBootstrapData() const { 55 std::string NullInvalidationStateTracker::GetBootstrapData() const {
50 return std::string(); 56 return std::string();
51 } 57 }
52 58
53 void NullInvalidationStateTracker::SetBootstrapData(const std::string& data) { 59 void NullInvalidationStateTracker::SetBootstrapData(const std::string& data) {
54 std::string base64_data; 60 std::string base64_data;
55 CHECK(base::Base64Encode(data, &base64_data)); 61 CHECK(base::Base64Encode(data, &base64_data));
56 LOG(INFO) << "Setting bootstrap data to: " << base64_data; 62 LOG(INFO) << "Setting bootstrap data to: " << base64_data;
57 } 63 }
58 64
65 void NullInvalidationStateTracker::Clear() {
66 // We have no members to clear.
67 }
68
59 void NullInvalidationStateTracker::GenerateAckHandles( 69 void NullInvalidationStateTracker::GenerateAckHandles(
60 const ObjectIdSet& ids, 70 const ObjectIdSet& ids,
61 const scoped_refptr<base::TaskRunner>& task_runner, 71 const scoped_refptr<base::TaskRunner>& task_runner,
62 base::Callback<void(const AckHandleMap&)> callback) { 72 base::Callback<void(const AckHandleMap&)> callback) {
63 AckHandleMap ack_handles; 73 AckHandleMap ack_handles;
64 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) { 74 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) {
65 ack_handles.insert(std::make_pair(*it, AckHandle::InvalidAckHandle())); 75 ack_handles.insert(std::make_pair(*it, AckHandle::InvalidAckHandle()));
66 } 76 }
67 CHECK(task_runner->PostTask(FROM_HERE, base::Bind(callback, ack_handles))); 77 CHECK(task_runner->PostTask(FROM_HERE, base::Bind(callback, ack_handles)));
68 } 78 }
69 79
70 void NullInvalidationStateTracker::Acknowledge(const invalidation::ObjectId& id, 80 void NullInvalidationStateTracker::Acknowledge(const invalidation::ObjectId& id,
71 const AckHandle& ack_handle) { 81 const AckHandle& ack_handle) {
72 LOG(INFO) << "Received ack for " << ObjectIdToString(id); 82 LOG(INFO) << "Received ack for " << ObjectIdToString(id);
73 } 83 }
74 84
75 } // namespace syncer 85 } // 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