Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: gpu/ipc/client/gpu_channel_host.cc

Issue 2849633002: Get rid of base::SharedMemory::NULLHandle(); (Closed)
Patch Set: Rebase. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.cc ('k') | media/base/video_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/renderer_blink_platform_impl.cc ('k') | media/base/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698