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

Unified Diff: sync/engine/process_updates_command.cc

Issue 10735041: Remove syncproto.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address most comments Created 8 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
« no previous file with comments | « sync/engine/process_commit_response_command_unittest.cc ('k') | sync/engine/store_timestamps_command.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/engine/process_updates_command.cc
diff --git a/sync/engine/process_updates_command.cc b/sync/engine/process_updates_command.cc
index f239a6a005a8d2b54974265ec5730ffe8903f995..ccf3def637663b5abab0c9cc38e462637d0562aa 100644
--- a/sync/engine/process_updates_command.cc
+++ b/sync/engine/process_updates_command.cc
@@ -11,10 +11,10 @@
#include "sync/engine/syncer.h"
#include "sync/engine/syncer_proto_util.h"
#include "sync/engine/syncer_util.h"
-#include "sync/engine/syncproto.h"
#include "sync/sessions/sync_session.h"
#include "sync/syncable/directory.h"
#include "sync/syncable/mutable_entry.h"
+#include "sync/syncable/syncable_proto_util.h"
#include "sync/syncable/syncable_util.h"
#include "sync/syncable/write_transaction.h"
#include "sync/util/cryptographer.h"
@@ -72,12 +72,13 @@ SyncerError ProcessUpdatesCommand::ModelChangingExecuteImpl(
namespace {
// Returns true if the entry is still ok to process.
-bool ReverifyEntry(syncable::WriteTransaction* trans, const SyncEntity& entry,
+bool ReverifyEntry(syncable::WriteTransaction* trans,
+ const sync_pb::SyncEntity& entry,
syncable::MutableEntry* same_id) {
const bool deleted = entry.has_deleted() && entry.deleted();
- const bool is_directory = entry.IsFolder();
- const syncer::ModelType model_type = entry.GetModelType();
+ const bool is_directory = IsFolder(entry);
+ const syncer::ModelType model_type = GetModelType(entry);
return VERIFY_SUCCESS == VerifyUpdateConsistency(trans,
entry,
@@ -90,12 +91,10 @@ bool ReverifyEntry(syncable::WriteTransaction* trans, const SyncEntity& entry,
// Process a single update. Will avoid touching global state.
ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
- const sync_pb::SyncEntity& proto_update,
+ const sync_pb::SyncEntity& update,
const Cryptographer* cryptographer,
syncable::WriteTransaction* const trans) {
-
- const SyncEntity& update = *static_cast<const SyncEntity*>(&proto_update);
- syncable::Id server_id = update.id();
+ const syncable::Id& server_id = SyncableIdFromProto(update.id_string());
const std::string name = SyncerProtoUtil::NameFromSyncEntity(update);
// Look to see if there's a local item that should recieve this update,
@@ -150,7 +149,8 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
// overwrite SERVER_SPECIFICS.
// MTIME, CTIME, and NON_UNIQUE_NAME are not enforced.
if (!update.deleted() && !target_entry.Get(syncable::SERVER_IS_DEL) &&
- (update.parent_id() == target_entry.Get(syncable::SERVER_PARENT_ID)) &&
+ (SyncableIdFromProto(update.parent_id_string()) ==
+ target_entry.Get(syncable::SERVER_PARENT_ID)) &&
(update.position_in_parent() ==
target_entry.Get(syncable::SERVER_POSITION_IN_PARENT)) &&
update.has_specifics() && update.specifics().has_encrypted() &&
« no previous file with comments | « sync/engine/process_commit_response_command_unittest.cc ('k') | sync/engine/store_timestamps_command.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698