Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1165)

Unified Diff: base/task_scheduler/scheduler_worker.cc

Issue 2435013006: [TaskScheduler] Temporarily co-init all TaskScheduler threads to match SequencedWorkerPool's behavi… (Closed)
Patch Set: outside while loop Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_worker.cc
diff --git a/base/task_scheduler/scheduler_worker.cc b/base/task_scheduler/scheduler_worker.cc
index d05d63aafda5711b671bf0fa13c77f4a0c331242..ca0cdc5193a671dba36a3b8cdbb5a786cf71cc81 100644
--- a/base/task_scheduler/scheduler_worker.cc
+++ b/base/task_scheduler/scheduler_worker.cc
@@ -16,6 +16,8 @@
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
+#elif defined(OS_WIN)
+#include "base/win/scoped_com_initializer.h"
#endif
namespace base {
@@ -46,6 +48,14 @@ class SchedulerWorker::Thread : public PlatformThread::Delegate {
// A SchedulerWorker starts out waiting for work.
WaitForWork();
+#if defined(OS_WIN)
+ // This is required as SequencedWorkerPool previously blindly CoInitialized
+ // all of its threads.
+ // TODO: Get rid of this broad COM scope and force tasks that care about a
+ // CoInitialized environment to request one (via an upcoming ExecutionMode).
+ win::ScopedCOMInitializer com_initializer;
+#endif
+
while (!outer_->task_tracker_->IsShutdownComplete() &&
!outer_->should_exit_for_testing_.IsSet()) {
DCHECK(outer_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698