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 { ...@@ -457,13 +457,13 @@ class HDRProxy {
public: public:
static void Initialize() { static void Initialize() {
display::win::ScreenWin::SetRequestHDRStatusCallback( display::win::ScreenWin::SetRequestHDRStatusCallback(
base::Bind(&HDRProxy::RequestHDRStatus)); base::BindRepeating(&HDRProxy::RequestHDRStatus));
} }
static void RequestHDRStatus() { static void RequestHDRStatus() {
// The request must be sent to the GPU process from the IO thread. // The request must be sent to the GPU process from the IO thread.
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
base::Bind(&HDRProxy::RequestOnIOThread)); base::BindOnce(&HDRProxy::RequestOnIOThread));
} }
private: private:
...@@ -472,7 +472,7 @@ class HDRProxy { ...@@ -472,7 +472,7 @@ class HDRProxy {
GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false); GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, false);
if (gpu_process_host) { if (gpu_process_host) {
gpu_process_host->RequestHDRStatus( gpu_process_host->RequestHDRStatus(
base::Bind(&HDRProxy::GotResultOnIOThread)); base::BindRepeating(&HDRProxy::GotResultOnIOThread));
} else { } else {
bool hdr_enabled = false; bool hdr_enabled = false;
GotResultOnIOThread(hdr_enabled); GotResultOnIOThread(hdr_enabled);
...@@ -480,7 +480,7 @@ class HDRProxy { ...@@ -480,7 +480,7 @@ class HDRProxy {
} }
static void GotResultOnIOThread(bool hdr_enabled) { static void GotResultOnIOThread(bool hdr_enabled) {
BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
base::Bind(&HDRProxy::GotResult, hdr_enabled)); base::BindOnce(&HDRProxy::GotResult, hdr_enabled));
} }
static void GotResult(bool hdr_enabled) { static void GotResult(bool hdr_enabled) {
display::win::ScreenWin::SetHDREnabled(hdr_enabled); display::win::ScreenWin::SetHDREnabled(hdr_enabled);
......
...@@ -84,7 +84,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, ...@@ -84,7 +84,7 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate,
BufferCreationStatus status)>; BufferCreationStatus status)>;
using RequestGPUInfoCallback = base::Callback<void(const gpu::GPUInfo&)>; using RequestGPUInfoCallback = base::Callback<void(const gpu::GPUInfo&)>;
using RequestHDRStatusCallback = base::Callback<void(bool)>; using RequestHDRStatusCallback = base::RepeatingCallback<void(bool)>;
static int GetGpuCrashCount(); static int GetGpuCrashCount();
......
...@@ -114,7 +114,7 @@ class DISPLAY_EXPORT ScreenWin : public Screen, ...@@ -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 // Set a callback to use to query the status of HDR. This callback will be
// called when the status of HDR may have changed. // called when the status of HDR may have changed.
using RequestHDRStatusCallback = base::Callback<void()>; using RequestHDRStatusCallback = base::RepeatingCallback<void()>;
static void SetRequestHDRStatusCallback( static void SetRequestHDRStatusCallback(
RequestHDRStatusCallback request_hdr_status_callback); 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