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

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

Issue 2717233003: gpu: Use mojom API for getting video memory usage. (Closed)
Patch Set: . Created 3 years, 10 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 8d21371fd09cb5f40b3f03622d96e787eb5c1ab4..3d51dcd4270061060b0bb4edc7fec039dc6142a3 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -270,6 +270,15 @@ bool ShouldDisableHardwareAcceleration() {
switches::kDisableGpu);
}
+void OnVideoMemoryUsageStats(const gpu::VideoMemoryUsageStats& stats) {
+ GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats(stats);
+}
+
+void RequestVideoMemoryUsageStats(GpuProcessHost* host) {
+ host->gpu_service()->GetVideoMemoryUsageStats(
+ base::Bind(&OnVideoMemoryUsageStats));
+}
+
} // namespace anonymous
void GpuDataManagerImplPrivate::InitializeForTesting(
@@ -431,9 +440,9 @@ bool GpuDataManagerImplPrivate::IsCompleteGpuInfoAvailable() const {
}
void GpuDataManagerImplPrivate::RequestVideoMemoryUsageStatsUpdate() const {
- GpuProcessHost::SendOnIO(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
+ GpuProcessHost::CallOnIO(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED,
false /* force_create */,
- new GpuMsg_GetVideoMemoryUsageStats());
+ base::Bind(&RequestVideoMemoryUsageStats));
}
bool GpuDataManagerImplPrivate::ShouldUseSwiftShader() 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