summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 22:56:27 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-22 22:56:27 +0000
commit8da3067b27f52b4413c0aad3ad5da721766e2129 (patch)
treeb87070e259c0137ea7715847319d54761d919cc1 /chrome/browser
parent88328f582694565b00ea445c4541f37fa73f3539 (diff)
downloadchromium_src-8da3067b27f52b4413c0aad3ad5da721766e2129.zip
chromium_src-8da3067b27f52b4413c0aad3ad5da721766e2129.tar.gz
chromium_src-8da3067b27f52b4413c0aad3ad5da721766e2129.tar.bz2
Revert "Thread IO safety: annotate file_util, and block IO thread from doing IO"
This reverts commit r63580, build breakage. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63586 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/extensions/autoupdate_interceptor.cc8
-rw-r--r--chrome/browser/io_thread.cc8
-rw-r--r--chrome/browser/net/url_request_mock_http_job.cc5
-rw-r--r--chrome/browser/net/url_request_mock_util.cc6
-rw-r--r--chrome/browser/printing/print_dialog_cloud_uitest.cc9
-rw-r--r--chrome/browser/service/service_process_control.cc10
6 files changed, 3 insertions, 43 deletions
diff --git a/chrome/browser/extensions/autoupdate_interceptor.cc b/chrome/browser/extensions/autoupdate_interceptor.cc
index ef0091f..2acd0a0 100644
--- a/chrome/browser/extensions/autoupdate_interceptor.cc
+++ b/chrome/browser/extensions/autoupdate_interceptor.cc
@@ -5,7 +5,6 @@
#include "chrome/browser/extensions/autoupdate_interceptor.h"
#include "base/file_util.h"
-#include "base/thread_restrictions.h"
#include "chrome/browser/browser_thread.h"
#include "net/url_request/url_request_test_job.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -41,10 +40,6 @@ URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(URLRequest* request) {
return NULL;
}
- // It's ok to do a blocking disk access on this thread; this class
- // is just used for tests.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-
// Search for this request's url, ignoring any query parameters.
GURL url = request->url();
if (url.has_query()) {
@@ -66,9 +61,6 @@ URLRequestJob* AutoUpdateInterceptor::MaybeIntercept(URLRequest* request) {
void AutoUpdateInterceptor::SetResponse(const std::string url,
const FilePath& path) {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
- // It's ok to do a blocking disk access on this thread; this class
- // is just used for tests.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
GURL gurl(url);
EXPECT_EQ("http", gurl.scheme());
EXPECT_EQ("localhost", gurl.host());
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 8772ffd..4dc520a 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -12,7 +12,6 @@
#include "base/string_number_conversions.h"
#include "base/string_split.h"
#include "base/string_util.h"
-#include "base/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/gpu_process_host.h"
@@ -258,13 +257,6 @@ net::ProxyScriptFetcher* IOThread::CreateAndRegisterProxyScriptFetcher(
}
void IOThread::Init() {
-#if defined(OS_LINUX)
- // TODO(evan): test and enable this on all platforms.
- // Though this thread is called the "IO" thread, it actually just routes
- // messages around; it shouldn't be allowed to perform any blocking disk I/O.
- base::ThreadRestrictions::SetIOAllowed(false);
-#endif
-
BrowserProcessSubThread::Init();
DCHECK_EQ(MessageLoop::TYPE_IO, message_loop()->type());
diff --git a/chrome/browser/net/url_request_mock_http_job.cc b/chrome/browser/net/url_request_mock_http_job.cc
index 4029605..a35cd1e 100644
--- a/chrome/browser/net/url_request_mock_http_job.cc
+++ b/chrome/browser/net/url_request_mock_http_job.cc
@@ -7,7 +7,6 @@
#include "base/file_util.h"
#include "base/message_loop.h"
#include "base/string_util.h"
-#include "base/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/url_constants.h"
#include "net/base/net_util.h"
@@ -88,10 +87,6 @@ bool URLRequestMockHTTPJob::IsRedirectResponse(GURL* location,
// Private const version.
void URLRequestMockHTTPJob::GetResponseInfoConst(
net::HttpResponseInfo* info) const {
- // We have to load our headers from disk, but we only use this class
- // from tests, so allow these IO operations to happen on any thread.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-
FilePath header_file = FilePath(file_path_.value() + kMockHeaderFileSuffix);
std::string raw_headers;
if (!file_util::ReadFileToString(header_file, &raw_headers))
diff --git a/chrome/browser/net/url_request_mock_util.cc b/chrome/browser/net/url_request_mock_util.cc
index b3ac398..e6531f8 100644
--- a/chrome/browser/net/url_request_mock_util.cc
+++ b/chrome/browser/net/url_request_mock_util.cc
@@ -7,7 +7,6 @@
#include <string>
#include "base/path_service.h"
-#include "base/thread_restrictions.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/net/url_request_failed_dns_job.h"
#include "chrome/browser/net/url_request_mock_http_job.h"
@@ -25,11 +24,6 @@ void SetUrlRequestMocksEnabled(bool enabled) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
if (enabled) {
- // We have to look around for our helper files, but we only use
- // this from tests, so allow these IO operations to happen
- // anywhere.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-
URLRequestFilter::GetInstance()->ClearHandlers();
URLRequestFailedDnsJob::AddUrlHandler();
diff --git a/chrome/browser/printing/print_dialog_cloud_uitest.cc b/chrome/browser/printing/print_dialog_cloud_uitest.cc
index 3b57961..1cc446d 100644
--- a/chrome/browser/printing/print_dialog_cloud_uitest.cc
+++ b/chrome/browser/printing/print_dialog_cloud_uitest.cc
@@ -11,7 +11,6 @@
#include "base/file_util.h"
#include "base/path_service.h"
#include "base/singleton.h"
-#include "base/thread_restrictions.h"
#include "base/values.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_thread.h"
@@ -33,11 +32,7 @@ class TestData {
public:
TestData() {}
- const char* GetTestData() {
- // Fetching this data blocks the IO thread, but we don't really care because
- // this is a test.
- base::ThreadRestrictions::ScopedAllowIO allow_io;
-
+ char* GetTestData() {
if (test_data_.empty()) {
FilePath test_data_directory;
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory);
@@ -45,7 +40,7 @@ class TestData {
test_data_directory.AppendASCII("printing/cloud_print_uitest.html");
file_util::ReadFileToString(test_file, &test_data_);
}
- return test_data_.c_str();
+ return &test_data_[0];
}
private:
std::string test_data_;
diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc
index 6a41395..534cc5a 100644
--- a/chrome/browser/service/service_process_control.cc
+++ b/chrome/browser/service/service_process_control.cc
@@ -9,7 +9,6 @@
#include "base/process_util.h"
#include "base/stl_util-inl.h"
#include "base/thread.h"
-#include "base/thread_restrictions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/io_thread.h"
@@ -56,14 +55,7 @@ class ServiceProcessControl::Launcher
void DoDetectLaunched(Task* task) {
const uint32 kMaxLaunchDetectRetries = 10;
- {
- // We should not be doing blocking disk IO from this thread!
- // Temporarily allowed until we fix
- // http://code.google.com/p/chromium/issues/detail?id=60207
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- launched_ = CheckServiceProcessReady();
- }
-
+ launched_ = CheckServiceProcessReady();
if (launched_ || (retry_count_ >= kMaxLaunchDetectRetries)) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
NewRunnableMethod(this, &Launcher::Notify, task));