New issue
Advanced search Search tips

Issue 706479 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Feature



Sign in to add a comment

Add Multithreaded Apartment and Windows Runtime COM Support to TaskScheduler

Project Member Reported by robliao@chromium.org, Mar 29 2017

Issue description

This allows callers to schedule tasks that run on Multithreaded Apartments (MTA) and Windows Runtime (which uses MTAs)

2017 Oct 06
We decided to initialize the following for all worker pool threads:
* Windows 7: COM STA
* Windows 8.0+: RoInitialize With MTA (the only option as of this writing).

We're also going to augment the ComInit hook to make sure that folks know they're using an MTA to create the object (something along the lines of ScopedCOMMTA name tbd).
 
Description: Show this description
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7e3ab4c794d7eb22e96d3ba8a8218a65763c8429

commit 7e3ab4c794d7eb22e96d3ba8a8218a65763c8429
Author: Robert Liao <robliao@chromium.org>
Date: Thu Oct 26 03:33:29 2017

Add RoInitialize and RoUninitialize to core_winrt_util

This is required to get WinRT support into the task scheduler.

BUG= 706479 

Change-Id: I54943206beee8388f74b7404f289321cd060a7ba
Reviewed-on: https://chromium-review.googlesource.com/738921
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511725}
[modify] https://crrev.com/7e3ab4c794d7eb22e96d3ba8a8218a65763c8429/base/win/core_winrt_util.cc
[modify] https://crrev.com/7e3ab4c794d7eb22e96d3ba8a8218a65763c8429/base/win/core_winrt_util.h
[modify] https://crrev.com/7e3ab4c794d7eb22e96d3ba8a8218a65763c8429/base/win/core_winrt_util_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29

commit 9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29
Author: Robert Liao <robliao@chromium.org>
Date: Fri Oct 27 21:14:52 2017

Introduce ScopedWinrtInitializer and ScopedWindowsThreadEnvironment

This adds ScopedWinrtInitializer to allow for paired
base::win::RoInitialize() and base::win::RoUninitialize() calls.

ScopedWindowsThreadEnvironment serves as the new root class for both
ScopedComInitializer and ScopedWinrtInitializer so that consumers can use the
same field for conditional initialization between ScopedComInitializer or
ScopedWinrtInitializer.

BUG= 706479 
TBR=dcheng@chromium.org
base/BUILD.gn change

Change-Id: I9550d02f82a32657041bbc898ea0789b17c5bcf0
Reviewed-on: https://chromium-review.googlesource.com/741026
Reviewed-by: Robert Liao <robliao@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Robert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512292}
[modify] https://crrev.com/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29/base/BUILD.gn
[add] https://crrev.com/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29/base/win/scoped_com_initializer.cc
[modify] https://crrev.com/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29/base/win/scoped_com_initializer.h
[add] https://crrev.com/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29/base/win/scoped_windows_thread_environment.h
[add] https://crrev.com/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29/base/win/scoped_winrt_initializer.cc
[add] https://crrev.com/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29/base/win/scoped_winrt_initializer.h
[add] https://crrev.com/9c323eff7ad2bd1a9d62432df4b0bf84c6b0bd29/base/win/scoped_winrt_initializer_unittest.cc

Project Member

Comment 4 by bugdroid1@chromium.org, Oct 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a46c60239b3bd761f103027c398845991b06bfaa

commit a46c60239b3bd761f103027c398845991b06bfaa
Author: Robert Liao <robliao@chromium.org>
Date: Tue Oct 31 18:28:09 2017

Move the AV Check to the COM STA Task Runner

Previously, this ran in the Task Scheduler shared worker pool and
initialized an STA on its own, which blocks initializing the shared
worker pool as an MTA.

This change moves the work to the shared COM STA task runner as 
CLSID_WSCProductList expects to be run in an STA. CLSID_WbemLocator
is fine with an STA or MTA.

BUG= 706479 

Change-Id: I834b0fbcda47ea0168f0ce48c5ab3191adbf7f5e
Reviewed-on: https://chromium-review.googlesource.com/745317
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512882}
[modify] https://crrev.com/a46c60239b3bd761f103027c398845991b06bfaa/chrome/browser/metrics/antivirus_metrics_provider_win.cc
[modify] https://crrev.com/a46c60239b3bd761f103027c398845991b06bfaa/chrome/browser/metrics/antivirus_metrics_provider_win.h

Project Member

Comment 5 by bugdroid1@chromium.org, Nov 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba

commit 4393dc6bad8f81e44ef2d7eb40e8da3510aabfba
Author: Robert Liao <robliao@chromium.org>
Date: Wed Nov 01 20:06:03 2017

Add Optional COM MTA Support to All SchedulerWorkerPoolImpl Threads

This change initializes the Windows Runtime as an MTA for versions at
or above Windows 8 and COM as an MTA for versions below Windows 8 if
the caller requests for COM MTA.

BUG= 706479 

Change-Id: I55e08bb270ac9d1ebbce35647e8ae23ec8504f95
Reviewed-on: https://chromium-review.googlesource.com/741455
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513235}
[modify] https://crrev.com/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba/base/task_scheduler/scheduler_worker_pool_impl.cc
[modify] https://crrev.com/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba/base/task_scheduler/scheduler_worker_pool_impl.h
[modify] https://crrev.com/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc
[modify] https://crrev.com/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba/base/task_scheduler/scheduler_worker_pool_unittest.cc
[modify] https://crrev.com/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba/base/task_scheduler/task_scheduler.cc
[modify] https://crrev.com/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba/base/task_scheduler/task_scheduler.h
[modify] https://crrev.com/4393dc6bad8f81e44ef2d7eb40e8da3510aabfba/base/task_scheduler/task_scheduler_impl.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Nov 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1096f6b82b2d23041dd8ece6106e05545ee4d500

commit 1096f6b82b2d23041dd8ece6106e05545ee4d500
Author: Robert Liao <robliao@chromium.org>
Date: Thu Nov 02 16:28:14 2017

Remove base::SchedulerBackwardCompatibility::INIT_COM_STA From the Browser Process

The upcoming MTA change for the shared workers will override the STA
request.

BUG= 706479 
TBR=jam@chromium.org

Change-Id: I3451a5c9dde500999fe6561cc9743edd2f0dc6db
Reviewed-on: https://chromium-review.googlesource.com/750192
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513510}
[modify] https://crrev.com/1096f6b82b2d23041dd8ece6106e05545ee4d500/components/task_scheduler_util/browser/initialization.cc
[modify] https://crrev.com/1096f6b82b2d23041dd8ece6106e05545ee4d500/content/browser/browser_main_loop.cc

Project Member

Comment 7 by bugdroid1@chromium.org, Nov 2 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8d3b75514c405135e8bbc5e4a9c1b8576fb4d419

commit 8d3b75514c405135e8bbc5e4a9c1b8576fb4d419
Author: Robert Liao <robliao@chromium.org>
Date: Thu Nov 02 21:22:16 2017

Enable Shared Worker Pool COM MTA in the Browser Process

BUG= 706479 
TBR=jam@chromium.org
Task Scheduler parameter change for the browser process.

Change-Id: I0fa1712a4696db1845e4d4c57e68c3f7af49cec4
Reviewed-on: https://chromium-review.googlesource.com/749629
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513604}
[modify] https://crrev.com/8d3b75514c405135e8bbc5e4a9c1b8576fb4d419/components/task_scheduler_util/browser/initialization.cc
[modify] https://crrev.com/8d3b75514c405135e8bbc5e4a9c1b8576fb4d419/content/browser/browser_main_loop.cc

Status: Fixed (was: Assigned)
This is done!

Sign in to add a comment