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/common/gpu/client/gpu_channel_host.h" | 5 #include "content/common/gpu/client/gpu_channel_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 int route_id = command_buffer->GetRouteID(); | 207 int route_id = command_buffer->GetRouteID(); |
208 Send(new GpuChannelMsg_DestroyCommandBuffer(route_id)); | 208 Send(new GpuChannelMsg_DestroyCommandBuffer(route_id)); |
209 // Check the proxy has not already been removed after a channel error. | 209 // Check the proxy has not already been removed after a channel error. |
210 if (proxies_.find(route_id) != proxies_.end()) | 210 if (proxies_.find(route_id) != proxies_.end()) |
211 proxies_.erase(route_id); | 211 proxies_.erase(route_id); |
212 RemoveRoute(route_id); | 212 RemoveRoute(route_id); |
213 delete command_buffer; | 213 delete command_buffer; |
214 #endif | 214 #endif |
215 } | 215 } |
216 | 216 |
| 217 bool GpuChannelHost::CollectRenderingStats( |
| 218 int route_id, content::GpuRenderingStats* stats) { |
| 219 TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats"); |
| 220 |
| 221 if (!Send(new GpuChannelMsg_CollectRenderingStats(route_id, stats))) |
| 222 return false; |
| 223 |
| 224 return true; |
| 225 } |
| 226 |
217 void GpuChannelHost::AddRoute( | 227 void GpuChannelHost::AddRoute( |
218 int route_id, base::WeakPtr<IPC::Listener> listener) { | 228 int route_id, base::WeakPtr<IPC::Listener> listener) { |
219 DCHECK(MessageLoopProxy::current()); | 229 DCHECK(MessageLoopProxy::current()); |
220 | 230 |
221 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); | 231 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); |
222 io_loop->PostTask(FROM_HERE, | 232 io_loop->PostTask(FROM_HERE, |
223 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, | 233 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, |
224 channel_filter_.get(), route_id, listener, | 234 channel_filter_.get(), route_id, listener, |
225 MessageLoopProxy::current())); | 235 MessageLoopProxy::current())); |
226 } | 236 } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 const GpuListenerInfo& info = it->second; | 311 const GpuListenerInfo& info = it->second; |
302 info.loop->PostTask( | 312 info.loop->PostTask( |
303 FROM_HERE, | 313 FROM_HERE, |
304 base::Bind(&IPC::Listener::OnChannelError, info.listener)); | 314 base::Bind(&IPC::Listener::OnChannelError, info.listener)); |
305 } | 315 } |
306 | 316 |
307 listeners_.clear(); | 317 listeners_.clear(); |
308 } | 318 } |
309 | 319 |
310 | 320 |
OLD | NEW |