weblayer: fix race condition in setting up field trials
There were two problems here: 1. When FeatureListCreator created WebLayerVariationsServiceClient it was triggering creation of the network service (by calling SystemNetworkContextManager::GetSharedURLLoaderFactory). The network service has code paths that may check the state of features, so that by triggering creation of the network service before features were initialized the network service could potentially see features in the wrong state. 2. FeatureListCreator was calling PerformPreMainMessageLoopStartup followed by SetupFieldTrials(). This is not the expected order (in fact PerformPreMainMessageLoopStartup may also trigger creation of the network service). This makes the order match that of chrome. BUG=1049426 TEST=test only change Change-Id: I21508eada373d368c4f4d4b5d5719b636700dd44 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2125435 Commit-Queue: Scott Violet <sky@chromium.org> Reviewed-by:John Abd-El-Malek <jam@chromium.org> Cr-Commit-Position: refs/heads/master@{#754528}
Showing
Please register or sign in to comment