Chromium Code Reviews| 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 | 8 |
| 9 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 | 207 |
| 208 NOINLINE void BrowserThreadImpl::CacheThreadRun( | 208 NOINLINE void BrowserThreadImpl::CacheThreadRun( |
| 209 base::MessageLoop* message_loop) { | 209 base::MessageLoop* message_loop) { |
| 210 volatile int line_number = __LINE__; | 210 volatile int line_number = __LINE__; |
| 211 Thread::Run(message_loop); | 211 Thread::Run(message_loop); |
| 212 CHECK_GT(line_number, 0); | 212 CHECK_GT(line_number, 0); |
| 213 } | 213 } |
| 214 | 214 |
| 215 NOINLINE void BrowserThreadImpl::IOThreadRun(base::MessageLoop* message_loop) { | 215 NOINLINE void BrowserThreadImpl::IOThreadRun(base::MessageLoop* message_loop) { |
| 216 volatile int line_number = __LINE__; | 216 volatile int line_number = __LINE__; |
| 217 base::ThreadRestrictions::SetIOAllowed(true); | |
|
flackr
2014/08/13 15:52:36
FilePathWatcher asserts that IO is allowed on the
| |
| 217 Thread::Run(message_loop); | 218 Thread::Run(message_loop); |
| 218 CHECK_GT(line_number, 0); | 219 CHECK_GT(line_number, 0); |
| 219 } | 220 } |
| 220 | 221 |
| 221 MSVC_POP_WARNING() | 222 MSVC_POP_WARNING() |
| 222 MSVC_ENABLE_OPTIMIZE(); | 223 MSVC_ENABLE_OPTIMIZE(); |
| 223 | 224 |
| 224 void BrowserThreadImpl::Run(base::MessageLoop* message_loop) { | 225 void BrowserThreadImpl::Run(base::MessageLoop* message_loop) { |
| 225 #if defined(OS_ANDROID) | 226 #if defined(OS_ANDROID) |
| 226 // Not to reset thread name to "Thread-???" by VM, attach VM with thread name. | 227 // Not to reset thread name to "Thread-???" by VM, attach VM with thread name. |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 530 AtomicWord* storage = reinterpret_cast<AtomicWord*>( | 531 AtomicWord* storage = reinterpret_cast<AtomicWord*>( |
| 531 &globals.thread_delegates[identifier]); | 532 &globals.thread_delegates[identifier]); |
| 532 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( | 533 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( |
| 533 storage, reinterpret_cast<AtomicWord>(delegate)); | 534 storage, reinterpret_cast<AtomicWord>(delegate)); |
| 534 | 535 |
| 535 // This catches registration when previously registered. | 536 // This catches registration when previously registered. |
| 536 DCHECK(!delegate || !old_pointer); | 537 DCHECK(!delegate || !old_pointer); |
| 537 } | 538 } |
| 538 | 539 |
| 539 } // namespace content | 540 } // namespace content |
| OLD | NEW |