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

Unified Diff: sync/tools/sync_listen_notifications.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, 1 month 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 side-by-side diff with in-line comments
Download patch
« sync/tools/sync_client.cc ('K') | « sync/tools/sync_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/tools/sync_listen_notifications.cc
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc
index bc9008815be70466f1b20225b2ed5f74607cf215..f52429875c99e5b3f50251d3fddaebf3731f1ff2 100644
--- a/sync/tools/sync_listen_notifications.cc
+++ b/sync/tools/sync_listen_notifications.cc
@@ -8,8 +8,11 @@
#include "base/at_exit.h"
#include "base/base64.h"
+#include "base/bind.h"
+#include "base/callback.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
+#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -89,11 +92,13 @@ class NullInvalidationStateTracker
return InvalidationStateMap();
}
- virtual void SetMaxVersion(
+ virtual void SetMaxVersionAndPayload(
const invalidation::ObjectId& id,
- int64 max_invalidation_version) OVERRIDE {
+ int64 max_invalidation_version,
+ const std::string& payload) OVERRIDE {
LOG(INFO) << "Setting max invalidation version for "
- << ObjectIdToString(id) << " to " << max_invalidation_version;
+ << ObjectIdToString(id) << " to " << max_invalidation_version
+ << " with payload " << payload;
}
virtual void Forget(const ObjectIdSet& ids) OVERRIDE {
@@ -111,6 +116,22 @@ class NullInvalidationStateTracker
CHECK(base::Base64Encode(data, &base64_data));
LOG(INFO) << "Setting bootstrap data to: " << base64_data;
akalin 2012/11/28 00:11:42 boo, duplicated code. can you pull this out into
dcheng 2012/11/30 01:42:54 Done. There's some TODOs with your name attached f
akalin 2012/11/30 02:54:31 There's one more -- the MyTestURLRequestContext, e
}
+
+ virtual void GenerateAckHandles(
+ const ObjectIdSet& ids,
+ const scoped_refptr<base::TaskRunner>& task_runner,
+ base::Callback<void(const AckHandleMap&)> callback) OVERRIDE {
+ AckHandleMap ack_handles;
+ for (ObjectIdSet::const_iterator it = ids.begin(); it != ids.end(); ++it) {
+ ack_handles.insert(std::make_pair(*it, AckHandle::InvalidAckHandle()));
+ }
+ task_runner->PostTask(FROM_HERE, base::Bind(callback, ack_handles));
akalin 2012/11/28 00:11:42 process return values (CHECK?)
dcheng 2012/11/30 01:42:54 Done.
+ }
+
+ virtual void Acknowledge(const invalidation::ObjectId& id,
+ const AckHandle& ack_handle) OVERRIDE {
+ LOG(INFO) << "Received ack for " << ObjectIdToString(id);
+ }
};
// Needed to use a real host resolver.
« sync/tools/sync_client.cc ('K') | « sync/tools/sync_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698