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

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: 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') | base/test/scoped_task_scheduler.cc » ('J')
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..024e242771eccab2cfb0dad490174c9b29579d31 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,17 @@ 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. Different SingleThreadTaskRunners may be associated
fdoray 2017/03/27 20:11:50 // The Single-Threaded Apartment assigned to the r
robliao 2017/03/27 20:28:05 Changed the note to... There is not necessarily a
+// with different Single-Threaded Apartments so 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') | base/test/scoped_task_scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698