From 45446a5e18df7910f64a690a5d6389b70e30f985 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Thu, 4 Nov 2010 17:41:00 +0000 Subject: 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 --- chrome/browser/download/download_util.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'chrome/browser/download/download_util.cc') 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); } -- cgit v1.1