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

Unified Diff: components/sync/engine_impl/directory_update_handler.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 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: components/sync/engine_impl/directory_update_handler.cc
diff --git a/sync/engine/directory_update_handler.cc b/components/sync/engine_impl/directory_update_handler.cc
similarity index 87%
rename from sync/engine/directory_update_handler.cc
rename to components/sync/engine_impl/directory_update_handler.cc
index d1e515db622b2c911b2916586ceb6c0e5d416d4a..71fa4c39a3f6b46ef5aef817c22231a6c6e1cabb 100644
--- a/sync/engine/directory_update_handler.cc
+++ b/components/sync/engine_impl/directory_update_handler.cc
@@ -2,22 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/engine/directory_update_handler.h"
+#include "components/sync/engine_impl/directory_update_handler.h"
#include <stdint.h>
#include <vector>
-#include "sync/engine/conflict_resolver.h"
-#include "sync/engine/process_updates_util.h"
-#include "sync/engine/update_applicator.h"
-#include "sync/sessions/directory_type_debug_info_emitter.h"
-#include "sync/syncable/directory.h"
-#include "sync/syncable/model_neutral_mutable_entry.h"
-#include "sync/syncable/syncable_changes_version.h"
-#include "sync/syncable/syncable_model_neutral_write_transaction.h"
-#include "sync/syncable/syncable_write_transaction.h"
-#include "sync/util/data_type_histogram.h"
+#include "components/sync/base/data_type_histogram.h"
+#include "components/sync/engine_impl/conflict_resolver.h"
+#include "components/sync/engine_impl/process_updates_util.h"
+#include "components/sync/engine_impl/update_applicator.h"
+#include "components/sync/sessions_impl/directory_type_debug_info_emitter.h"
+#include "components/sync/syncable/directory.h"
+#include "components/sync/syncable/model_neutral_mutable_entry.h"
+#include "components/sync/syncable/syncable_changes_version.h"
+#include "components/sync/syncable/syncable_model_neutral_write_transaction.h"
+#include "components/sync/syncable/syncable_write_transaction.h"
namespace syncer {
@@ -28,10 +28,10 @@ DirectoryUpdateHandler::DirectoryUpdateHandler(
ModelType type,
scoped_refptr<ModelSafeWorker> worker,
DirectoryTypeDebugInfoEmitter* debug_info_emitter)
- : dir_(dir),
- type_(type),
- worker_(worker),
- debug_info_emitter_(debug_info_emitter) {}
+ : dir_(dir),
+ type_(type),
+ worker_(worker),
+ debug_info_emitter_(debug_info_emitter) {}
DirectoryUpdateHandler::~DirectoryUpdateHandler() {}
@@ -153,10 +153,8 @@ SyncerError DirectoryUpdateHandler::ApplyUpdatesImpl(
syncable::WriteTransaction trans(FROM_HERE, syncable::SYNCER, dir_);
std::vector<int64_t> handles;
- dir_->GetUnappliedUpdateMetaHandles(
- &trans,
- FullModelTypeSet(type_),
- &handles);
+ dir_->GetUnappliedUpdateMetaHandles(&trans, FullModelTypeSet(type_),
+ &handles);
// First set of update application passes.
UpdateApplicator applicator(dir_->GetCryptographer(&trans));
@@ -180,18 +178,14 @@ SyncerError DirectoryUpdateHandler::ApplyUpdatesImpl(
if (applicator.simple_conflict_ids().size() != 0) {
// Resolve the simple conflicts we just detected.
ConflictResolver resolver;
- resolver.ResolveConflicts(&trans,
- dir_->GetCryptographer(&trans),
- applicator.simple_conflict_ids(),
- status,
+ resolver.ResolveConflicts(&trans, dir_->GetCryptographer(&trans),
+ applicator.simple_conflict_ids(), status,
counters);
// Conflict resolution sometimes results in more updates to apply.
handles.clear();
- dir_->GetUnappliedUpdateMetaHandles(
- &trans,
- FullModelTypeSet(type_),
- &handles);
+ dir_->GetUnappliedUpdateMetaHandles(&trans, FullModelTypeSet(type_),
+ &handles);
UpdateApplicator conflict_applicator(dir_->GetCryptographer(&trans));
conflict_applicator.AttemptApplications(&trans, handles);
@@ -255,8 +249,8 @@ void DirectoryUpdateHandler::UpdateSyncEntities(
sessions::StatusController* status) {
UpdateCounters* counters = debug_info_emitter_->GetMutableUpdateCounters();
counters->num_updates_received += applicable_updates.size();
- ProcessDownloadedUpdates(dir_, trans, type_,
- applicable_updates, status, counters);
+ ProcessDownloadedUpdates(dir_, trans, type_, applicable_updates, status,
+ counters);
}
bool DirectoryUpdateHandler::IsValidProgressMarker(
@@ -267,10 +261,9 @@ bool DirectoryUpdateHandler::IsValidProgressMarker(
int field_number = progress_marker.data_type_id();
ModelType model_type = GetModelTypeFromSpecificsFieldNumber(field_number);
if (!IsRealDataType(model_type) || type_ != model_type) {
- NOTREACHED()
- << "Update handler of type " << ModelTypeToString(type_)
- << " asked to process progress marker with invalid type "
- << field_number;
+ NOTREACHED() << "Update handler of type " << ModelTypeToString(type_)
+ << " asked to process progress marker with invalid type "
+ << field_number;
return false;
}
return true;
@@ -307,8 +300,8 @@ void DirectoryUpdateHandler::ExpireEntriesIfNeeded(
if (new_gc_directive.has_version_watermark() &&
(!cached_gc_directive_ ||
- cached_gc_directive_->version_watermark() <
- new_gc_directive.version_watermark())) {
+ cached_gc_directive_->version_watermark() <
+ new_gc_directive.version_watermark())) {
ExpireEntriesByVersion(dir_, trans, type_,
new_gc_directive.version_watermark());
}

Powered by Google App Engine
This is Rietveld 408576698