| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 channel_.reset(); | 313 channel_.reset(); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void GpuChannelHost::AddRoute( | 316 void GpuChannelHost::AddRoute( |
| 317 int route_id, base::WeakPtr<IPC::Listener> listener) { | 317 int route_id, base::WeakPtr<IPC::Listener> listener) { |
| 318 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 318 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 319 factory_->GetIOThreadTaskRunner(); | 319 factory_->GetIOThreadTaskRunner(); |
| 320 io_task_runner->PostTask(FROM_HERE, | 320 io_task_runner->PostTask(FROM_HERE, |
| 321 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, | 321 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, |
| 322 channel_filter_.get(), route_id, listener, | 322 channel_filter_.get(), route_id, listener, |
| 323 base::ThreadTaskRunnerHandle::Get())); | 323 factory_->TaskRunner())); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void GpuChannelHost::RemoveRoute(int route_id) { | 326 void GpuChannelHost::RemoveRoute(int route_id) { |
| 327 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 327 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 328 factory_->GetIOThreadTaskRunner(); | 328 factory_->GetIOThreadTaskRunner(); |
| 329 io_task_runner->PostTask( | 329 io_task_runner->PostTask( |
| 330 FROM_HERE, base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, | 330 FROM_HERE, base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, |
| 331 channel_filter_.get(), route_id)); | 331 channel_filter_.get(), route_id)); |
| 332 } | 332 } |
| 333 | 333 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 527 |
| 528 listeners_.clear(); | 528 listeners_.clear(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 bool GpuChannelHost::MessageFilter::IsLost() const { | 531 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 532 AutoLock lock(lock_); | 532 AutoLock lock(lock_); |
| 533 return lost_; | 533 return lost_; |
| 534 } | 534 } |
| 535 | 535 |
| 536 } // namespace content | 536 } // namespace content |
| OLD | NEW |