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

Side by Side Diff: chrome/browser/download/download_file_manager.cc

Issue 7324031: Revert 91861 - When the download folder does not exist, change the download folder to a user's "D... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/download/download_file_manager.h" 5 #include "chrome/browser/download/download_file_manager.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util-inl.h" 9 #include "base/stl_util-inl.h"
10 #include "base/task.h" 10 #include "base/task.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 } 267 }
268 } 268 }
269 269
270 // Actions from the UI thread and run on the download thread 270 // Actions from the UI thread and run on the download thread
271 271
272 // The DownloadManager in the UI thread has provided an intermediate .crdownload 272 // The DownloadManager in the UI thread has provided an intermediate .crdownload
273 // name for the download specified by 'id'. Rename the in progress download. 273 // name for the download specified by 'id'. Rename the in progress download.
274 // 274 //
275 // There are 2 possible rename cases where this method can be called: 275 // There are 2 possible rename cases where this method can be called:
276 // 1. tmp -> foo.crdownload (not final, safe) 276 // 1. tmp -> foo.crdownload (not final, safe)
277 // 2. tmp -> Unconfirmed.xxx.crdownload (not final, dangerous) 277 // 2. tmp-> Unconfirmed.xxx.crdownload (not final, dangerous)
278 void DownloadFileManager::RenameInProgressDownloadFile( 278 void DownloadFileManager::RenameInProgressDownloadFile(
279 int id, const FilePath& full_path) { 279 int id, const FilePath& full_path) {
280 VLOG(20) << __FUNCTION__ << "()" << " id = " << id 280 VLOG(20) << __FUNCTION__ << "()" << " id = " << id
281 << " full_path = \"" << full_path.value() << "\""; 281 << " full_path = \"" << full_path.value() << "\"";
282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 282 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
283 283
284 DownloadFile* download_file = GetDownloadFile(id); 284 DownloadFile* download_file = GetDownloadFile(id);
285 if (!download_file) 285 if (!download_file)
286 return; 286 return;
287 287
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 << " id = " << id 392 << " id = " << id
393 << " download_file = " << download_file->DebugString(); 393 << " download_file = " << download_file->DebugString();
394 394
395 downloads_.erase(id); 395 downloads_.erase(id);
396 396
397 delete download_file; 397 delete download_file;
398 398
399 if (downloads_.empty()) 399 if (downloads_.empty())
400 StopUpdateTimer(); 400 StopUpdateTimer();
401 } 401 }
OLDNEW
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698