| 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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 bool BrowserThread::PostBlockingPoolSequencedTask( | 332 bool BrowserThread::PostBlockingPoolSequencedTask( |
| 333 const std::string& sequence_token_name, | 333 const std::string& sequence_token_name, |
| 334 const tracked_objects::Location& from_here, | 334 const tracked_objects::Location& from_here, |
| 335 const base::Closure& task) { | 335 const base::Closure& task) { |
| 336 return g_globals.Get().blocking_pool->PostNamedSequencedWorkerTask( | 336 return g_globals.Get().blocking_pool->PostNamedSequencedWorkerTask( |
| 337 sequence_token_name, from_here, task); | 337 sequence_token_name, from_here, task); |
| 338 } | 338 } |
| 339 | 339 |
| 340 // static | 340 // static |
| 341 base::SequencedWorkerPool* BrowserThread::GetBlockingPool() { | 341 base::SequencedWorkerPool* BrowserThread::GetBlockingPool() { |
| 342 return g_globals.Get().blocking_pool; | 342 return g_globals.Get().blocking_pool.get(); |
| 343 } | 343 } |
| 344 | 344 |
| 345 // static | 345 // static |
| 346 bool BrowserThread::IsWellKnownThread(ID identifier) { | 346 bool BrowserThread::IsWellKnownThread(ID identifier) { |
| 347 if (g_globals == NULL) | 347 if (g_globals == NULL) |
| 348 return false; | 348 return false; |
| 349 | 349 |
| 350 BrowserThreadGlobals& globals = g_globals.Get(); | 350 BrowserThreadGlobals& globals = g_globals.Get(); |
| 351 base::AutoLock lock(globals.lock); | 351 base::AutoLock lock(globals.lock); |
| 352 return (identifier >= 0 && identifier < ID_COUNT && | 352 return (identifier >= 0 && identifier < ID_COUNT && |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 AtomicWord* storage = reinterpret_cast<AtomicWord*>( | 477 AtomicWord* storage = reinterpret_cast<AtomicWord*>( |
| 478 &globals.thread_delegates[identifier]); | 478 &globals.thread_delegates[identifier]); |
| 479 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( | 479 AtomicWord old_pointer = base::subtle::NoBarrier_AtomicExchange( |
| 480 storage, reinterpret_cast<AtomicWord>(delegate)); | 480 storage, reinterpret_cast<AtomicWord>(delegate)); |
| 481 | 481 |
| 482 // This catches registration when previously registered. | 482 // This catches registration when previously registered. |
| 483 DCHECK(!delegate || !old_pointer); | 483 DCHECK(!delegate || !old_pointer); |
| 484 } | 484 } |
| 485 | 485 |
| 486 } // namespace content | 486 } // namespace content |
| OLD | NEW |