Index: chrome/browser/chromeos/gdata/gdata_download_observer.cc |
diff --git a/chrome/browser/chromeos/gdata/gdata_download_observer.cc b/chrome/browser/chromeos/gdata/gdata_download_observer.cc |
index 2edb81ac05ab916ac4d42588c135247d52ab210f..94bba5bae1c295edbd4a9995aa05520bcccf7f4d 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_download_observer.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_download_observer.cc |
@@ -519,10 +519,9 @@ void GDataDownloadObserver::MoveFileToGDataCache(DownloadItem* download) { |
return; |
} |
- // Take ownership of the DocumentEntry object. It will be released upon |
- // completion of the AddUploadedFile() call below. |
- DocumentEntry* entry = data->entry_passed().release(); |
- if (!entry) { |
+ // Pass ownership of the DocumentEntry object to AddUploadedFile(). |
+ scoped_ptr<DocumentEntry> entry = data->entry_passed(); |
+ if (!entry.get()) { |
NOTREACHED(); |
return; |
} |
@@ -531,11 +530,10 @@ void GDataDownloadObserver::MoveFileToGDataCache(DownloadItem* download) { |
// use the final target path when the download item is in COMPLETE state. |
file_system_->AddUploadedFile(UPLOAD_NEW_FILE, |
data->virtual_dir_path(), |
- entry, |
+ entry.Pass(), |
download->GetTargetFilePath(), |
GDataCache::FILE_OPERATION_MOVE, |
- base::Bind(&base::DeletePointer<DocumentEntry>, |
- entry)); |
+ base::Bind(&base::DoNothing)); |
} |
} // namespace gdata |