Reland "Add ComInitCheckHook for Eligible Builds to the Task Scheduler"
This is a reland of 57ad0495c848ac8a35efd6f1e011e9a204dadbc2
We fully expect this to break webrtc's bots to gather more data via
https://chromium-review.googlesource.com/c/550259/.
This will be reverted when that happens.
Original change's description:
> Add ComInitCheckHook for Eligible Builds to the Task Scheduler
>
> This will allow for COM initialization checking as code is refactored
> to use the task scheduler.
>
> As a side effect, this will also validate other COM call sites too.
>
> BUG=708303
>
> Change-Id: I0b38ea7d3e9a543c023aaada46a238f2421e97fd
> Reviewed-on: https://chromium-review.googlesource.com/546157
> Reviewed-by: Francois Doray <fdoray@chromium.org>
> Commit-Queue: Robert Liao <robliao@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#482385}
Previously reviewed.
Bug: 708303
TBR: gab@chromium.org, fdoray@chromium.org
Change-Id: I0026fb77b3a50511ab8678b5dffea8ae779b796b
Reviewed-on: https://chromium-review.googlesource.com/550859
Reviewed-by: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#482791}
CrOS-Libchrome-Original-Commit: df11c070beef44a89a1baaa6044070be41cc33f7
diff --git a/base/task_scheduler/task_scheduler_impl.h b/base/task_scheduler/task_scheduler_impl.h
index 1e35639..f9af1b5 100644
--- a/base/task_scheduler/task_scheduler_impl.h
+++ b/base/task_scheduler/task_scheduler_impl.h
@@ -30,6 +30,10 @@
#include "base/task_scheduler/task_tracker_posix.h"
#endif
+#if defined(OS_WIN)
+#include "base/win/com_init_check_hook.h"
+#endif
+
namespace base {
class HistogramBase;
@@ -99,6 +103,11 @@
AtomicFlag join_for_testing_returned_;
#endif
+#if defined(OS_WIN) && defined(COM_INIT_CHECK_HOOK_ENABLED)
+ // Provides COM initialization verification for supported builds.
+ base::win::ComInitCheckHook com_init_check_hook_;
+#endif
+
DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl);
};