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

Unified Diff: chrome/browser/chromeos/gdata/gdata_download_observer.cc

Issue 10735059: gdata cleanup: Make GDataFileSystem::AddUploadedFile() take scoped_ptr<DocumentEntry>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase @ revision 146183. Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata_file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698