Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1245)

Unified Diff: chrome/browser/download/download_util.cc

Issue 4222005: Turn on file access checks on Win. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Second try Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_ui/shared_resources_data_source.cc ('k') | chrome/browser/download/save_package.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_util.cc
===================================================================
--- chrome/browser/download/download_util.cc (revision 64981)
+++ chrome/browser/download/download_util.cc (working copy)
@@ -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 @@
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);
}
« no previous file with comments | « chrome/browser/dom_ui/shared_resources_data_source.cc ('k') | chrome/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698