| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 GpuProcessHostUIShim::~GpuProcessHostUIShim() { | 141 GpuProcessHostUIShim::~GpuProcessHostUIShim() { |
| 142 DCHECK(CalledOnValidThread()); | 142 DCHECK(CalledOnValidThread()); |
| 143 g_hosts_by_id.Pointer()->Remove(host_id_); | 143 g_hosts_by_id.Pointer()->Remove(host_id_); |
| 144 } | 144 } |
| 145 | 145 |
| 146 bool GpuProcessHostUIShim::OnControlMessageReceived( | 146 bool GpuProcessHostUIShim::OnControlMessageReceived( |
| 147 const IPC::Message& message) { | 147 const IPC::Message& message) { |
| 148 DCHECK(CalledOnValidThread()); | 148 DCHECK(CalledOnValidThread()); |
| 149 | 149 |
| 150 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) | 150 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) |
| 151 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, OnLogMessage) | |
| 152 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, | 151 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected, |
| 153 OnGraphicsInfoCollected) | 152 OnGraphicsInfoCollected) |
| 154 | |
| 155 IPC_MESSAGE_UNHANDLED_ERROR() | 153 IPC_MESSAGE_UNHANDLED_ERROR() |
| 156 IPC_END_MESSAGE_MAP() | 154 IPC_END_MESSAGE_MAP() |
| 157 | 155 |
| 158 return true; | 156 return true; |
| 159 } | 157 } |
| 160 | 158 |
| 161 void GpuProcessHostUIShim::OnLogMessage( | |
| 162 int level, | |
| 163 const std::string& header, | |
| 164 const std::string& message) { | |
| 165 GpuDataManagerImpl::GetInstance()->AddLogMessage( | |
| 166 level, header, message); | |
| 167 } | |
| 168 | |
| 169 void GpuProcessHostUIShim::OnGraphicsInfoCollected( | 159 void GpuProcessHostUIShim::OnGraphicsInfoCollected( |
| 170 const gpu::GPUInfo& gpu_info) { | 160 const gpu::GPUInfo& gpu_info) { |
| 171 // OnGraphicsInfoCollected is sent back after the GPU process successfully | 161 // OnGraphicsInfoCollected is sent back after the GPU process successfully |
| 172 // initializes GL. | 162 // initializes GL. |
| 173 TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected"); | 163 TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected"); |
| 174 | 164 |
| 175 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); | 165 GpuDataManagerImpl::GetInstance()->UpdateGpuInfo(gpu_info); |
| 176 } | 166 } |
| 177 | 167 |
| 178 #if defined(OS_ANDROID) | 168 #if defined(OS_ANDROID) |
| 179 // static | 169 // static |
| 180 void GpuProcessHostUIShim::RegisterUIThreadMojoInterfaces( | 170 void GpuProcessHostUIShim::RegisterUIThreadMojoInterfaces( |
| 181 service_manager::InterfaceRegistry* registry) { | 171 service_manager::InterfaceRegistry* registry) { |
| 182 registry->AddInterface(base::Bind( | 172 registry->AddInterface(base::Bind( |
| 183 &BindJavaInterfaceOnUIThread<media::mojom::AndroidOverlayProvider>)); | 173 &BindJavaInterfaceOnUIThread<media::mojom::AndroidOverlayProvider>)); |
| 184 } | 174 } |
| 185 #endif | 175 #endif |
| 186 | 176 |
| 187 } // namespace content | 177 } // namespace content |
| OLD | NEW |