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

Unified Diff: chrome/browser/sync/engine/syncer_proto_util.cc

Issue 6104003: sync: use progress markers instead of timestamps during GetUpdates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tim's fixes Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/engine/syncer_end_command.cc ('k') | chrome/browser/sync/engine/syncer_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/engine/syncer_proto_util.cc
diff --git a/chrome/browser/sync/engine/syncer_proto_util.cc b/chrome/browser/sync/engine/syncer_proto_util.cc
index 2603b0ad6b5799dc143c7a1f9c9647de57560f11..5dbb20232ac32fa55f2b5d96f7285566c200af24 100644
--- a/chrome/browser/sync/engine/syncer_proto_util.cc
+++ b/chrome/browser/sync/engine/syncer_proto_util.cc
@@ -167,6 +167,22 @@ bool SyncerProtoUtil::PostAndProcessHeaders(ServerConnectionManager* scm,
return false;
}
+namespace {
+
+// Helper function for an assertion in PostClientToServerMessage.
+bool IsVeryFirstGetUpdates(const ClientToServerMessage& message) {
+ if (!message.has_get_updates())
+ return false;
+ DCHECK_LT(0, message.get_updates().from_progress_marker_size());
+ for (int i = 0; i < message.get_updates().from_progress_marker_size(); ++i) {
+ if (!message.get_updates().from_progress_marker(i).token().empty())
+ return false;
+ }
+ return true;
+}
+
+} // namespace
+
// static
bool SyncerProtoUtil::PostClientToServerMessage(
const ClientToServerMessage& msg,
@@ -174,9 +190,9 @@ bool SyncerProtoUtil::PostClientToServerMessage(
SyncSession* session) {
CHECK(response);
- DCHECK(msg.has_store_birthday() || (msg.has_get_updates() &&
- msg.get_updates().has_from_timestamp() &&
- msg.get_updates().from_timestamp() == 0))
+ DCHECK(!msg.get_updates().has_from_timestamp()); // Deprecated.
+ DCHECK(!msg.get_updates().has_requested_types()); // Deprecated.
+ DCHECK(msg.has_store_birthday() || IsVeryFirstGetUpdates(msg))
<< "Must call AddRequestBirthday to set birthday.";
ScopedDirLookup dir(session->context()->directory_manager(),
« no previous file with comments | « chrome/browser/sync/engine/syncer_end_command.cc ('k') | chrome/browser/sync/engine/syncer_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698