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

Side by Side Diff: content/browser/browser_thread_impl.cc

Issue 2818533003: Make nesting/running states a RunLoop rather than a MessageLoop concept. (Closed)
Patch Set: still need to check MessageLoop::current() in Mojo's RunLoopNestingObserver::GetForThread() Created 3 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/browser_thread_impl.h" 5 #include "content/browser/browser_thread_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/atomicops.h" 10 #include "base/atomicops.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 DCHECK(globals.task_runners[identifier_]->RunsTasksOnCurrentThread()); 211 DCHECK(globals.task_runners[identifier_]->RunsTasksOnCurrentThread());
212 } 212 }
213 #endif // DCHECK_IS_ON() 213 #endif // DCHECK_IS_ON()
214 214
215 if (identifier_ == BrowserThread::DB || 215 if (identifier_ == BrowserThread::DB ||
216 identifier_ == BrowserThread::FILE || 216 identifier_ == BrowserThread::FILE ||
217 identifier_ == BrowserThread::FILE_USER_BLOCKING || 217 identifier_ == BrowserThread::FILE_USER_BLOCKING ||
218 identifier_ == BrowserThread::PROCESS_LAUNCHER || 218 identifier_ == BrowserThread::PROCESS_LAUNCHER ||
219 identifier_ == BrowserThread::CACHE) { 219 identifier_ == BrowserThread::CACHE) {
220 // Nesting and task observers are not allowed on redirected threads. 220 // Nesting and task observers are not allowed on redirected threads.
221 message_loop()->DisallowNesting(); 221 base::RunLoop::DisallowNestingOnCurrentThread();
222 message_loop()->DisallowTaskObservers(); 222 message_loop()->DisallowTaskObservers();
223 } 223 }
224 224
225 if (identifier_ == BrowserThread::IO) { 225 if (identifier_ == BrowserThread::IO) {
226 BrowserThreadDelegateAtomicPtr delegate = 226 BrowserThreadDelegateAtomicPtr delegate =
227 base::subtle::NoBarrier_Load(&globals.io_thread_delegate); 227 base::subtle::NoBarrier_Load(&globals.io_thread_delegate);
228 if (delegate) 228 if (delegate)
229 reinterpret_cast<BrowserThreadDelegate*>(delegate)->Init(); 229 reinterpret_cast<BrowserThreadDelegate*>(delegate)->Init();
230 } 230 }
231 } 231 }
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 BrowserThreadDelegateAtomicPtr old_delegate = 682 BrowserThreadDelegateAtomicPtr old_delegate =
683 base::subtle::NoBarrier_AtomicExchange( 683 base::subtle::NoBarrier_AtomicExchange(
684 &globals.io_thread_delegate, 684 &globals.io_thread_delegate,
685 reinterpret_cast<BrowserThreadDelegateAtomicPtr>(delegate)); 685 reinterpret_cast<BrowserThreadDelegateAtomicPtr>(delegate));
686 686
687 // This catches registration when previously registered. 687 // This catches registration when previously registered.
688 DCHECK(!delegate || !old_delegate); 688 DCHECK(!delegate || !old_delegate);
689 } 689 }
690 690
691 } // namespace content 691 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_main_runner.cc ('k') | device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698