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..d111a1ed097c565e00961e6e2b99237122dee11e 100644 |
--- a/content/browser/browser_thread_impl.cc |
+++ b/content/browser/browser_thread_impl.cc |
@@ -185,6 +185,17 @@ 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* message_loop = base::MessageLoop::current(); |
+ message_loop->DisableNesting(); |
+ message_loop->DisableDestructionObservers(); |
+ message_loop->DisableTaskObservers(); |
+ } |
+ |
using base::subtle::AtomicWord; |
AtomicWord* storage = |
reinterpret_cast<AtomicWord*>(&globals.thread_delegates[identifier_]); |