There should be a TaskScheduler in every Chrome process so that we can use the post_task.h from everywhere in the codebase without fearing that the calls might run in a process that doesn't have a TaskScheduler.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/70e1c014474f8094e3b84f60761e355576a0f719 commit 70e1c014474f8094e3b84f60761e355576a0f719 Author: fdoray <fdoray@chromium.org> Date: Wed Nov 16 17:42:44 2016 Move function to compute the max number of threads in a TaskScheduler pool to base/. This CL moves the formula to compute the max number of threads in a TaskScheduler pool from components/task_scheduler_util/ to base/. This will allow the formula to be reused in content clients (content/renderer, content/gpu and content/utility). TBR=danakj@chromium.org BUG= 664996 Review-Url: https://codereview.chromium.org/2501203002 Cr-Commit-Position: refs/heads/master@{#432543} [modify] https://crrev.com/70e1c014474f8094e3b84f60761e355576a0f719/base/BUILD.gn [add] https://crrev.com/70e1c014474f8094e3b84f60761e355576a0f719/base/task_scheduler/initialization_util.cc [add] https://crrev.com/70e1c014474f8094e3b84f60761e355576a0f719/base/task_scheduler/initialization_util.h [modify] https://crrev.com/70e1c014474f8094e3b84f60761e355576a0f719/components/task_scheduler_util/initialization_util.cc
We want this for M56 IMO.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d commit acfa7150dd0f8a61a64ac8ae8e5d156407fb866d Author: robliao <robliao@chromium.org> Date: Thu Nov 17 18:33:32 2016 Add Thread Standby Policy SchedulerWorkerPoolImpl This change allows callers to specify if a thread should always be on standby to receive tasks or not. BUG= 664996 TBR=danakj for signature change in base/threading/sequenced_worker_pool_unittest.cc Review-Url: https://codereview.chromium.org/2501763002 Cr-Commit-Position: refs/heads/master@{#432919} [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/base/task_scheduler/scheduler_worker_pool_impl.cc [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/base/task_scheduler/scheduler_worker_pool_impl.h [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/base/task_scheduler/scheduler_worker_pool_params.cc [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/base/task_scheduler/scheduler_worker_pool_params.h [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/base/task_scheduler/task_scheduler_impl_unittest.cc [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/base/threading/sequenced_worker_pool_unittest.cc [modify] https://crrev.com/acfa7150dd0f8a61a64ac8ae8e5d156407fb866d/components/task_scheduler_util/initialization_util.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b32d035990150135bd44f0ae90030bed469c9624 commit b32d035990150135bd44f0ae90030bed469c9624 Author: fdoray <fdoray@chromium.org> Date: Mon Nov 21 22:30:43 2016 Redirect SequencedWorkerPool to TaskScheduler in the service process. With this CL, in the service process: - TaskScheduler is initialized. - Tasks posted to a SequencedWorkerPool are redirected to TaskScheduler. These steps will be done separately: - Redirect the service process' file thread to TaskScheduler. - Migrate all file thread / SequencedWorkerPool post task call sites in the service process to the base/task_scheduler/post_task.h API. BUG= 664996 Review-Url: https://codereview.chromium.org/2501033002 Cr-Commit-Position: refs/heads/master@{#433677} [modify] https://crrev.com/b32d035990150135bd44f0ae90030bed469c9624/chrome/service/service_process.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/57fc6249459477222cebba16f5d4c84f5e5dcee7 commit 57fc6249459477222cebba16f5d4c84f5e5dcee7 Author: fdoray <fdoray@chromium.org> Date: Thu Nov 24 17:33:08 2016 Initialize TaskScheduler in Mash. This CL initializes TaskScheduler in MashRunner::RunMain() and sets a flag to redirect all SequencedWorkerPool tasks to it That means that all tasks posted to the |blocking_pool_| in service_manager::Context will be redirected to TaskScheduler. Call sites will be migrated to the base/task_scheduler/post_task.h API and the |blocking_pool_| will be removed in separate CLs. BUG= 664996 Review-Url: https://codereview.chromium.org/2525073002 Cr-Commit-Position: refs/heads/master@{#434360} [modify] https://crrev.com/57fc6249459477222cebba16f5d4c84f5e5dcee7/chrome/app/mash/BUILD.gn [modify] https://crrev.com/57fc6249459477222cebba16f5d4c84f5e5dcee7/chrome/app/mash/mash_runner.cc [modify] https://crrev.com/57fc6249459477222cebba16f5d4c84f5e5dcee7/services/service_manager/standalone/context.cc [modify] https://crrev.com/57fc6249459477222cebba16f5d4c84f5e5dcee7/services/service_manager/standalone/context.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d2233a758df698c669341ef2e49b1ad2b23ce8da commit d2233a758df698c669341ef2e49b1ad2b23ce8da Author: fdoray <fdoray@chromium.org> Date: Tue Dec 13 17:18:21 2016 Initialize TaskScheduler in renderers. This CL initializes TaskScheduler in renderers using default arguments. ContentRenderClient may provide different arguments. Initially, no threads will be created by TaskScheduler in renderers because no tasks are posted to it and pools are initialized with StandbyThreadPolicy::LAZY. In a separate, we will start running v8 tasks in TaskScheduler rather than WorkerPool (https://cs.chromium.org/chromium/src/gin/v8_platform.cc?sq=package:chromium&l=70&dr=C). BUG= 664996 Review-Url: https://codereview.chromium.org/2491823005 Cr-Commit-Position: refs/heads/master@{#438202} [modify] https://crrev.com/d2233a758df698c669341ef2e49b1ad2b23ce8da/content/public/renderer/content_renderer_client.h [modify] https://crrev.com/d2233a758df698c669341ef2e49b1ad2b23ce8da/content/renderer/render_process_impl.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/4b4ca6521434859be5c614f961ec72b9e19826cc commit 4b4ca6521434859be5c614f961ec72b9e19826cc Author: fdoray <fdoray@chromium.org> Date: Mon Dec 19 15:58:37 2016 Split browser-specific and generic code in components/task_scheduler_util/. This will allow code to be reused to initialize TaskScheduler based on variation params in renderers. To avoid breaking ios-internal, this CL keeps existing components/task_scheduler_util APIs. Code in ChromeContentBrowserClient and ios-internal will be migrated to the new APIs in separate CLs. Then, old components/task_scheduler_util APIs will be deleted. TBR=blundell@chromium.org BUG= 664996 Review-Url: https://codereview.chromium.org/2565013002 Cr-Commit-Position: refs/heads/master@{#439481} [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/BUILD.gn [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/browser/BUILD.gn [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/browser/DEPS [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/browser/initialization.cc [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/browser/initialization.h [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/common/BUILD.gn [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/common/variations_util.cc [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/common/variations_util.h [add] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/common/variations_util_unittest.cc [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/initialization/BUILD.gn [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/initialization/browser_util.cc [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/initialization/browser_util.h [delete] https://crrev.com/5b0d1b3eef68419a0116b19438a117e49e9600de/components/task_scheduler_util/initialization/browser_util_unittest.cc [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/variations/BUILD.gn [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/variations/browser_variations_util.cc [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/variations/browser_variations_util.h [modify] https://crrev.com/4b4ca6521434859be5c614f961ec72b9e19826cc/components/task_scheduler_util/variations/browser_variations_util_unittest.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134 commit 1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134 Author: fdoray <fdoray@chromium.org> Date: Sat Jan 07 00:30:29 2017 Control TaskScheduler initialization params in renderers via field trial. BUG= 664996 Review-Url: https://codereview.chromium.org/2568793003 Cr-Commit-Position: refs/heads/master@{#442109} [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/chrome/renderer/BUILD.gn [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/chrome/renderer/DEPS [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/chrome/renderer/chrome_content_renderer_client.cc [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/chrome/renderer/chrome_content_renderer_client.h [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/common/BUILD.gn [add] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/common/DEPS [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/common/variations_util.cc [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/common/variations_util.h [modify] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/common/variations_util_unittest.cc [add] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/renderer/BUILD.gn [add] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/renderer/initialization.cc [add] https://crrev.com/1e3963fb07388dd5175f9e2d7bcd7ee1e3c8f134/components/task_scheduler_util/renderer/initialization.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/1dd2123f95a214c34887df33b27e46114b3d3fe4 commit 1dd2123f95a214c34887df33b27e46114b3d3fe4 Author: fdoray <fdoray@chromium.org> Date: Fri Jan 13 17:38:09 2017 Remove old APIs from components/task_scheduler_util/. Old functions were kept because they were used by ios_internal. Now that the relevant ios_internal code has been upstreamed, it is easy to remove the old functions and their call sites. BUG= 664996 Review-Url: https://codereview.chromium.org/2626783002 Cr-Commit-Position: refs/heads/master@{#443597} [modify] https://crrev.com/1dd2123f95a214c34887df33b27e46114b3d3fe4/chrome/browser/BUILD.gn [modify] https://crrev.com/1dd2123f95a214c34887df33b27e46114b3d3fe4/chrome/browser/chrome_content_browser_client.cc [modify] https://crrev.com/1dd2123f95a214c34887df33b27e46114b3d3fe4/components/BUILD.gn [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/initialization/BUILD.gn [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/initialization/DEPS [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/initialization/browser_util.cc [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/initialization/browser_util.h [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/variations/BUILD.gn [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/variations/DEPS [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/variations/browser_variations_util.cc [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/variations/browser_variations_util.h [delete] https://crrev.com/76b781d16735162ce3304f95c2749742185e12f1/components/task_scheduler_util/variations/browser_variations_util_unittest.cc [modify] https://crrev.com/1dd2123f95a214c34887df33b27e46114b3d3fe4/ios/chrome/browser/web/BUILD.gn [modify] https://crrev.com/1dd2123f95a214c34887df33b27e46114b3d3fe4/ios/chrome/browser/web/chrome_web_client.mm
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/71ee072729403850ee522e08fbd669d3bc2f142f commit 71ee072729403850ee522e08fbd669d3bc2f142f Author: fdoray <fdoray@chromium.org> Date: Tue Jan 17 18:50:34 2017 Initialize TaskScheduler in all child processes. base::WorkerPool is used in the GPU process (x11_hotplug_event_handler.cc:499). To migrate this call site to TaskScheduler, TaskScheduler must be initialized in the GPU process. base::WorkerPool is also used in PPAPI plugin process (v8_platform.cc:70). BUG= 664996 Review-Url: https://codereview.chromium.org/2627953002 Cr-Commit-Position: refs/heads/master@{#444100} [modify] https://crrev.com/71ee072729403850ee522e08fbd669d3bc2f142f/content/child/child_process.cc [modify] https://crrev.com/71ee072729403850ee522e08fbd669d3bc2f142f/content/child/child_process.h [modify] https://crrev.com/71ee072729403850ee522e08fbd669d3bc2f142f/content/renderer/render_process_impl.cc [modify] https://crrev.com/71ee072729403850ee522e08fbd669d3bc2f142f/content/renderer/render_process_impl.h
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/31cc6f8573abb454414ab2bdd26b07980eac2f8c commit 31cc6f8573abb454414ab2bdd26b07980eac2f8c Author: fdoray <fdoray@chromium.org> Date: Fri Feb 10 23:31:10 2017 Add TaskScheduler initialization arguments to ChildProcess. Previously, the constructor of ChildProcess called ChildProcess::InitializeTaskScheduler() to initialize TaskScheduler. RenderProcessImpl overrode this method to initialize TaskScheduler with custom arguments. Unfortunately, the constructor of a base class cannot call methods from a derived class. This CL removes the virtual ChildProcess::InitializeTaskScheduler() method. RnederProcessImpl passes its custom TaskScheduler initialization arguments to the constructor of ChildProcess. BUG= 664996 Review-Url: https://codereview.chromium.org/2687903003 Cr-Commit-Position: refs/heads/master@{#449785} [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/child/child_process.cc [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/child/child_process.h [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/renderer/BUILD.gn [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/renderer/in_process_renderer_thread.cc [add] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/renderer/render_process.cc [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/renderer/render_process.h [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/renderer/render_process_impl.cc [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/renderer/render_process_impl.h [modify] https://crrev.com/31cc6f8573abb454414ab2bdd26b07980eac2f8c/content/renderer/renderer_main.cc
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/0d1c63eff65ce57eee8a59bfdd400b38a4d0e1bf commit 0d1c63eff65ce57eee8a59bfdd400b38a4d0e1bf Author: Francois Doray <fdoray@chromium.org> Date: Wed Jun 07 18:11:25 2017 Initialize TaskScheduler in mash_browser_tests_main.cc. TaskScheduler is already initialized in services/service_manager/public/cpp/standalone_service/main.cc. It should also be initialized in mash_browser_tests_main.cc before running a standalone service to provide a similar environment in tests and in production. Bug: 664996 , 725505 Change-Id: I15373b9dcc185c0cbeee7efcafca1c9a9d5dd349 Reviewed-on: https://chromium-review.googlesource.com/523803 Reviewed-by: Scott Violet <sky@chromium.org> Commit-Queue: Francois Doray <fdoray@chromium.org> Cr-Commit-Position: refs/heads/master@{#477705} [modify] https://crrev.com/0d1c63eff65ce57eee8a59bfdd400b38a4d0e1bf/chrome/test/base/mash_browser_tests_main.cc
Comment 1 by gab@chromium.org
, Nov 14 2016