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

Unified Diff: chrome/browser/dom_ui/shared_resources_data_source.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/browser_main.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/shared_resources_data_source.cc
===================================================================
--- chrome/browser/dom_ui/shared_resources_data_source.cc (revision 64981)
+++ chrome/browser/dom_ui/shared_resources_data_source.cc (working copy)
@@ -6,6 +6,7 @@
#include "app/resource_bundle.h"
#include "base/singleton.h"
+#include "base/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/dom_ui/chrome_url_data_manager.h"
@@ -79,6 +80,11 @@
std::string SharedResourcesDataSource::GetMimeType(
const std::string& path) const {
+ // Requests should not block on the disk! On Windows this goes to the
+ // registry.
+ // http://code.google.com/p/chromium/issues/detail?id=59849
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
std::string mime_type;
net::GetMimeTypeFromFile(FilePath().AppendASCII(path), &mime_type);
return mime_type;
« no previous file with comments | « chrome/browser/browser_main.cc ('k') | chrome/browser/download/download_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698