Reland "Switching Previews triggering from the IO thread to the UI thread"
This is a reland of 310c6fa1909da00f001303a6498878e987487b8a
This was caused by a CL that landed on Friday morning that was missing a
RunUntilIdle (that was added for the rest of the tests in the file).
https://chromium-review.googlesource.com/c/chromium/src/+/1289086 added
the failing test. The delta for the reland is adding a RunUntilIdle.
Original change's description:
> Switching Previews triggering from the IO thread to the UI thread
>
> This CL moves previews triggering from the IO thread
> (ChromeResourceDispatcherHostDelegate) to the UI thread
> (ChromeContentBrowserClient). The new call sites occur in
> NavigationRequest and update the previews_state in
> CommonNavigationParams held by the NavigationRequest directly. This
> means PreviewsDeciderImpl is being moved to the UI thread.
>
> Significant changes:
> - PreviewsDeciderImpl is now owned by the PreviewsUIService instead of
> profile IO data.
> - PreviewsUserData is now entirely a UI thread notion. For now, we use
> PreviewsUITabHelper to manage its lifetime, but it could move to
> NavigationHandle (if NavigationHandle already supported UserData,
> that solution would be ideal).
> - ChromeNavigationData is update to remove PreviewsUserData and
> PreviewsState (the latter has moved into PreviewsUserData and there is a
> notion of Allowed PreviewsState and committed PreviewsState)
> - Offline Previews committed checks use the OfflinePreviewsTabHelper
> instead of PreviewsUserData now that we are on the same thread.
> - Cleanup on ResourceRequestInfo to remove PreviewsState setter as well
> as cleanup to remove PreviewsState from being passed back out of the
> loader code into NavigationRequest.
> - There is a TODO to re-evaluate PreviewsState during redirects, which
> will *not* be plumbed into the network service, so DataReductionProxy
> Previews will not be updated.
>
> Bug: 842233
> Change-Id: I80a3044a4c84734b877f8ebcbe5a4bb2c2900dbb
> Reviewed-on: https://chromium-review.googlesource.com/c/1266196
> Commit-Queue: Ryan Sturm <[email protected]>
> Reviewed-by: Jochen Eisinger <[email protected]>
> Reviewed-by: Camille Lamy <[email protected]>
> Reviewed-by: Tarun Bansal <[email protected]>
> Reviewed-by: Matt Menke <[email protected]>
> Reviewed-by: Jian Li <[email protected]>
> Cr-Commit-Position: refs/heads/master@{#601298}
Bug: 842233,897385
Change-Id: I4ff029a45edf3a1ac84f409fb3326d6767f03fd8
[email protected],[email protected],[email protected],[email protected],[email protected]
Change-Id: I4ff029a45edf3a1ac84f409fb3326d6767f03fd8
Reviewed-on: https://chromium-review.googlesource.com/c/1292955
Reviewed-by: Ryan Sturm <[email protected]>
Commit-Queue: Ryan Sturm <[email protected]>
Cr-Commit-Position: refs/heads/master@{#601426}
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 5840c82..ba69c7d 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -1366,7 +1366,7 @@
optimization_guide_service_ =
std::make_unique<optimization_guide::OptimizationGuideService>(
base::CreateSingleThreadTaskRunnerWithTraits(
- {content::BrowserThread::IO}));
+ {content::BrowserThread::UI}));
}
void BrowserProcessImpl::CreateGCMDriver() {