diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 17:14:00 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-05 17:14:00 +0000 |
commit | 7ba53e1db77e3cd7c9e7b05c6e44698a142beea5 (patch) | |
tree | 1610b6881ce577e7ee1048bc5e22c7f8bb9b8d9e /chrome/browser/download/save_package.cc | |
parent | f0f569e61980fc8077ac13012a09976f4ce5cebd (diff) | |
download | chromium_src-7ba53e1db77e3cd7c9e7b05c6e44698a142beea5.zip chromium_src-7ba53e1db77e3cd7c9e7b05c6e44698a142beea5.tar.gz chromium_src-7ba53e1db77e3cd7c9e7b05c6e44698a142beea5.tar.bz2 |
Clean up download code:
- move filename generation parts and related code out of DownloadManager
download_util is not the best place for it, but it's better than
DownloadManager which we're trying to minimize
- clean up posting tasks to different threads. There's no need to create
separate methods for that, it was cluttering the file needlessly
- other minor cleanups, like using static_cast instead of C-style cast
TEST=unit_tests, browser_tests, ui_tests
BUG=48913
Review URL: http://codereview.chromium.org/3043048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/save_package.cc')
-rw-r--r-- | chrome/browser/download/save_package.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index 3ec45b9..993d533 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -21,6 +21,7 @@ #include "chrome/browser/download/download_item_model.h" #include "chrome/browser/download/download_manager.h" #include "chrome/browser/download/download_shelf.h" +#include "chrome/browser/download/download_util.h" #include "chrome/browser/download/save_file.h" #include "chrome/browser/download/save_file_manager.h" #include "chrome/browser/download/save_item.h" @@ -1308,10 +1309,8 @@ void SavePackage::ContinueSave(SavePackageParam* param, int index) { // Ensure the filename is safe. param->saved_main_file_path = final_name; - DownloadManager* dlm = tab_contents_->profile()->GetDownloadManager(); - DCHECK(dlm); - dlm->GenerateSafeFileName(param->current_tab_mime_type, - ¶m->saved_main_file_path); + download_util::GenerateSafeFileName(param->current_tab_mime_type, + ¶m->saved_main_file_path); // The option index is not zero-based. DCHECK(index > 0 && index < 3); |