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

Side by Side Diff: sync/engine/directory_update_handler.cc

Issue 948113005: Sync: Small refactoring of Directory::CheckTreeInvariants (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | sync/engine/syncer_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sync/engine/directory_update_handler.h" 5 #include "sync/engine/directory_update_handler.h"
6 6
7 #include "sync/engine/conflict_resolver.h" 7 #include "sync/engine/conflict_resolver.h"
8 #include "sync/engine/process_updates_util.h" 8 #include "sync/engine/process_updates_util.h"
9 #include "sync/engine/update_applicator.h" 9 #include "sync/engine/update_applicator.h"
10 #include "sync/sessions/directory_type_debug_info_emitter.h" 10 #include "sync/sessions/directory_type_debug_info_emitter.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // A GetUpdates using the old context was in progress when the context was 61 // A GetUpdates using the old context was in progress when the context was
62 // set. Fail this get updates cycle, to force a retry. 62 // set. Fail this get updates cycle, to force a retry.
63 DVLOG(1) << "GU Context conflict detected, forcing GU retry."; 63 DVLOG(1) << "GU Context conflict detected, forcing GU retry.";
64 debug_info_emitter_->EmitUpdateCountersUpdate(); 64 debug_info_emitter_->EmitUpdateCountersUpdate();
65 return DATATYPE_TRIGGERED_RETRY; 65 return DATATYPE_TRIGGERED_RETRY;
66 } 66 }
67 } 67 }
68 68
69 // Auto-create permanent folder for the type if the progress marker 69 // Auto-create permanent folder for the type if the progress marker
70 // changes from empty to non-empty. 70 // changes from empty to non-empty.
71 if (!IsTypeWithServerGeneratedRoot(type_) && 71 if (IsTypeWithClientGeneratedRoot(type_) &&
72 dir_->HasEmptyDownloadProgress(type_) && 72 dir_->HasEmptyDownloadProgress(type_) &&
73 IsValidProgressMarker(progress_marker)) { 73 IsValidProgressMarker(progress_marker)) {
74 CreateTypeRoot(&trans); 74 CreateTypeRoot(&trans);
75 } 75 }
76 76
77 UpdateSyncEntities(&trans, applicable_updates, status); 77 UpdateSyncEntities(&trans, applicable_updates, status);
78 78
79 if (IsValidProgressMarker(progress_marker)) { 79 if (IsValidProgressMarker(progress_marker)) {
80 ExpireEntriesIfNeeded(&trans, progress_marker); 80 ExpireEntriesIfNeeded(&trans, progress_marker);
81 UpdateProgressMarker(progress_marker); 81 UpdateProgressMarker(progress_marker);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 new_gc_directive.version_watermark())) { 282 new_gc_directive.version_watermark())) {
283 ExpireEntriesByVersion(dir_, trans, type_, 283 ExpireEntriesByVersion(dir_, trans, type_,
284 new_gc_directive.version_watermark()); 284 new_gc_directive.version_watermark());
285 } 285 }
286 286
287 cached_gc_directive_.reset( 287 cached_gc_directive_.reset(
288 new sync_pb::GarbageCollectionDirective(new_gc_directive)); 288 new sync_pb::GarbageCollectionDirective(new_gc_directive));
289 } 289 }
290 290
291 } // namespace syncer 291 } // namespace syncer
OLDNEW
« no previous file with comments | « no previous file | sync/engine/syncer_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698