| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |