diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-04 17:41:00 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-04 17:41:00 +0000 |
commit | 45446a5e18df7910f64a690a5d6389b70e30f985 (patch) | |
tree | 5318a1c6e14aa8600a2d958929da77019d1ef4a8 /chrome/browser/download/download_util.cc | |
parent | 42d5be693f7cc623caa3df6bfb2bcc4f6861cb36 (diff) | |
download | chromium_src-45446a5e18df7910f64a690a5d6389b70e30f985.zip chromium_src-45446a5e18df7910f64a690a5d6389b70e30f985.tar.gz chromium_src-45446a5e18df7910f64a690a5d6389b70e30f985.tar.bz2 |
Turn on file access checks on Win.
BUG=60211
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=64960
Review URL: http://codereview.chromium.org/4222005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@65075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_util.cc')
-rw-r--r-- | chrome/browser/download/download_util.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index affa24a1..8c0331e 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -21,6 +21,7 @@ #include "base/string16.h" #include "base/string_number_conversions.h" #include "base/sys_string_conversions.h" +#include "base/thread_restrictions.h" #include "base/utf_string_conversions.h" #include "base/values.h" #include "base/win/windows_version.h" @@ -150,8 +151,13 @@ void GenerateExtension(const FilePath& file_name, extension.assign(default_extension); #endif - if (extension.empty()) + if (extension.empty()) { + // The GetPreferredExtensionForMimeType call will end up going to disk. Do + // this on another thread to avoid slowing the IO thread. + // http://crbug.com/61827 + base::ThreadRestrictions::ScopedAllowIO allow_io; net::GetPreferredExtensionForMimeType(mime_type, &extension); + } generated_extension->swap(extension); } |