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

Unified Diff: net/base/filename_util_internal.cc

Issue 274193004: Restore base::ThreadRestrictions::ScopedAllowIO to see if it fixes linux bot failures. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/filename_util_internal.cc
diff --git a/net/base/filename_util_internal.cc b/net/base/filename_util_internal.cc
index a59de0f50c9174eb4f0cdfbc506428ee695ca57d..0d68bbde377cd65afc6285efc3401172cf9a1448 100644
--- a/net/base/filename_util_internal.cc
+++ b/net/base/filename_util_internal.cc
@@ -171,6 +171,12 @@ void EnsureSafeExtension(const std::string& mime_type,
if ((ignore_extension || extension.empty()) && !mime_type.empty()) {
base::FilePath::StringType preferred_mime_extension;
std::vector<base::FilePath::StringType> all_mime_extensions;
+ // The GetPreferredExtensionForMimeType call will end up going to disk. Do
+ // this on another thread to avoid slowing the IO thread.
+ // http://crbug.com/61827
+ // TODO(asanka): Remove this ScopedAllowIO once all callers have switched
+ // over to IO safe threads.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
net::GetPreferredExtensionForMimeType(mime_type, &preferred_mime_extension);
net::GetExtensionsForMimeType(mime_type, &all_mime_extensions);
// If the existing extension is in the list of valid extensions for the
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698