| 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/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 bool GpuChannelHost::CollectRenderingStatsForSurface( | 230 bool GpuChannelHost::CollectRenderingStatsForSurface( |
| 231 int surface_id, GpuRenderingStats* stats) { | 231 int surface_id, GpuRenderingStats* stats) { |
| 232 TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats"); | 232 TRACE_EVENT0("gpu", "GpuChannelHost::CollectRenderingStats"); |
| 233 | 233 |
| 234 return Send(new GpuChannelMsg_CollectRenderingStatsForSurface(surface_id, | 234 return Send(new GpuChannelMsg_CollectRenderingStatsForSurface(surface_id, |
| 235 stats)); | 235 stats)); |
| 236 } | 236 } |
| 237 | 237 |
| 238 void GpuChannelHost::AddRoute( | 238 void GpuChannelHost::AddRoute( |
| 239 int route_id, base::WeakPtr<IPC::Listener> listener) { | 239 int route_id, base::WeakPtr<IPC::Listener> listener) { |
| 240 DCHECK(MessageLoopProxy::current()); | 240 DCHECK(MessageLoopProxy::current().get()); |
| 241 | 241 |
| 242 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); | 242 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); |
| 243 io_loop->PostTask(FROM_HERE, | 243 io_loop->PostTask(FROM_HERE, |
| 244 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, | 244 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, |
| 245 channel_filter_.get(), route_id, listener, | 245 channel_filter_.get(), route_id, listener, |
| 246 MessageLoopProxy::current())); | 246 MessageLoopProxy::current())); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void GpuChannelHost::RemoveRoute(int route_id) { | 249 void GpuChannelHost::RemoveRoute(int route_id) { |
| 250 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); | 250 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 const GpuListenerInfo& info = it->second; | 392 const GpuListenerInfo& info = it->second; |
| 393 info.loop->PostTask( | 393 info.loop->PostTask( |
| 394 FROM_HERE, | 394 FROM_HERE, |
| 395 base::Bind(&IPC::Listener::OnChannelError, info.listener)); | 395 base::Bind(&IPC::Listener::OnChannelError, info.listener)); |
| 396 } | 396 } |
| 397 | 397 |
| 398 listeners_.clear(); | 398 listeners_.clear(); |
| 399 } | 399 } |
| 400 | 400 |
| 401 } // namespace content | 401 } // namespace content |
| OLD | NEW |