| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ui_shim->OnMessageReceived(msg); | 65 ui_shim->OnMessageReceived(msg); |
| 66 } | 66 } |
| 67 | 67 |
| 68 GpuProcessHostUIShim::GpuProcessHostUIShim(int host_id) | 68 GpuProcessHostUIShim::GpuProcessHostUIShim(int host_id) |
| 69 : host_id_(host_id) { | 69 : host_id_(host_id) { |
| 70 g_hosts_by_id.Pointer()->AddWithID(this, host_id_); | 70 g_hosts_by_id.Pointer()->AddWithID(this, host_id_); |
| 71 #if defined(USE_OZONE) | 71 #if defined(USE_OZONE) |
| 72 ui::OzonePlatform::GetInstance() | 72 ui::OzonePlatform::GetInstance() |
| 73 ->GetGpuPlatformSupportHost() | 73 ->GetGpuPlatformSupportHost() |
| 74 ->OnChannelEstablished( | 74 ->OnChannelEstablished( |
| 75 host_id, | 75 host_id, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), |
| 76 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | |
| 77 base::Bind(&SendOnIOThreadTask, host_id_)); | 76 base::Bind(&SendOnIOThreadTask, host_id_)); |
| 78 #endif | 77 #endif |
| 79 } | 78 } |
| 80 | 79 |
| 81 // static | 80 // static |
| 82 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { | 81 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { |
| 83 DCHECK(!FromID(host_id)); | 82 DCHECK(!FromID(host_id)); |
| 84 return new GpuProcessHostUIShim(host_id); | 83 return new GpuProcessHostUIShim(host_id); |
| 85 } | 84 } |
| 86 | 85 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); | 209 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); |
| 211 } | 210 } |
| 212 | 211 |
| 213 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 212 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
| 214 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) { | 213 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) { |
| 215 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 214 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
| 216 video_memory_usage_stats); | 215 video_memory_usage_stats); |
| 217 } | 216 } |
| 218 | 217 |
| 219 } // namespace content | 218 } // namespace content |
| OLD | NEW |