Commit 32c68cac authored by Mark Pilgrim's avatar Mark Pilgrim Committed by Commit Bot

Migrate HDRProxy to BindOnce/BindRepeating

Bug: 714018
Change-Id: I4c0c9935a6c2864717eb9a0f995591d85e3d2a15
Reviewed-on: https://chromium-review.googlesource.com/1039947
Commit-Queue: Mark Pilgrim <pilgrim@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#555629}
parent 76e8ae4f
......@@ -457,13 +457,13 @@ class HDRProxy {
public:
static void Initialize() {
display::win::ScreenWin::SetRequestHDRStatusCallback(
base::Bind(&HDRProxy::RequestHDRStatus));
base::BindRepeating(&HDRProxy::RequestHDRStatus));
}
static void RequestHDRStatus() {
// The request must be sent to the GPU process from the IO thread.
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&HDRProxy::RequestOnIOThread));
base::BindOnce(&HDRProxy::RequestOnIOThread));
}
private:
......@@ -472,7 +472,7 @@ class HDRProxy {
GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false);
if (gpu_process_host) {
gpu_process_host->RequestHDRStatus(
base::Bind(&HDRProxy::GotResultOnIOThread));
base::BindRepeating(&HDRProxy::GotResultOnIOThread));
} else {
bool hdr_enabled = false;
GotResultOnIOThread(hdr_enabled);
......@@ -480,7 +480,7 @@ class HDRProxy {
}
static void GotResultOnIOThread(bool hdr_enabled) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&HDRProxy::GotResult, hdr_enabled));
base::BindOnce(&HDRProxy::GotResult, hdr_enabled));
}
static void GotResult(bool hdr_enabled) {
display::win::ScreenWin::SetHDREnabled(hdr_enabled);
......
......@@ -84,7 +84,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
BufferCreationStatus status)>;
using RequestGPUInfoCallback = base::Callback<void(const gpu::GPUInfo&)>;
using RequestHDRStatusCallback = base::Callback<void(bool)>;
using RequestHDRStatusCallback = base::RepeatingCallback<void(bool)>;
static int GetGpuCrashCount();
......
......@@ -114,7 +114,7 @@ class DISPLAY_EXPORT ScreenWin : public Screen,
// Set a callback to use to query the status of HDR. This callback will be
// called when the status of HDR may have changed.
using RequestHDRStatusCallback = base::Callback<void()>;
using RequestHDRStatusCallback = base::RepeatingCallback<void()>;
static void SetRequestHDRStatusCallback(
RequestHDRStatusCallback request_hdr_status_callback);
......
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