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