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

Unified Diff: content/browser/browser_thread_impl.cc

Issue 2407313002: Disallow nesting on some BrowserThreads. (Closed)
Patch Set: self-review Created 4 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
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_thread_impl.cc
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc
index a3a33bdea5ecf490df43495f4cba190c0695ff41..5657882dfa97ab16d0fc49f990194889abd97100 100644
--- a/content/browser/browser_thread_impl.cc
+++ b/content/browser/browser_thread_impl.cc
@@ -185,6 +185,14 @@ void BrowserThreadImpl::FlushThreadPoolHelperForTesting() {
void BrowserThreadImpl::Init() {
BrowserThreadGlobals& globals = g_globals.Get();
+ if (BrowserThread::CurrentlyOn(BrowserThread::DB) ||
+ BrowserThread::CurrentlyOn(BrowserThread::FILE) ||
+ BrowserThread::CurrentlyOn(BrowserThread::FILE_USER_BLOCKING) ||
+ BrowserThread::CurrentlyOn(BrowserThread::PROCESS_LAUNCHER) ||
+ BrowserThread::CurrentlyOn(BrowserThread::CACHE)) {
+ base::MessageLoop::current()->DisallowNesting();
+ }
+
using base::subtle::AtomicWord;
AtomicWord* storage =
reinterpret_cast<AtomicWord*>(&globals.thread_delegates[identifier_]);
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698