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

Unified Diff: base/task_scheduler/post_task.h

Issue 2768873007: Add Support to Get a COM STA Task Runner from the Task Scheduler API (Closed)
Patch Set: Simplify COM Init for ScopedTaskScheduler Created 3 years, 9 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 | base/task_scheduler/post_task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/post_task.h
diff --git a/base/task_scheduler/post_task.h b/base/task_scheduler/post_task.h
index 3174f06d63b11369079b84791aea2fb425bd23eb..dcb5bc0b0a3af06d65d577c5ba4c7876b03b7589 100644
--- a/base/task_scheduler/post_task.h
+++ b/base/task_scheduler/post_task.h
@@ -18,6 +18,7 @@
#include "base/task_runner.h"
#include "base/task_scheduler/task_traits.h"
#include "base/time/time.h"
+#include "build/build_config.h"
namespace base {
@@ -171,6 +172,19 @@ CreateSequencedTaskRunnerWithTraits(const TaskTraits& traits);
BASE_EXPORT scoped_refptr<SingleThreadTaskRunner>
CreateSingleThreadTaskRunnerWithTraits(const TaskTraits& traits);
+#if defined(OS_WIN)
+// Returns a SingleThreadTaskRunner whose PostTask invocations result in
+// scheduling tasks using |traits| in a COM Single-Threaded Apartment. Tasks run
+// in the same Single-Threaded Apartment in posting order for the returned
+// SingleThreadTaskRunner. There is not necessarily a one-to-one correspondence
+// between SingleThreadTaskRunners and Single-Threaded Apartments. The
+// implementation is free to share apartments or create new apartments as
+// necessary. In either case, care should be taken to make sure COM pointers are
+// not smuggled across apartments.
+BASE_EXPORT scoped_refptr<SingleThreadTaskRunner>
+CreateCOMSTATaskRunnerWithTraits(const TaskTraits& traits);
+#endif // defined(OS_WIN)
+
} // namespace base
#endif // BASE_TASK_SCHEDULER_POST_TASK_H_
« no previous file with comments | « no previous file | base/task_scheduler/post_task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698