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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/conflict_resolver.cc

Issue 98043004: [SyncFS] Run ConflictResolver only when it is needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test expectation Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h" 5 #include "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/drive/drive_api_util.h" 10 #include "chrome/browser/drive/drive_api_util.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 const FileTracker& tracker = **itr; 82 const FileTracker& tracker = **itr;
83 if (tracker.file_id() != target_file_id_) { 83 if (tracker.file_id() != target_file_id_) {
84 non_primary_file_ids_.push_back( 84 non_primary_file_ids_.push_back(
85 std::make_pair(tracker.file_id(), tracker.synced_details().etag())); 85 std::make_pair(tracker.file_id(), tracker.synced_details().etag()));
86 } 86 }
87 } 87 }
88 RemoveNonPrimaryFiles(callback); 88 RemoveNonPrimaryFiles(callback);
89 return; 89 return;
90 } 90 }
91 91
92 callback.Run(SYNC_STATUS_NO_CHANGE_TO_SYNC); 92 callback.Run(SYNC_STATUS_NO_CONFLICT);
93 } 93 }
94 94
95 void ConflictResolver::DetachFromNonPrimaryParents( 95 void ConflictResolver::DetachFromNonPrimaryParents(
96 const SyncStatusCallback& callback) { 96 const SyncStatusCallback& callback) {
97 DCHECK(!parents_to_remove_.empty()); 97 DCHECK(!parents_to_remove_.empty());
98 98
99 // TODO(tzik): Check if ETag match is available for 99 // TODO(tzik): Check if ETag match is available for
100 // RemoteResourceFromDirectory. 100 // RemoteResourceFromDirectory.
101 std::string parent_folder_id = parents_to_remove_.back(); 101 std::string parent_folder_id = parents_to_remove_.back();
102 parents_to_remove_.pop_back(); 102 parents_to_remove_.pop_back();
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 set_used_network(true); 233 set_used_network(true);
234 return sync_context_->GetDriveService(); 234 return sync_context_->GetDriveService();
235 } 235 }
236 236
237 MetadataDatabase* ConflictResolver::metadata_database() { 237 MetadataDatabase* ConflictResolver::metadata_database() {
238 return sync_context_->GetMetadataDatabase(); 238 return sync_context_->GetMetadataDatabase();
239 } 239 }
240 240
241 } // namespace drive_backend 241 } // namespace drive_backend
242 } // namespace sync_file_system 242 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/conflict_resolver_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698