Commit e83db3d1 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[ui] Boost priority on the first call to BuildDeviceToPathMapOnBackgroundThread

DLL loading on background thread causing priority inversions that jank
the main thread, see https://crbug.com/973868#c31 for a snapshot of
a jank caused by this one.

Bug: 973868
Change-Id: Id4879953754fb6bef09ef95fe998befce508e047
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2152904Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760046}
parent d080c865
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/files/file_util.h" #include "base/files/file_util.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task/thread_pool.h" #include "base/task/thread_pool.h"
#include "base/threading/scoped_thread_priority.h"
#include "ui/display/win/display_info.h" #include "ui/display/win/display_info.h"
#include "ui/gfx/icc_profile.h" #include "ui/gfx/icc_profile.h"
...@@ -79,6 +80,7 @@ void ColorProfileReader::UpdateIfNeeded() { ...@@ -79,6 +80,7 @@ void ColorProfileReader::UpdateIfNeeded() {
// static // static
ColorProfileReader::DeviceToPathMap ColorProfileReader::DeviceToPathMap
ColorProfileReader::BuildDeviceToPathMapOnBackgroundThread() { ColorProfileReader::BuildDeviceToPathMapOnBackgroundThread() {
SCOPED_MAY_LOAD_LIBRARY_AT_BACKGROUND_PRIORITY();
DeviceToPathMap device_to_path_map; DeviceToPathMap device_to_path_map;
EnumDisplayMonitors(nullptr, nullptr, EnumMonitorForProfilePathCallback, EnumDisplayMonitors(nullptr, nullptr, EnumMonitorForProfilePathCallback,
reinterpret_cast<LPARAM>(&device_to_path_map)); reinterpret_cast<LPARAM>(&device_to_path_map));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment