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

Unified Diff: chrome/browser/sync/glue/generic_change_processor.cc

Issue 7918001: [Sync] Move ChangeRecord into its own file (change_record.{h,cc}) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 9 years, 3 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/glue/generic_change_processor.cc
diff --git a/chrome/browser/sync/glue/generic_change_processor.cc b/chrome/browser/sync/glue/generic_change_processor.cc
index dd1aea02e11f4422184134188d4ec7eb02735c77..ed20dd58f04744cead5dc316bb280cbd75bf1f68 100644
--- a/chrome/browser/sync/glue/generic_change_processor.cc
+++ b/chrome/browser/sync/glue/generic_change_processor.cc
@@ -9,9 +9,9 @@
#include "chrome/browser/sync/api/syncable_service.h"
#include "chrome/browser/sync/api/sync_change.h"
#include "chrome/browser/sync/api/sync_error.h"
+#include "chrome/browser/sync/internal_api/change_record.h"
#include "chrome/browser/sync/internal_api/read_node.h"
#include "chrome/browser/sync/internal_api/read_transaction.h"
-#include "chrome/browser/sync/internal_api/sync_manager.h"
#include "chrome/browser/sync/internal_api/write_node.h"
#include "chrome/browser/sync/internal_api/write_transaction.h"
#include "chrome/browser/sync/unrecoverable_error_handler.h"
@@ -35,20 +35,18 @@ GenericChangeProcessor::~GenericChangeProcessor() {
void GenericChangeProcessor::ApplyChangesFromSyncModel(
const sync_api::BaseTransaction* trans,
- const sync_api::SyncManager::ChangeRecord* changes,
- int change_count) {
+ const sync_api::ImmutableChangeRecordList& changes) {
DCHECK(running());
DCHECK(syncer_changes_.empty());
- for (int i = 0; i < change_count; ++i) {
+ for (sync_api::ChangeRecordList::const_iterator it =
+ changes.Get().begin(); it != changes.Get().end(); ++it) {
SyncChange::SyncChangeType action;
sync_pb::EntitySpecifics const* specifics = NULL;
- if (sync_api::SyncManager::ChangeRecord::ACTION_DELETE ==
- changes[i].action) {
+ if (sync_api::ChangeRecord::ACTION_DELETE == it->action) {
action = SyncChange::ACTION_DELETE;
- specifics = &changes[i].specifics;
+ specifics = &it->specifics;
DCHECK(specifics);
- } else if (sync_api::SyncManager::ChangeRecord::ACTION_ADD ==
- changes[i].action) {
+ } else if (sync_api::ChangeRecord::ACTION_ADD == it->action) {
action = SyncChange::ACTION_ADD;
} else { // ACTION_UPDATE.
action = SyncChange::ACTION_UPDATE;
@@ -56,9 +54,9 @@ void GenericChangeProcessor::ApplyChangesFromSyncModel(
if (!specifics) {
// Need to load from node.
sync_api::ReadNode read_node(trans);
- if (!read_node.InitByIdLookup(changes[i].id)) {
+ if (!read_node.InitByIdLookup(it->id)) {
error_handler()->OnUnrecoverableError(FROM_HERE, "Failed to look up "
- " data for received change with id " + changes[i].id);
+ " data for received change with id " + it->id);
return;
}
syncer_changes_.push_back(SyncChange(action,
« no previous file with comments | « chrome/browser/sync/glue/generic_change_processor.h ('k') | chrome/browser/sync/glue/password_change_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698