| 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 "gpu/ipc/client/gpu_channel_host.h" | 5 #include "gpu/ipc/client/gpu_channel_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 void GpuChannelHost::AddRouteWithTaskRunner( | 202 void GpuChannelHost::AddRouteWithTaskRunner( |
| 203 int route_id, | 203 int route_id, |
| 204 base::WeakPtr<IPC::Listener> listener, | 204 base::WeakPtr<IPC::Listener> listener, |
| 205 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 205 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 206 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 206 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 207 factory_->GetIOThreadTaskRunner(); | 207 factory_->GetIOThreadTaskRunner(); |
| 208 io_task_runner->PostTask( | 208 io_task_runner->PostTask( |
| 209 FROM_HERE, | 209 FROM_HERE, |
| 210 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, | 210 base::Bind(&GpuChannelHost::MessageFilter::AddRoute, |
| 211 channel_filter_.get(), route_id, listener, task_runner)); | 211 channel_filter_, route_id, listener, task_runner)); |
| 212 } | 212 } |
| 213 | 213 |
| 214 void GpuChannelHost::RemoveRoute(int route_id) { | 214 void GpuChannelHost::RemoveRoute(int route_id) { |
| 215 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 215 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 216 factory_->GetIOThreadTaskRunner(); | 216 factory_->GetIOThreadTaskRunner(); |
| 217 io_task_runner->PostTask( | 217 io_task_runner->PostTask( |
| 218 FROM_HERE, base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, | 218 FROM_HERE, base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, |
| 219 channel_filter_.get(), route_id)); | 219 channel_filter_, route_id)); |
| 220 } | 220 } |
| 221 | 221 |
| 222 base::SharedMemoryHandle GpuChannelHost::ShareToGpuProcess( | 222 base::SharedMemoryHandle GpuChannelHost::ShareToGpuProcess( |
| 223 base::SharedMemoryHandle source_handle) { | 223 base::SharedMemoryHandle source_handle) { |
| 224 if (IsLost()) | 224 if (IsLost()) |
| 225 return base::SharedMemory::NULLHandle(); | 225 return base::SharedMemory::NULLHandle(); |
| 226 | 226 |
| 227 return base::SharedMemory::DuplicateHandle(source_handle); | 227 return base::SharedMemory::DuplicateHandle(source_handle); |
| 228 } | 228 } |
| 229 | 229 |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 | 423 |
| 424 listeners_.clear(); | 424 listeners_.clear(); |
| 425 } | 425 } |
| 426 | 426 |
| 427 bool GpuChannelHost::MessageFilter::IsLost() const { | 427 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 428 AutoLock lock(lock_); | 428 AutoLock lock(lock_); |
| 429 return lost_; | 429 return lost_; |
| 430 } | 430 } |
| 431 | 431 |
| 432 } // namespace gpu | 432 } // namespace gpu |
| OLD | NEW |