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

Side by Side Diff: ppapi/proxy/proxy_channel.cc

Issue 621613002: Refactoring: Make IPC::Channel::TakeClientFileDescriptor() a ScopedFD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing Mac build Created 6 years, 2 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
« ppapi/proxy/proxy_channel.h ('K') | « ppapi/proxy/proxy_channel.h ('k') | no next file » | 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 "ipc/ipc_platform_file.h" 8 #include "ipc/ipc_platform_file.h"
9 #include "ipc/ipc_test_sink.h" 9 #include "ipc/ipc_test_sink.h"
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #if !defined(OS_NACL) 46 #if !defined(OS_NACL)
47 peer_pid_ = base::GetCurrentProcId(); 47 peer_pid_ = base::GetCurrentProcId();
48 #endif 48 #endif
49 } 49 }
50 50
51 void ProxyChannel::OnChannelError() { 51 void ProxyChannel::OnChannelError() {
52 channel_.reset(); 52 channel_.reset();
53 } 53 }
54 54
55 #if defined(OS_POSIX) && !defined(OS_NACL) 55 #if defined(OS_POSIX) && !defined(OS_NACL)
56 int ProxyChannel::TakeRendererFD() { 56 base::ScopedFD ProxyChannel::TakeRendererFD() {
57 DCHECK(channel()); 57 DCHECK(channel());
58 return channel()->TakeClientFileDescriptor(); 58 return channel()->TakeClientFileDescriptor();
59 } 59 }
60 #endif 60 #endif
61 61
62 IPC::PlatformFileForTransit ProxyChannel::ShareHandleWithRemote( 62 IPC::PlatformFileForTransit ProxyChannel::ShareHandleWithRemote(
63 base::PlatformFile handle, 63 base::PlatformFile handle,
64 bool should_close_source) { 64 bool should_close_source) {
65 // Channel could be closed if the plugin crashes. 65 // Channel could be closed if the plugin crashes.
66 if (!channel_.get()) { 66 if (!channel_.get()) {
(...skipping 13 matching lines...) Expand all
80 if (channel_.get()) 80 if (channel_.get())
81 return channel_->Send(msg); 81 return channel_->Send(msg);
82 82
83 // Remote side crashed, drop this message. 83 // Remote side crashed, drop this message.
84 delete msg; 84 delete msg;
85 return false; 85 return false;
86 } 86 }
87 87
88 } // namespace proxy 88 } // namespace proxy
89 } // namespace ppapi 89 } // namespace ppapi
OLDNEW
« ppapi/proxy/proxy_channel.h ('K') | « ppapi/proxy/proxy_channel.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698