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

Unified Diff: chrome/browser/download/download_file.cc

Issue 55046: Installing extensions (drag/drop, download crx file) will now be... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 | « chrome/browser/download/download_file.h ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_file.cc
===================================================================
--- chrome/browser/download/download_file.cc (revision 12708)
+++ chrome/browser/download/download_file.cc (working copy)
@@ -550,7 +550,8 @@
// download specified by 'id'. Rename the in progress download, and remove it
// from our table if it has been completed or cancelled already.
void DownloadFileManager::OnFinalDownloadName(int id,
- const FilePath& full_path) {
+ const FilePath& full_path,
+ DownloadManager* manager) {
DCHECK(MessageLoop::current() == file_loop_);
DownloadFileMap::iterator it = downloads_.find(id);
if (it == downloads_.end())
@@ -559,7 +560,13 @@
file_util::CreateDirectory(full_path.DirName());
DownloadFile* download = it->second;
- if (!download->Rename(full_path)) {
+ if (download->Rename(full_path)) {
+ ui_loop_->PostTask(FROM_HERE,
+ NewRunnableMethod(manager,
+ &DownloadManager::DownloadRenamedToFinalName,
+ id,
+ full_path));
+ } else {
// Error. Between the time the UI thread generated 'full_path' to the time
// this code runs, something happened that prevents us from renaming.
DownloadManagerMap::iterator dmit = managers_.find(download->id());
« no previous file with comments | « chrome/browser/download/download_file.h ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698