Chromium Code Reviews| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 } | 96 } |
| 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, bool single_process) |
| 107 : host_id_(host_id) { | 107 : host_id_(host_id) { |
| 108 g_hosts_by_id.Pointer()->AddWithID(this, host_id_); | 108 g_hosts_by_id.Pointer()->AddWithID(this, host_id_); |
| 109 if (!single_process) | |
| 110 power_monitor_broadcaster_.reset(new PowerMonitorMessageBroadcaster(this)); | |
|
jam
2013/07/17 00:29:42
since this is a generic class, it should be attach
bajones
2013/07/19 22:44:56
I generally agree with this sentiment, but as apat
jam
2013/07/20 00:28:55
There are two kinds of child process hosts: the re
| |
| 109 } | 111 } |
| 110 | 112 |
| 111 // static | 113 // static |
| 112 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { | 114 GpuProcessHostUIShim* GpuProcessHostUIShim::Create( |
| 115 int host_id, | |
| 116 bool single_process) { | |
| 113 DCHECK(!FromID(host_id)); | 117 DCHECK(!FromID(host_id)); |
| 114 return new GpuProcessHostUIShim(host_id); | 118 return new GpuProcessHostUIShim(host_id, single_process); |
| 115 } | 119 } |
| 116 | 120 |
| 117 // static | 121 // static |
| 118 void GpuProcessHostUIShim::Destroy(int host_id, const std::string& message) { | 122 void GpuProcessHostUIShim::Destroy(int host_id, const std::string& message) { |
| 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 123 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 120 | 124 |
| 121 GpuDataManagerImpl::GetInstance()->AddLogMessage( | 125 GpuDataManagerImpl::GetInstance()->AddLogMessage( |
| 122 logging::LOG_ERROR, "GpuProcessHostUIShim", | 126 logging::LOG_ERROR, "GpuProcessHostUIShim", |
| 123 message); | 127 message); |
| 124 | 128 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 393 view->AcceleratedSurfaceRelease(); | 397 view->AcceleratedSurfaceRelease(); |
| 394 } | 398 } |
| 395 | 399 |
| 396 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 400 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
| 397 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { | 401 const GPUVideoMemoryUsageStats& video_memory_usage_stats) { |
| 398 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 402 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
| 399 video_memory_usage_stats); | 403 video_memory_usage_stats); |
| 400 } | 404 } |
| 401 | 405 |
| 402 } // namespace content | 406 } // namespace content |
| OLD | NEW |