OLD | NEW |
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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceInitialized, | 223 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceInitialized, |
224 OnAcceleratedSurfaceInitialized) | 224 OnAcceleratedSurfaceInitialized) |
225 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, | 225 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, |
226 OnAcceleratedSurfaceBuffersSwapped) | 226 OnAcceleratedSurfaceBuffersSwapped) |
227 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, | 227 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, |
228 OnGraphicsInfoCollected) | 228 OnGraphicsInfoCollected) |
229 IPC_MESSAGE_HANDLER(GpuHostMsg_VideoMemoryUsageStats, | 229 IPC_MESSAGE_HANDLER(GpuHostMsg_VideoMemoryUsageStats, |
230 OnVideoMemoryUsageStatsReceived); | 230 OnVideoMemoryUsageStatsReceived); |
231 IPC_MESSAGE_HANDLER(GpuHostMsg_ResourcesRelinquished, | 231 IPC_MESSAGE_HANDLER(GpuHostMsg_ResourcesRelinquished, |
232 OnResourcesRelinquished) | 232 OnResourcesRelinquished) |
| 233 IPC_MESSAGE_HANDLER(GpuHostMsg_AddSubscription, OnAddSubscription); |
| 234 IPC_MESSAGE_HANDLER(GpuHostMsg_RemoveSubscription, OnRemoveSubscription); |
233 | 235 |
234 IPC_MESSAGE_UNHANDLED_ERROR() | 236 IPC_MESSAGE_UNHANDLED_ERROR() |
235 IPC_END_MESSAGE_MAP() | 237 IPC_END_MESSAGE_MAP() |
236 | 238 |
237 return true; | 239 return true; |
238 } | 240 } |
239 | 241 |
240 void GpuProcessHostUIShim::OnLogMessage( | 242 void GpuProcessHostUIShim::OnLogMessage( |
241 int level, | 243 int level, |
242 const std::string& header, | 244 const std::string& header, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 301 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
300 video_memory_usage_stats); | 302 video_memory_usage_stats); |
301 } | 303 } |
302 | 304 |
303 void GpuProcessHostUIShim::OnResourcesRelinquished() { | 305 void GpuProcessHostUIShim::OnResourcesRelinquished() { |
304 if (!relinquish_callback_.is_null()) { | 306 if (!relinquish_callback_.is_null()) { |
305 base::ResetAndReturn(&relinquish_callback_).Run(); | 307 base::ResetAndReturn(&relinquish_callback_).Run(); |
306 } | 308 } |
307 } | 309 } |
308 | 310 |
| 311 void GpuProcessHostUIShim::OnAddSubscription( |
| 312 int32 process_id, unsigned int target) { |
| 313 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
| 314 if (rph) { |
| 315 rph->OnAddSubscription(target); |
| 316 } |
| 317 } |
| 318 |
| 319 void GpuProcessHostUIShim::OnRemoveSubscription( |
| 320 int32 process_id, unsigned int target) { |
| 321 RenderProcessHost* rph = RenderProcessHost::FromID(process_id); |
| 322 if (rph) { |
| 323 rph->OnRemoveSubscription(target); |
| 324 } |
| 325 } |
| 326 |
309 } // namespace content | 327 } // namespace content |
OLD | NEW |