| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 } | 525 } |
| 526 } | 526 } |
| 527 | 527 |
| 528 if (!target_thread_outlives_current) | 528 if (!target_thread_outlives_current) |
| 529 globals.lock.Release(); | 529 globals.lock.Release(); |
| 530 | 530 |
| 531 return accepting_tasks; | 531 return accepting_tasks; |
| 532 } | 532 } |
| 533 | 533 |
| 534 // static | 534 // static |
| 535 bool BrowserThread::PostBlockingPoolTask( | |
| 536 const tracked_objects::Location& from_here, | |
| 537 base::OnceClosure task) { | |
| 538 return g_globals.Get().blocking_pool->PostWorkerTask(from_here, | |
| 539 std::move(task)); | |
| 540 } | |
| 541 | |
| 542 // static | |
| 543 bool BrowserThread::PostBlockingPoolTaskAndReply( | |
| 544 const tracked_objects::Location& from_here, | |
| 545 base::OnceClosure task, | |
| 546 base::OnceClosure reply) { | |
| 547 return g_globals.Get().blocking_pool->PostTaskAndReply( | |
| 548 from_here, std::move(task), std::move(reply)); | |
| 549 } | |
| 550 | |
| 551 // static | |
| 552 bool BrowserThread::PostBlockingPoolSequencedTask( | 535 bool BrowserThread::PostBlockingPoolSequencedTask( |
| 553 const std::string& sequence_token_name, | 536 const std::string& sequence_token_name, |
| 554 const tracked_objects::Location& from_here, | 537 const tracked_objects::Location& from_here, |
| 555 base::OnceClosure task) { | 538 base::OnceClosure task) { |
| 556 return g_globals.Get().blocking_pool->PostNamedSequencedWorkerTask( | 539 return g_globals.Get().blocking_pool->PostNamedSequencedWorkerTask( |
| 557 sequence_token_name, from_here, std::move(task)); | 540 sequence_token_name, from_here, std::move(task)); |
| 558 } | 541 } |
| 559 | 542 |
| 560 // static | 543 // static |
| 561 void BrowserThread::PostAfterStartupTask( | 544 void BrowserThread::PostAfterStartupTask( |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 BrowserThreadDelegateAtomicPtr old_delegate = | 682 BrowserThreadDelegateAtomicPtr old_delegate = |
| 700 base::subtle::NoBarrier_AtomicExchange( | 683 base::subtle::NoBarrier_AtomicExchange( |
| 701 &globals.io_thread_delegate, | 684 &globals.io_thread_delegate, |
| 702 reinterpret_cast<BrowserThreadDelegateAtomicPtr>(delegate)); | 685 reinterpret_cast<BrowserThreadDelegateAtomicPtr>(delegate)); |
| 703 | 686 |
| 704 // This catches registration when previously registered. | 687 // This catches registration when previously registered. |
| 705 DCHECK(!delegate || !old_delegate); | 688 DCHECK(!delegate || !old_delegate); |
| 706 } | 689 } |
| 707 | 690 |
| 708 } // namespace content | 691 } // namespace content |
| OLD | NEW |