| OLD | NEW |
| 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/gdata/gdata_uploader.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 DeleteUpload(upload_file_info); | 361 DeleteUpload(upload_file_info); |
| 362 } | 362 } |
| 363 | 363 |
| 364 void GDataUploader::UploadFailed(UploadFileInfo* upload_file_info) { | 364 void GDataUploader::UploadFailed(UploadFileInfo* upload_file_info) { |
| 365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 365 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 366 LOG(ERROR) << "Upload failed " << upload_file_info->DebugString(); | 366 LOG(ERROR) << "Upload failed " << upload_file_info->DebugString(); |
| 367 if (!upload_file_info->completion_callback.is_null()) { | 367 if (!upload_file_info->completion_callback.is_null()) { |
| 368 upload_file_info->completion_callback.Run(base::PLATFORM_FILE_ERROR_ABORT, | 368 upload_file_info->completion_callback.Run(base::PLATFORM_FILE_ERROR_ABORT, |
| 369 upload_file_info); | 369 upload_file_info); |
| 370 } | 370 } |
| 371 file_system_->CancelOperation(upload_file_info->gdata_path); | 371 file_system_->GetOperationRegistry()->CancelForFilePath( |
| 372 upload_file_info->gdata_path); |
| 372 DeleteUpload(upload_file_info); | 373 DeleteUpload(upload_file_info); |
| 373 } | 374 } |
| 374 | 375 |
| 375 void GDataUploader::DeleteUpload(UploadFileInfo* upload_file_info) { | 376 void GDataUploader::DeleteUpload(UploadFileInfo* upload_file_info) { |
| 376 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 377 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 377 | 378 |
| 378 DVLOG(1) << "Deleting upload " << upload_file_info->gdata_path.value(); | 379 DVLOG(1) << "Deleting upload " << upload_file_info->gdata_path.value(); |
| 379 pending_uploads_.erase(upload_file_info->upload_id); | 380 pending_uploads_.erase(upload_file_info->upload_id); |
| 380 | 381 |
| 381 // The file stream is closed by the destructor asynchronously. | 382 // The file stream is closed by the destructor asynchronously. |
| 382 delete upload_file_info->file_stream; | 383 delete upload_file_info->file_stream; |
| 383 delete upload_file_info; | 384 delete upload_file_info; |
| 384 } | 385 } |
| 385 | 386 |
| 386 } // namespace gdata | 387 } // namespace gdata |
| OLD | NEW |