Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(506)

Unified Diff: content/browser/gpu/gpu_data_manager_impl_private.cc

Issue 2753293003: gpu: Replace GpuMsg_CollectGraphicsInfo with mojom API. (Closed)
Patch Set: tot merge Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index 319a130a4c0c68108af5018bf44776b414c81fdb..ab968d4f32ae2bc3f6cc8eb7ba5a33ef5a39b27f 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -282,6 +282,20 @@ void RequestVideoMemoryUsageStats(GpuProcessHost* host) {
base::Bind(&OnVideoMemoryUsageStats));
}
+void UpdateGpuInfoOnIO(const gpu::GPUInfo& gpu_info) {
+ // This function is called on the IO thread, but GPUInfo on GpuDataManagerImpl
+ // should be updated on the UI thread (since it can call into functions that
+ // expect to run in the UI thread, e.g. ContentClient::SetGpuInfo()).
+ BrowserThread::PostTask(
+ BrowserThread::UI, FROM_HERE,
+ base::Bind(
+ [](const gpu::GPUInfo& gpu_info) {
+ TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected");
+ GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info);
+ },
+ gpu_info));
+}
+
} // namespace anonymous
void GpuDataManagerImplPrivate::InitializeForTesting(
@@ -418,13 +432,18 @@ void GpuDataManagerImplPrivate::RequestCompleteGpuInfoIfNeeded() {
complete_gpu_info_already_requested_ = true;
- GpuProcessHost::SendOnIO(
+ GpuProcessHost::CallOnIO(
#if defined(OS_WIN)
GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED,
#else
GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
#endif
- true /* force_create */, new GpuMsg_CollectGraphicsInfo());
+ true /* force_create */, base::Bind([](GpuProcessHost* host) {
+ if (!host)
+ return;
+ host->gpu_service()->RequestCompleteGpuInfo(
+ base::Bind(&UpdateGpuInfoOnIO));
+ }));
}
bool GpuDataManagerImplPrivate::IsEssentialGpuInfoAvailable() const {
« no previous file with comments | « no previous file | content/browser/gpu/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698