diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-03 20:36:28 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-03 20:36:28 +0000 |
commit | 822e2947f42a96cc29771f15013fe324037a9712 (patch) | |
tree | a83ff359afec5eb297bf58f2c44cd8037e89dd04 /chrome/browser/download/save_package.cc | |
parent | 0cb7bec2eb1b954e30de75305c974ecfee3c8efb (diff) | |
download | chromium_src-822e2947f42a96cc29771f15013fe324037a9712.zip chromium_src-822e2947f42a96cc29771f15013fe324037a9712.tar.gz chromium_src-822e2947f42a96cc29771f15013fe324037a9712.tar.bz2 |
Turn on file access checks on Win.
BUG=60211
Review URL: http://codereview.chromium.org/4222005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/save_package.cc')
-rw-r--r-- | chrome/browser/download/save_package.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/download/save_package.cc b/chrome/browser/download/save_package.cc index 473a795..d637cda 100644 --- a/chrome/browser/download/save_package.cc +++ b/chrome/browser/download/save_package.cc @@ -13,6 +13,7 @@ #include "base/stl_util-inl.h" #include "base/string_piece.h" #include "base/string_split.h" +#include "base/thread_restrictions.h" #include "base/utf_string_conversions.h" #include "base/task.h" #include "base/thread.h" @@ -1158,6 +1159,10 @@ FilePath SavePackage::GetSuggestedNameForSaveAs( } FilePath SavePackage::EnsureHtmlExtension(const FilePath& name) { + // The GetMimeTypeFromExtension call will end up going to disk. Do this on + // another thread to avoid slowing the UI thread. http://crbug.com/61775 + base::ThreadRestrictions::ScopedAllowIO allow_io; + // If the file name doesn't have an extension suitable for HTML files, // append one. FilePath::StringType ext = name.Extension(); @@ -1174,6 +1179,10 @@ FilePath SavePackage::EnsureHtmlExtension(const FilePath& name) { FilePath SavePackage::EnsureMimeExtension(const FilePath& name, const FilePath::StringType& contents_mime_type) { + // The GetMimeTypeFromExtension call will end up going to disk. Do this on + // another thread to avoid slowing the UI thread. http://crbug.com/61775 + base::ThreadRestrictions::ScopedAllowIO allow_io; + // Start extension at 1 to skip over period if non-empty. FilePath::StringType ext = name.Extension().length() ? name.Extension().substr(1) : name.Extension(); |