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

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

Issue 101223003: SyncFS: Handle HTTP_CONFLICT as Precondition error (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/local_to_remote_syncer.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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 drive_service()->DeleteResource( 195 drive_service()->DeleteResource(
196 file_id, etag, 196 file_id, etag,
197 base::Bind(&ConflictResolver::DidRemoveFile, 197 base::Bind(&ConflictResolver::DidRemoveFile,
198 weak_ptr_factory_.GetWeakPtr(), 198 weak_ptr_factory_.GetWeakPtr(),
199 callback, file_id)); 199 callback, file_id));
200 } 200 }
201 201
202 void ConflictResolver::DidRemoveFile(const SyncStatusCallback& callback, 202 void ConflictResolver::DidRemoveFile(const SyncStatusCallback& callback,
203 const std::string& file_id, 203 const std::string& file_id,
204 google_apis::GDataErrorCode error) { 204 google_apis::GDataErrorCode error) {
205 if (error == google_apis::HTTP_PRECONDITION) { 205 if (error == google_apis::HTTP_PRECONDITION ||
206 error == google_apis::HTTP_CONFLICT) {
206 callback.Run(SYNC_STATUS_RETRY); 207 callback.Run(SYNC_STATUS_RETRY);
207 return; 208 return;
208 } 209 }
209 210
210 if (error != google_apis::HTTP_SUCCESS && 211 if (error != google_apis::HTTP_SUCCESS &&
211 error != google_apis::HTTP_NOT_FOUND) { 212 error != google_apis::HTTP_NOT_FOUND) {
212 callback.Run(GDataErrorCodeToSyncStatusCode(error)); 213 callback.Run(GDataErrorCodeToSyncStatusCode(error));
213 return; 214 return;
214 } 215 }
215 216
(...skipping 14 matching lines...) Expand all
230 set_used_network(true); 231 set_used_network(true);
231 return sync_context_->GetDriveService(); 232 return sync_context_->GetDriveService();
232 } 233 }
233 234
234 MetadataDatabase* ConflictResolver::metadata_database() { 235 MetadataDatabase* ConflictResolver::metadata_database() {
235 return sync_context_->GetMetadataDatabase(); 236 return sync_context_->GetMetadataDatabase();
236 } 237 }
237 238
238 } // namespace drive_backend 239 } // namespace drive_backend
239 } // namespace sync_file_system 240 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/drive_backend/local_to_remote_syncer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698