| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 220 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 221 factory_->GetIOThreadTaskRunner(); | 221 factory_->GetIOThreadTaskRunner(); |
| 222 io_task_runner->PostTask( | 222 io_task_runner->PostTask( |
| 223 FROM_HERE, base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, | 223 FROM_HERE, base::Bind(&GpuChannelHost::MessageFilter::RemoveRoute, |
| 224 channel_filter_, route_id)); | 224 channel_filter_, route_id)); |
| 225 } | 225 } |
| 226 | 226 |
| 227 base::SharedMemoryHandle GpuChannelHost::ShareToGpuProcess( | 227 base::SharedMemoryHandle GpuChannelHost::ShareToGpuProcess( |
| 228 const base::SharedMemoryHandle& source_handle) { | 228 const base::SharedMemoryHandle& source_handle) { |
| 229 if (IsLost()) | 229 if (IsLost()) |
| 230 return base::SharedMemory::NULLHandle(); | 230 return base::SharedMemoryHandle(); |
| 231 | 231 |
| 232 return base::SharedMemory::DuplicateHandle(source_handle); | 232 return base::SharedMemory::DuplicateHandle(source_handle); |
| 233 } | 233 } |
| 234 | 234 |
| 235 int32_t GpuChannelHost::ReserveTransferBufferId() { | 235 int32_t GpuChannelHost::ReserveTransferBufferId() { |
| 236 // 0 is a reserved value. | 236 // 0 is a reserved value. |
| 237 return g_next_transfer_buffer_id.GetNext() + 1; | 237 return g_next_transfer_buffer_id.GetNext() + 1; |
| 238 } | 238 } |
| 239 | 239 |
| 240 int32_t GpuChannelHost::ReserveImageId() { | 240 int32_t GpuChannelHost::ReserveImageId() { |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 381 |
| 382 listeners_.clear(); | 382 listeners_.clear(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 bool GpuChannelHost::MessageFilter::IsLost() const { | 385 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 386 AutoLock lock(lock_); | 386 AutoLock lock(lock_); |
| 387 return lost_; | 387 return lost_; |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace gpu | 390 } // namespace gpu |
| OLD | NEW |