summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_protocols.cc
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 22:07:34 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-14 22:07:34 +0000
commit28b791a577a84f316d78b37d3bea97a119215a0f (patch)
treed7f28de670526bd5856e2aa68e828f9c50523e10 /chrome/browser/extensions/extension_protocols.cc
parent3a69c6fe533cb089bd3d33fad753a265f413718e (diff)
downloadchromium_src-28b791a577a84f316d78b37d3bea97a119215a0f.zip
chromium_src-28b791a577a84f316d78b37d3bea97a119215a0f.tar.gz
chromium_src-28b791a577a84f316d78b37d3bea97a119215a0f.tar.bz2
Whitelist access to the disk in URLRequestResourceBundleJob::GetData.
This function is run on the IO thread, which means it shouldn't touch the disk, but it does. There's already a bug on file for fixing this issue (which covers this instance and the same instance in some of the other URLRequestJob subclasses). I'm adding ScopedAllowIO in this patch to silence the DCHECK while we work on the bug. BUG=59849 Review URL: http://codereview.chromium.org/6851026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81656 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_protocols.cc')
-rw-r--r--chrome/browser/extensions/extension_protocols.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
index 4489ef1..9fc2f86 100644
--- a/chrome/browser/extensions/extension_protocols.cc
+++ b/chrome/browser/extensions/extension_protocols.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -46,7 +46,16 @@ class URLRequestResourceBundleJob : public net::URLRequestSimpleJob {
std::string* data) const {
const ResourceBundle& rb = ResourceBundle::GetSharedInstance();
*data = rb.GetRawDataResource(resource_id_).as_string();
- bool result = net::GetMimeTypeFromFile(filename_, mime_type);
+
+ // Requests should not block on the disk! On Windows this goes to the
+ // registry.
+ // http://code.google.com/p/chromium/issues/detail?id=59849
+ bool result;
+ {
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+ result = net::GetMimeTypeFromFile(filename_, mime_type);
+ }
+
if (StartsWithASCII(*mime_type, "text/", false)) {
// All of our HTML files should be UTF-8 and for other resource types
// (like images), charset doesn't matter.