Index: content/browser/download/save_package.cc |
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc |
index 8670bb831d5395cbdcddd3059dd57f8175d07f4f..9f9a2854566ce594f32ad3519ff345f0c6f61ae5 100644 |
--- a/content/browser/download/save_package.cc |
+++ b/content/browser/download/save_package.cc |
@@ -371,21 +371,9 @@ bool SavePackage::GenerateFileName(const std::string& disposition, |
bool need_html_ext, |
FilePath::StringType* generated_name) { |
// TODO(jungshik): Figure out the referrer charset when having one |
- // makes sense and pass it to GetSuggestedFilename. |
- string16 suggested_name = |
- net::GetSuggestedFilename(url, disposition, "", "", |
- ASCIIToUTF16(kDefaultSaveName)); |
- |
- // TODO(evan): this code is totally wrong -- we should just generate |
- // Unicode filenames and do all this encoding switching at the end. |
- // However, I'm just shuffling wrong code around, at least not adding |
- // to it. |
-#if defined(OS_WIN) |
- FilePath file_path = FilePath(suggested_name); |
-#else |
- FilePath file_path = FilePath( |
- base::SysWideToNativeMB(UTF16ToWide(suggested_name))); |
-#endif |
+ // makes sense and pass it to GenerateFileName. |
+ FilePath file_path = net::GenerateFileName(url, disposition, "", "", "", |
+ ASCIIToUTF16(kDefaultSaveName)); |
DCHECK(!file_path.empty()); |
FilePath::StringType pure_file_name = |
@@ -1278,8 +1266,10 @@ void SavePackage::OnPathPicked(const FilePath& final_name, |
SavePackageType type) { |
// Ensure the filename is safe. |
saved_main_file_path_ = final_name; |
- download_util::GenerateSafeFileName(tab_contents()->contents_mime_type(), |
- &saved_main_file_path_); |
+ // TODO(asanka): This call is going to block on IO and shouldn't be |
+ // made from the UI thread. |
rvargas (doing something else)
2011/07/26 22:25:41
Could you clarify (for me) what does this mean?. A
asanka
2011/07/28 20:04:38
This is documenting a pre-existing problem. net::
|
+ net::GenerateSafeFileName(tab_contents()->contents_mime_type(), |
+ &saved_main_file_path_); |
saved_main_directory_path_ = saved_main_file_path_.DirName(); |