Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/task_scheduler/scheduler_worker.h" | 5 #include "base/task_scheduler/scheduler_worker.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 40 | 40 |
| 41 outer_->delegate_->OnMainEntry(outer_); | 41 outer_->delegate_->OnMainEntry(outer_); |
| 42 | 42 |
| 43 // A SchedulerWorker starts out waiting for work. | 43 // A SchedulerWorker starts out waiting for work. |
| 44 WaitForWork(); | 44 WaitForWork(); |
| 45 | 45 |
| 46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 47 // This is required as SequencedWorkerPool previously blindly CoInitialized | 47 // This is required as SequencedWorkerPool previously blindly CoInitialized |
| 48 // all of its threads. | 48 // all of its threads. |
| 49 // TODO: Get rid of this broad COM scope and force tasks that care about a | 49 // TODO: Get rid of this broad COM scope and force tasks that care about a |
| 50 // CoInitialized environment to request one (via an upcoming ExecutionMode). | 50 // CoInitialized environment to request one (via an upcoming trait). |
|
robliao
2016/10/31 19:19:59
I thought we were keeping COM as an execution mode
fdoray
2016/10/31 19:44:51
From Gab in "Typed TaskRunners and child TaskRunne
robliao
2016/10/31 19:50:46
In the Sequenced+COM case, it would be unexpected
fdoray
2016/10/31 20:42:28
Changed "upcoming trait" to "upcoming execution mo
| |
| 51 win::ScopedCOMInitializer com_initializer; | 51 win::ScopedCOMInitializer com_initializer; |
| 52 #endif | 52 #endif |
| 53 | 53 |
| 54 while (!outer_->task_tracker_->IsShutdownComplete() && | 54 while (!outer_->task_tracker_->IsShutdownComplete() && |
| 55 !outer_->should_exit_for_testing_.IsSet()) { | 55 !outer_->should_exit_for_testing_.IsSet()) { |
| 56 DCHECK(outer_); | 56 DCHECK(outer_); |
| 57 | 57 |
| 58 #if defined(OS_MACOSX) | 58 #if defined(OS_MACOSX) |
| 59 mac::ScopedNSAutoreleasePool autorelease_pool; | 59 mac::ScopedNSAutoreleasePool autorelease_pool; |
| 60 #endif | 60 #endif |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 275 thread_ = Thread::Create(this); | 275 thread_ = Thread::Create(this); |
| 276 } | 276 } |
| 277 | 277 |
| 278 void SchedulerWorker::CreateThreadAssertSynchronized() { | 278 void SchedulerWorker::CreateThreadAssertSynchronized() { |
| 279 thread_lock_.AssertAcquired(); | 279 thread_lock_.AssertAcquired(); |
| 280 CreateThread(); | 280 CreateThread(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 } // namespace internal | 283 } // namespace internal |
| 284 } // namespace base | 284 } // namespace base |
| OLD | NEW |