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

Unified Diff: chrome/browser/io_thread.cc

Issue 3872002: Thread IO safety: file_util annotated, IO thread blocked from doing IO (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 10 years, 2 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
Index: chrome/browser/io_thread.cc
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index f67a918b71f786b9a9270fb13e473b2cd29cbd70..9560e57983916a27a8402da0f814675d2bf19897 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -12,6 +12,7 @@
#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"
@@ -232,6 +233,13 @@ 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());
« no previous file with comments | « chrome/browser/extensions/autoupdate_interceptor.cc ('k') | chrome/browser/net/url_request_mock_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698