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.h> | 7 #include <string.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 } // namespace | 133 } // namespace |
134 | 134 |
135 BrowserThreadImpl::BrowserThreadImpl(ID identifier) | 135 BrowserThreadImpl::BrowserThreadImpl(ID identifier) |
136 : Thread(GetThreadName(identifier)), identifier_(identifier) { | 136 : Thread(GetThreadName(identifier)), identifier_(identifier) { |
137 Initialize(); | 137 Initialize(); |
138 } | 138 } |
139 | 139 |
140 BrowserThreadImpl::BrowserThreadImpl(ID identifier, | 140 BrowserThreadImpl::BrowserThreadImpl(ID identifier, |
141 base::MessageLoop* message_loop) | 141 base::MessageLoop* message_loop) |
142 : Thread(GetThreadName(identifier)), identifier_(identifier) { | 142 : Thread(GetThreadName(identifier)), identifier_(identifier) { |
143 set_message_loop(message_loop); | 143 SetMessageLoop(message_loop); |
144 Initialize(); | 144 Initialize(); |
145 } | 145 } |
146 | 146 |
147 // static | 147 // static |
148 void BrowserThreadImpl::ShutdownThreadPool() { | 148 void BrowserThreadImpl::ShutdownThreadPool() { |
149 // The goal is to make it impossible for chrome to 'infinite loop' during | 149 // The goal is to make it impossible for chrome to 'infinite loop' during |
150 // shutdown, but to reasonably expect that all BLOCKING_SHUTDOWN tasks queued | 150 // shutdown, but to reasonably expect that all BLOCKING_SHUTDOWN tasks queued |
151 // during shutdown get run. There's nothing particularly scientific about the | 151 // during shutdown get run. There's nothing particularly scientific about the |
152 // number chosen. | 152 // number chosen. |
153 const int kMaxNewShutdownBlockingTasks = 1000; | 153 const int kMaxNewShutdownBlockingTasks = 1000; |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 AtomicWord* storage = reinterpret_cast<AtomicWord*>( | 553 AtomicWord* storage = reinterpret_cast<AtomicWord*>( |
554 &globals.thread_delegates[identifier]); | 554 &globals.thread_delegates[identifier]); |
555 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( | 555 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( |
556 storage, reinterpret_cast<AtomicWord>(delegate)); | 556 storage, reinterpret_cast<AtomicWord>(delegate)); |
557 | 557 |
558 // This catches registration when previously registered. | 558 // This catches registration when previously registered. |
559 DCHECK(!delegate || !old_pointer); | 559 DCHECK(!delegate || !old_pointer); |
560 } | 560 } |
561 | 561 |
562 } // namespace content | 562 } // namespace content |
OLD | NEW |