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

Side by Side Diff: ipc/ipc_channel_proxy.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
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 "ipc/ipc_channel_proxy.h" 5 #include "ipc/ipc_channel_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 // ChannelProxy::Init(). 439 // ChannelProxy::Init().
440 int ChannelProxy::GetClientFileDescriptor() { 440 int ChannelProxy::GetClientFileDescriptor() {
441 DCHECK(CalledOnValidThread()); 441 DCHECK(CalledOnValidThread());
442 442
443 Channel* channel = context_.get()->channel_.get(); 443 Channel* channel = context_.get()->channel_.get();
444 // Channel must have been created first. 444 // Channel must have been created first.
445 DCHECK(channel) << context_.get()->channel_id_; 445 DCHECK(channel) << context_.get()->channel_id_;
446 return channel->GetClientFileDescriptor(); 446 return channel->GetClientFileDescriptor();
447 } 447 }
448 448
449 int ChannelProxy::TakeClientFileDescriptor() { 449 base::ScopedFD ChannelProxy::TakeClientFileDescriptor() {
450 DCHECK(CalledOnValidThread()); 450 DCHECK(CalledOnValidThread());
451 451
452 Channel* channel = context_.get()->channel_.get(); 452 Channel* channel = context_.get()->channel_.get();
453 // Channel must have been created first. 453 // Channel must have been created first.
454 DCHECK(channel) << context_.get()->channel_id_; 454 DCHECK(channel) << context_.get()->channel_id_;
455 return channel->TakeClientFileDescriptor(); 455 return channel->TakeClientFileDescriptor();
456 } 456 }
457 #endif 457 #endif
458 458
459 //----------------------------------------------------------------------------- 459 //-----------------------------------------------------------------------------
460 460
461 } // namespace IPC 461 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_proxy.h ('k') | ipc/ipc_send_fds_test.cc » ('j') | ppapi/proxy/proxy_channel.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698