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

Side by Side Diff: ppapi/proxy/proxy_channel.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 | « ppapi/proxy/ppb_graphics_3d_proxy.cc ('k') | ppapi/proxy/serialized_handle.h » ('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 "ppapi/proxy/proxy_channel.h" 5 #include "ppapi/proxy/proxy_channel.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "ipc/ipc_platform_file.h" 9 #include "ipc/ipc_platform_file.h"
10 #include "ipc/ipc_test_sink.h" 10 #include "ipc/ipc_test_sink.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 return IPC::InvalidPlatformFileForTransit(); 64 return IPC::InvalidPlatformFileForTransit();
65 } 65 }
66 DCHECK(peer_pid_ != base::kNullProcessId); 66 DCHECK(peer_pid_ != base::kNullProcessId);
67 return delegate_->ShareHandleWithRemote(handle, peer_pid_, 67 return delegate_->ShareHandleWithRemote(handle, peer_pid_,
68 should_close_source); 68 should_close_source);
69 } 69 }
70 70
71 base::SharedMemoryHandle ProxyChannel::ShareSharedMemoryHandleWithRemote( 71 base::SharedMemoryHandle ProxyChannel::ShareSharedMemoryHandleWithRemote(
72 const base::SharedMemoryHandle& handle) { 72 const base::SharedMemoryHandle& handle) {
73 if (!channel_.get()) 73 if (!channel_.get())
74 return base::SharedMemory::NULLHandle(); 74 return base::SharedMemoryHandle();
75 75
76 DCHECK(peer_pid_ != base::kNullProcessId); 76 DCHECK(peer_pid_ != base::kNullProcessId);
77 return delegate_->ShareSharedMemoryHandleWithRemote(handle, peer_pid_); 77 return delegate_->ShareSharedMemoryHandleWithRemote(handle, peer_pid_);
78 } 78 }
79 79
80 bool ProxyChannel::Send(IPC::Message* msg) { 80 bool ProxyChannel::Send(IPC::Message* msg) {
81 if (test_sink_) 81 if (test_sink_)
82 return test_sink_->Send(msg); 82 return test_sink_->Send(msg);
83 if (channel_.get()) 83 if (channel_.get())
84 return channel_->Send(msg); 84 return channel_->Send(msg);
85 85
86 // Remote side crashed, drop this message. 86 // Remote side crashed, drop this message.
87 delete msg; 87 delete msg;
88 return false; 88 return false;
89 } 89 }
90 90
91 } // namespace proxy 91 } // namespace proxy
92 } // namespace ppapi 92 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_graphics_3d_proxy.cc ('k') | ppapi/proxy/serialized_handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698