wv/wl: make AndroidMetricsServiceClient always create MetricsService
I had wanted to register the providers as well, but that is problematic. In particular, Initialize() is called before consent has been determined (it's async for WV/WL). As some providers are configured differently depending upon whether reporting is enabled, configuring before reporting is enabled is problematic. I moved registering VariationsIdsProvider to where it happens on the desktop. Another possibility is to keep a pref of the last value and use that when initializing. That way MetricsService and providers could be created immediately. This route has the possibility for uploading some data when we shouldn't. This change would also be trickier (bigger), and I'm hoping to merge this to 88. Lastly, AndroidMetricsServiceClient is initialized earlier then happens on the desktop. In fact it's before threads have been initialized. This means some shuffling around of creation order would have to happen should we want to initialize all the providers (because current place triggers DCHECKs if it does try to create providers). BUG=1148351 TEST=MetricsServiceCreatedFromInitialize Change-Id: Ia82225cb237da38c3bef56815382dc597155fac0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551292 Commit-Queue: Scott Violet <sky@chromium.org> Reviewed-by:Michael Bai <michaelbai@chromium.org> Cr-Commit-Position: refs/heads/master@{#833373}
Showing
Please register or sign in to comment