Skip to content

Commit

Permalink
Load machine statistics with USER_BLOCKING priority on ChromeOS.
Browse files Browse the repository at this point in the history
The NoBackgroundTasksTest.FirstNonEmptyPaintWithoutBackgroundTasks
test shows that loading machine statistics is on the critical path
of loading the NTP on ChromeOS. Therefore, it must have a
USER_BLOCKING priority to run as soon as possible.

Bug: 831835
Change-Id: Icdcf45b7380ad270441609b4b2fb6021c8ea5933
Reviewed-on: https://chromium-review.googlesource.com/1082608
Reviewed-by: Achuith Bhandarkar <achuith@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564524}
  • Loading branch information
fdoray authored and Commit Bot committed Jun 5, 2018
1 parent 5792283 commit 3df8686
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion chromeos/system/statistics_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,11 @@ void StatisticsProviderImpl::StartLoadingMachineStatistics(
VLOG(1) << "Started loading statistics. Load OEM Manifest: "
<< load_oem_manifest;

// TaskPriority::USER_BLOCKING because this is on the critical path of
// rendering the NTP on startup. https://crbug.com/831835
base::PostTaskWithTraits(
FROM_HERE,
{base::MayBlock(), base::TaskPriority::BACKGROUND,
{base::MayBlock(), base::TaskPriority::USER_BLOCKING,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
base::BindOnce(&StatisticsProviderImpl::LoadMachineStatistics,
base::Unretained(this), load_oem_manifest));
Expand Down

0 comments on commit 3df8686

Please sign in to comment.