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

Side by Side Diff: chrome/browser/chromeos/drive/sync_client.cc

Issue 149243005: Files.app: Ignore FILE_ERROR_ABORT error when sync update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/drive/sync_client.h" 5 #include "chrome/browser/chromeos/drive/sync_client.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 FileError error) { 390 FileError error) {
391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 391 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
392 392
393 if (!OnTaskComplete(UPDATE, local_id)) 393 if (!OnTaskComplete(UPDATE, local_id))
394 return; 394 return;
395 395
396 if (error == FILE_ERROR_OK) { 396 if (error == FILE_ERROR_OK) {
397 DVLOG(1) << "Updated " << local_id; 397 DVLOG(1) << "Updated " << local_id;
398 } else { 398 } else {
399 switch (error) { 399 switch (error) {
400 case FILE_ERROR_ABORT:
401 // Ignore it because this is caused by user's cancel operations.
402 break;
400 case FILE_ERROR_NO_CONNECTION: 403 case FILE_ERROR_NO_CONNECTION:
401 // Add the task again so that we'll retry once the connection is back. 404 // Add the task again so that we'll retry once the connection is back.
402 AddUpdateTaskInternal(ClientContext(BACKGROUND), local_id, 405 AddUpdateTaskInternal(ClientContext(BACKGROUND), local_id,
403 base::TimeDelta::FromSeconds(0)); 406 base::TimeDelta::FromSeconds(0));
404 break; 407 break;
405 case FILE_ERROR_SERVICE_UNAVAILABLE: 408 case FILE_ERROR_SERVICE_UNAVAILABLE:
406 // Add the task again so that we'll retry once the service is back. 409 // Add the task again so that we'll retry once the service is back.
407 AddUpdateTaskInternal(ClientContext(BACKGROUND), local_id, long_delay_); 410 AddUpdateTaskInternal(ClientContext(BACKGROUND), local_id, long_delay_);
408 operation_observer_->OnDriveSyncError( 411 operation_observer_->OnDriveSyncError(
409 file_system::DRIVE_SYNC_ERROR_SERVICE_UNAVAILABLE, 412 file_system::DRIVE_SYNC_ERROR_SERVICE_UNAVAILABLE,
410 local_id); 413 local_id);
411 break; 414 break;
415
hashimoto 2014/01/29 08:35:19 nit: This blank line is not needed.
hirono 2014/01/29 10:35:31 Done.
412 default: 416 default:
413 operation_observer_->OnDriveSyncError( 417 operation_observer_->OnDriveSyncError(
414 file_system::DRIVE_SYNC_ERROR_MISC, 418 file_system::DRIVE_SYNC_ERROR_MISC,
415 local_id); 419 local_id);
416 LOG(WARNING) << "Failed to update " << local_id << ": " 420 LOG(WARNING) << "Failed to update " << local_id << ": "
417 << FileErrorToString(error); 421 << FileErrorToString(error);
418 } 422 }
419 } 423 }
420 } 424 }
421 425
422 } // namespace internal 426 } // namespace internal
423 } // namespace drive 427 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698