| OLD | NEW |
| 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 29 matching lines...) Expand all Loading... |
| 40 std::string NullInvalidationStateTracker::GetBootstrapData() const { | 40 std::string NullInvalidationStateTracker::GetBootstrapData() const { |
| 41 return std::string(); | 41 return std::string(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void NullInvalidationStateTracker::SetBootstrapData(const std::string& data) { | 44 void NullInvalidationStateTracker::SetBootstrapData(const std::string& data) { |
| 45 std::string base64_data; | 45 std::string base64_data; |
| 46 CHECK(base::Base64Encode(data, &base64_data)); | 46 CHECK(base::Base64Encode(data, &base64_data)); |
| 47 LOG(INFO) << "Setting bootstrap data to: " << base64_data; | 47 LOG(INFO) << "Setting bootstrap data to: " << base64_data; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void NullInvalidationStateTracker::Clear() { |
| 51 // We have no members to clear. |
| 52 } |
| 53 |
| 50 void NullInvalidationStateTracker::GenerateAckHandles( | 54 void NullInvalidationStateTracker::GenerateAckHandles( |
| 51 const ObjectIdSet& ids, | 55 const ObjectIdSet& ids, |
| 52 const scoped_refptr<base::TaskRunner>& task_runner, | 56 const scoped_refptr<base::TaskRunner>& task_runner, |
| 53 base::Callback<void(const AckHandleMap&)> callback) { | 57 base::Callback<void(const AckHandleMap&)> callback) { |
| 54 AckHandleMap ack_handles; | 58 AckHandleMap ack_handles; |
| 55 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) { | 59 for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) { |
| 56 ack_handles.insert(std::make_pair(*it, AckHandle::InvalidAckHandle())); | 60 ack_handles.insert(std::make_pair(*it, AckHandle::InvalidAckHandle())); |
| 57 } | 61 } |
| 58 CHECK(task_runner->PostTask(FROM_HERE, base::Bind(callback, ack_handles))); | 62 CHECK(task_runner->PostTask(FROM_HERE, base::Bind(callback, ack_handles))); |
| 59 } | 63 } |
| 60 | 64 |
| 61 void NullInvalidationStateTracker::Acknowledge(const invalidation::ObjectId& id, | 65 void NullInvalidationStateTracker::Acknowledge(const invalidation::ObjectId& id, |
| 62 const AckHandle& ack_handle) { | 66 const AckHandle& ack_handle) { |
| 63 LOG(INFO) << "Received ack for " << ObjectIdToString(id); | 67 LOG(INFO) << "Received ack for " << ObjectIdToString(id); |
| 64 } | 68 } |
| 65 | 69 |
| 66 } // namespace syncer | 70 } // namespace syncer |
| OLD | NEW |