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

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: Improve DCHECKing, fix tests 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
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..86c49ecb8d6f16c2ce94fff2c6f61602a22cae86 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,
@@ -94,8 +95,9 @@ ServerUpdateProcessingResult ProcessUpdatesCommand::ProcessUpdate(
const Cryptographer* cryptographer,
syncable::WriteTransaction* const trans) {
- const SyncEntity& update = *static_cast<const SyncEntity*>(&proto_update);
- syncable::Id server_id = update.id();
+ const sync_pb::SyncEntity& update =
+ *static_cast<const sync_pb::SyncEntity*>(&proto_update);
akalin 2012/07/11 01:42:22 static cast
rlarocque 2012/07/11 19:22:16 Done.
+ 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 +152,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() &&

Powered by Google App Engine
This is Rietveld 408576698