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

Unified Diff: content/browser/browser_process_sub_thread.cc

Issue 10151009: Disallow UI/IO thread blocking on any other thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 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
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/renderer_host/render_widget_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_process_sub_thread.cc
===================================================================
--- content/browser/browser_process_sub_thread.cc (revision 133458)
+++ content/browser/browser_process_sub_thread.cc (working copy)
@@ -9,6 +9,7 @@
#endif
#include "base/debug/leak_tracker.h"
+#include "base/threading/thread_restrictions.h"
#include "build/build_config.h"
#include "content/browser/browser_child_process_host_impl.h"
#include "content/browser/in_process_webkit/indexed_db_key_utility_client.h"
@@ -36,6 +37,14 @@
notification_service_ = new NotificationServiceImpl;
BrowserThreadImpl::Init();
+
+ if (BrowserThread::CurrentlyOn(BrowserThread::IO)) {
+ // 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);
+ base::ThreadRestrictions::DisallowWaiting();
+ }
}
void BrowserProcessSubThread::CleanUp() {
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/renderer_host/render_widget_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698