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

Side by Side Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 2717233003: gpu: Use mojom API for getting video memory usage. (Closed)
Patch Set: . 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 unified diff | Download patch
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | content/common/gpu_host_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 180 }
181 181
182 bool GpuProcessHostUIShim::OnControlMessageReceived( 182 bool GpuProcessHostUIShim::OnControlMessageReceived(
183 const IPC::Message& message) { 183 const IPC::Message& message) {
184 DCHECK(CalledOnValidThread()); 184 DCHECK(CalledOnValidThread());
185 185
186 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) 186 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message)
187 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, OnLogMessage) 187 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, OnLogMessage)
188 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, 188 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected,
189 OnGraphicsInfoCollected) 189 OnGraphicsInfoCollected)
190 IPC_MESSAGE_HANDLER(GpuHostMsg_VideoMemoryUsageStats,
191 OnVideoMemoryUsageStatsReceived);
192 190
193 IPC_MESSAGE_UNHANDLED_ERROR() 191 IPC_MESSAGE_UNHANDLED_ERROR()
194 IPC_END_MESSAGE_MAP() 192 IPC_END_MESSAGE_MAP()
195 193
196 return true; 194 return true;
197 } 195 }
198 196
199 void GpuProcessHostUIShim::OnLogMessage( 197 void GpuProcessHostUIShim::OnLogMessage(
200 int level, 198 int level,
201 const std::string& header, 199 const std::string& header,
202 const std::string& message) { 200 const std::string& message) {
203 GpuDataManagerImpl::GetInstance()->AddLogMessage( 201 GpuDataManagerImpl::GetInstance()->AddLogMessage(
204 level, header, message); 202 level, header, message);
205 } 203 }
206 204
207 void GpuProcessHostUIShim::OnGraphicsInfoCollected( 205 void GpuProcessHostUIShim::OnGraphicsInfoCollected(
208 const gpu::GPUInfo& gpu_info) { 206 const gpu::GPUInfo& gpu_info) {
209 // OnGraphicsInfoCollected is sent back after the GPU process successfully 207 // OnGraphicsInfoCollected is sent back after the GPU process successfully
210 // initializes GL. 208 // initializes GL.
211 TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected"); 209 TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected");
212 210
213 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); 211 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info);
214 } 212 }
215 213
216 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived(
217 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) {
218 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats(
219 video_memory_usage_stats);
220 }
221
222 } // namespace content 214 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | content/common/gpu_host_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698