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

Unified Diff: base/task_scheduler/task_scheduler.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 | « base/task_scheduler/post_task.cc ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_scheduler.h
diff --git a/base/task_scheduler/task_scheduler.h b/base/task_scheduler/task_scheduler.h
index 4b07c88998ba922f46914f7f88055b939e1947cc..8c5c3fb5706eaacf52bf932fe1bc835993f284f6 100644
--- a/base/task_scheduler/task_scheduler.h
+++ b/base/task_scheduler/task_scheduler.h
@@ -17,6 +17,7 @@
#include "base/task_runner.h"
#include "base/task_scheduler/task_traits.h"
#include "base/time/time.h"
+#include "build/build_config.h"
namespace gin {
class V8Platform;
@@ -72,6 +73,19 @@ class BASE_EXPORT TaskScheduler {
virtual scoped_refptr<SingleThreadTaskRunner>
CreateSingleThreadTaskRunnerWithTraits(const TaskTraits& traits) = 0;
+#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.
+ virtual scoped_refptr<SingleThreadTaskRunner>
+ CreateCOMSTATaskRunnerWithTraits(const TaskTraits& traits) = 0;
+#endif // defined(OS_WIN)
+
// Returns a vector of all histograms available in this task scheduler.
virtual std::vector<const HistogramBase*> GetHistograms() const = 0;
« no previous file with comments | « base/task_scheduler/post_task.cc ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698