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/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 } // namespace | 98 } // namespace |
99 | 99 |
100 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg) { | 100 void RouteToGpuProcessHostUIShimTask(int host_id, const IPC::Message& msg) { |
101 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(host_id); | 101 GpuProcessHostUIShim* ui_shim = GpuProcessHostUIShim::FromID(host_id); |
102 if (ui_shim) | 102 if (ui_shim) |
103 ui_shim->OnMessageReceived(msg); | 103 ui_shim->OnMessageReceived(msg); |
104 } | 104 } |
105 | 105 |
106 GpuProcessHostUIShim::GpuProcessHostUIShim(int host_id) | 106 GpuProcessHostUIShim::GpuProcessHostUIShim(int host_id) |
107 : host_id_(host_id) { | 107 : host_id_(host_id), |
| 108 power_monitor_broadcaster_(this) { |
108 g_hosts_by_id.Pointer()->AddWithID(this, host_id_); | 109 g_hosts_by_id.Pointer()->AddWithID(this, host_id_); |
109 } | 110 } |
110 | 111 |
111 // static | 112 // static |
112 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { | 113 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { |
113 DCHECK(!FromID(host_id)); | 114 DCHECK(!FromID(host_id)); |
114 return new GpuProcessHostUIShim(host_id); | 115 return new GpuProcessHostUIShim(host_id); |
115 } | 116 } |
116 | 117 |
117 // static | 118 // static |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 view->AcceleratedSurfaceRelease(); | 392 view->AcceleratedSurfaceRelease(); |
392 } | 393 } |
393 | 394 |
394 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 395 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
395 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 396 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
396 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 397 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
397 video_memory_usage_stats); | 398 video_memory_usage_stats); |
398 } | 399 } |
399 | 400 |
400 } // namespace content | 401 } // namespace content |
OLD | NEW |