diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-23 00:07:32 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-23 00:07:32 +0000 |
commit | 6077a01022957200646ae74b40ee7ab499b99e72 (patch) | |
tree | b743ff22bd0c6c019181ec7fbe8b8230c300a585 /chrome/browser/io_thread.cc | |
parent | 77ab22463ac2f8e94a2629d13aec8b88691c4cfc (diff) | |
download | chromium_src-6077a01022957200646ae74b40ee7ab499b99e72.zip chromium_src-6077a01022957200646ae74b40ee7ab499b99e72.tar.gz chromium_src-6077a01022957200646ae74b40ee7ab499b99e72.tar.bz2 |
Thread IO safety: annotate file_util, and block IO thread from doing IO
- Mark functions in file_util_posix as requiring permission to perform
disk actions.
- Mark the IO thread as disallowed from performing disk actions.
- Temporarily work around the protections in places where we currently
have bugs.
BUG=59847,59849,60207,60211
TEST=no dchecks in debug builds
Review URL: http://codereview.chromium.org/3872002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.cc')
-rw-r--r-- | chrome/browser/io_thread.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc index 4dc520a..8772ffd 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" @@ -257,6 +258,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()); |