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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 bool BrowserThread::PostBlockingPoolSequencedTask( | 316 bool BrowserThread::PostBlockingPoolSequencedTask( |
317 const std::string& sequence_token_name, | 317 const std::string& sequence_token_name, |
318 const tracked_objects::Location& from_here, | 318 const tracked_objects::Location& from_here, |
319 const base::Closure& task) { | 319 const base::Closure& task) { |
320 return g_globals.Get().blocking_pool->PostNamedSequencedWorkerTask( | 320 return g_globals.Get().blocking_pool->PostNamedSequencedWorkerTask( |
321 sequence_token_name, from_here, task); | 321 sequence_token_name, from_here, task); |
322 } | 322 } |
323 | 323 |
324 // static | 324 // static |
325 base::SequencedWorkerPool* BrowserThread::GetBlockingPool() { | 325 base::SequencedWorkerPool* BrowserThread::GetBlockingPool() { |
326 return g_globals.Get().blocking_pool; | 326 return g_globals.Get().blocking_pool.get(); |
327 } | 327 } |
328 | 328 |
329 // static | 329 // static |
330 bool BrowserThread::IsWellKnownThread(ID identifier) { | 330 bool BrowserThread::IsWellKnownThread(ID identifier) { |
331 if (g_globals == NULL) | 331 if (g_globals == NULL) |
332 return false; | 332 return false; |
333 | 333 |
334 BrowserThreadGlobals& globals = g_globals.Get(); | 334 BrowserThreadGlobals& globals = g_globals.Get(); |
335 base::AutoLock lock(globals.lock); | 335 base::AutoLock lock(globals.lock); |
336 return (identifier >= 0 && identifier < ID_COUNT && | 336 return (identifier >= 0 && identifier < ID_COUNT && |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 AtomicWord* storage = reinterpret_cast<AtomicWord*>( | 463 AtomicWord* storage = reinterpret_cast<AtomicWord*>( |
464 &globals.thread_delegates[identifier]); | 464 &globals.thread_delegates[identifier]); |
465 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( | 465 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( |
466 storage, reinterpret_cast<AtomicWord>(delegate)); | 466 storage, reinterpret_cast<AtomicWord>(delegate)); |
467 | 467 |
468 // This catches registration when previously registered. | 468 // This catches registration when previously registered. |
469 DCHECK(!delegate || !old_pointer); | 469 DCHECK(!delegate || !old_pointer); |
470 } | 470 } |
471 | 471 |
472 } // namespace content | 472 } // namespace content |
OLD | NEW |