| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 if (ui_shim) | 64 if (ui_shim) |
| 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, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), | |
| 76 base::Bind(&SendOnIOThreadTask, host_id_)); | |
| 77 #endif | 75 #endif |
| 78 } | 76 } |
| 79 | 77 |
| 80 // static | 78 // static |
| 81 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { | 79 GpuProcessHostUIShim* GpuProcessHostUIShim::Create(int host_id) { |
| 82 DCHECK(!FromID(host_id)); | 80 DCHECK(!FromID(host_id)); |
| 83 return new GpuProcessHostUIShim(host_id); | 81 return new GpuProcessHostUIShim(host_id); |
| 84 } | 82 } |
| 85 | 83 |
| 86 // static | 84 // static |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); | 207 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); |
| 210 } | 208 } |
| 211 | 209 |
| 212 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( | 210 void GpuProcessHostUIShim::OnVideoMemoryUsageStatsReceived( |
| 213 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) { | 211 const gpu::VideoMemoryUsageStats& video_memory_usage_stats) { |
| 214 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( | 212 GpuDataManagerImpl::GetInstance()->UpdateVideoMemoryUsageStats( |
| 215 video_memory_usage_stats); | 213 video_memory_usage_stats); |
| 216 } | 214 } |
| 217 | 215 |
| 218 } // namespace content | 216 } // namespace content |
| OLD | NEW |