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