commit | 875789eaa469e365ac6fb7ac069f4ca6c0676cee | [log] [tgz] |
---|---|---|
author | Scott Violet <[email protected]> | Fri Feb 02 07:46:48 2018 |
committer | Commit Bot <[email protected]> | Fri Feb 02 07:46:48 2018 |
tree | 845454ebe54b915766739bc2e9536a4d7bfa688b | |
parent | d70a0519794f227e7408f341e9debcff410b0251 [diff] |
reland: Moves loading of local_state and field trials to early initialization Original is here: https://chromium-review.googlesource.com/c/chromium/src/+/882558 This differs from the patch that landed in two ways: 1. I completely misunderstood RunsTasksInCurrentSequence(). It may be called on any thread and basically comes down to checking if the current thread matches the thread the TaskRunner runs on. Changed implementation of DeferredSequencedTaskRunner and DeferringTaskRunner appropriately (added test for this). 2. Master prefs need ResourceBundle loaded with the data pack, so, shuffled around loading of that. This is covered by browser_tests that sadly only run on official builder. There are two motivations for this change: 1. In order to run a field trial for state setup in creating toolkit. 2. To have local state ready at the time ash is created. In order to have field trial ready I need to load local state and everything it touches. This ended up including ResourceBundle (not really the ResourceBundle, but the ResourceBundle code is used to determine the locale, and the locale is needed by code related to metrics, specifically ChromeMetricsServiceClient::GetApplicationLocale). As much of this code was previously created at a time when task runners were available I had to create a deferring task runner that queues up tasks and then flushes them when the real task runner is available. I've tried to only move what is necessary and leave as mush initialization as possible in the place before this change. You'll notice this creates g_browser_process early on. I explored not doing this, but it turns out very painful as instead some code then has to cache state that is later available in g_browser_process. The camel that broke the straws back was the application locale. See https://chromium-review.googlesource.com/c/chromium/src/+/853300 for the early approach. BUG=800358 [email protected],[email protected],[email protected] Change-Id: I3343e8959321900daec0de16f6a86715d3760f29 Reviewed-on: https://chromium-review.googlesource.com/898070 Commit-Queue: Scott Violet <[email protected]> Reviewed-by: Lei Zhang <[email protected]> Cr-Commit-Position: refs/heads/master@{#533989}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .