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

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

Issue 2844037: Fix handling of undeletion within the syncer. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Whitespace. Created 10 years, 5 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
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 b54362cdc254d68f67ee779e291083140f051f25..76e163af7032d04bf91b09ba94e1c0bc89b94035 100644
--- a/chrome/browser/sync/engine/syncer_proto_util.cc
+++ b/chrome/browser/sync/engine/syncer_proto_util.cc
@@ -119,11 +119,11 @@ void SyncerProtoUtil::AddRequestBirthday(syncable::Directory* dir,
// static
bool SyncerProtoUtil::PostAndProcessHeaders(ServerConnectionManager* scm,
AuthWatcher* auth_watcher,
- ClientToServerMessage* msg,
+ const ClientToServerMessage& msg,
ClientToServerResponse* response) {
std::string tx, rx;
- msg->SerializeToString(&tx);
+ msg.SerializeToString(&tx);
HttpResponse http_response;
ServerConnectionManager::PostBufferParams params = {
@@ -165,10 +165,16 @@ bool SyncerProtoUtil::PostAndProcessHeaders(ServerConnectionManager* scm,
}
// static
-bool SyncerProtoUtil::PostClientToServerMessage(ClientToServerMessage* msg,
- ClientToServerResponse* response, SyncSession* session) {
+bool SyncerProtoUtil::PostClientToServerMessage(
+ const ClientToServerMessage& msg,
+ ClientToServerResponse* response,
+ 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))
+ << "Must call AddRequestBirthday to set birthday.";
ScopedDirLookup dir(session->context()->directory_manager(),
session->context()->account_name());
@@ -176,8 +182,6 @@ bool SyncerProtoUtil::PostClientToServerMessage(ClientToServerMessage* msg,
return false;
}
- AddRequestBirthday(dir, msg);
-
if (!PostAndProcessHeaders(session->context()->connection_manager(),
session->context()->auth_watcher(),
msg,
@@ -287,10 +291,10 @@ void SyncerProtoUtil::CopyBlobIntoProtoBytes(const syncable::Blob& blob,
// static
const std::string& SyncerProtoUtil::NameFromSyncEntity(
- const SyncEntity& entry) {
+ const sync_pb::SyncEntity& entry) {
if (entry.has_non_unique_name()) {
- return entry.non_unique_name();
+ return entry.non_unique_name();
}
return entry.name();
« no previous file with comments | « chrome/browser/sync/engine/syncer_proto_util.h ('k') | chrome/browser/sync/engine/syncer_proto_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698