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

Unified Diff: content/browser/browser_thread_impl.cc

Issue 2395763004: Disable MessageLoop features on some BrowserThreads. (Closed)
Patch Set: rebase 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..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_]);
« 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