summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 20:36:28 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 20:36:28 +0000
commit822e2947f42a96cc29771f15013fe324037a9712 (patch)
treea83ff359afec5eb297bf58f2c44cd8037e89dd04 /net
parent0cb7bec2eb1b954e30de75305c974ecfee3c8efb (diff)
downloadchromium_src-822e2947f42a96cc29771f15013fe324037a9712.zip
chromium_src-822e2947f42a96cc29771f15013fe324037a9712.tar.gz
chromium_src-822e2947f42a96cc29771f15013fe324037a9712.tar.bz2
Turn on file access checks on Win.
BUG=60211 Review URL: http://codereview.chromium.org/4222005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r--net/base/ssl_config_service_win.cc8
-rw-r--r--net/proxy/proxy_config_service_win.cc8
-rw-r--r--net/url_request/url_request_file_job.cc8
3 files changed, 24 insertions, 0 deletions
diff --git a/net/base/ssl_config_service_win.cc b/net/base/ssl_config_service_win.cc
index 14c4d24..debea7d 100644
--- a/net/base/ssl_config_service_win.cc
+++ b/net/base/ssl_config_service_win.cc
@@ -4,6 +4,7 @@
#include "net/base/ssl_config_service_win.h"
+#include "base/thread_restrictions.h"
#include "base/win/registry.h"
using base::TimeDelta;
@@ -59,6 +60,9 @@ void SSLConfigServiceWin::GetSSLConfigAt(SSLConfig* config, TimeTicks now) {
// static
bool SSLConfigServiceWin::GetSSLConfigNow(SSLConfig* config) {
+ // This registry access goes to disk and will slow down the IO thread.
+ // http://crbug.com/61455
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
RegKey internet_settings;
if (!internet_settings.Open(HKEY_CURRENT_USER, kInternetSettingsSubKeyName,
KEY_READ))
@@ -83,6 +87,8 @@ bool SSLConfigServiceWin::GetSSLConfigNow(SSLConfig* config) {
// static
void SSLConfigServiceWin::SetRevCheckingEnabled(bool enabled) {
+ // This registry access goes to disk and will slow down the IO thread.
+ // http://crbug.com/61455
DWORD value = enabled;
RegKey internet_settings(HKEY_CURRENT_USER, kInternetSettingsSubKeyName,
KEY_WRITE);
@@ -108,6 +114,8 @@ void SSLConfigServiceWin::SetTLS1Enabled(bool enabled) {
// static
void SSLConfigServiceWin::SetSSLVersionEnabled(int version, bool enabled) {
+ // This registry access goes to disk and will slow down the IO thread.
+ // http://crbug.com/61455
RegKey internet_settings(HKEY_CURRENT_USER, kInternetSettingsSubKeyName,
KEY_READ | KEY_WRITE);
DWORD value;
diff --git a/net/proxy/proxy_config_service_win.cc b/net/proxy/proxy_config_service_win.cc
index d0a387f..5aca4ae 100644
--- a/net/proxy/proxy_config_service_win.cc
+++ b/net/proxy/proxy_config_service_win.cc
@@ -12,6 +12,7 @@
#include "base/string_tokenizer.h"
#include "base/string_util.h"
#include "base/stl_util-inl.h"
+#include "base/thread_restrictions.h"
#include "base/win/registry.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_config.h"
@@ -72,6 +73,9 @@ ProxyConfigServiceWin::ProxyConfigServiceWin()
}
ProxyConfigServiceWin::~ProxyConfigServiceWin() {
+ // The registry functions below will end up going to disk. Do this on another
+ // thread to avoid slowing the IO thread. http://crbug.com/61453
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
STLDeleteElements(&keys_to_watch_);
}
@@ -87,6 +91,10 @@ void ProxyConfigServiceWin::StartWatchingRegistryForChanges() {
if (!keys_to_watch_.empty())
return; // Already initialized.
+ // The registry functions below will end up going to disk. Do this on another
+ // thread to avoid slowing the IO thread. http://crbug.com/61453
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
// There are a number of different places where proxy settings can live
// in the registry. In some cases it appears in a binary value, in other
// cases string values. Furthermore winhttp and wininet appear to have
diff --git a/net/url_request/url_request_file_job.cc b/net/url_request/url_request_file_job.cc
index f9c6559..fff85c3 100644
--- a/net/url_request/url_request_file_job.cc
+++ b/net/url_request/url_request_file_job.cc
@@ -203,6 +203,10 @@ bool URLRequestFileJob::GetContentEncodings(
}
bool URLRequestFileJob::GetMimeType(std::string* mime_type) const {
+ // URL 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;
DCHECK(request_);
return net::GetMimeTypeFromFile(file_path_, mime_type);
}
@@ -252,6 +256,10 @@ void URLRequestFileJob::DidResolve(
if (!exists) {
rv = net::ERR_FILE_NOT_FOUND;
} else if (!is_directory_) {
+ // URL requests should not block on the disk!
+ // http://code.google.com/p/chromium/issues/detail?id=59849
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
int flags = base::PLATFORM_FILE_OPEN |
base::PLATFORM_FILE_READ |
base::PLATFORM_FILE_ASYNC;