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

Unified Diff: content/child/npapi/np_channel_base.cc

Issue 191673003: Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: content/child/npapi/np_channel_base.cc
diff --git a/content/child/npapi/np_channel_base.cc b/content/child/npapi/np_channel_base.cc
index 85ade5a2539e5acbe728092f14ff89c750372e5e..76845bd8f21a9707079d201782c4ea9414747157 100644
--- a/content/child/npapi/np_channel_base.cc
+++ b/content/child/npapi/np_channel_base.cc
@@ -6,6 +6,7 @@
#include "base/auto_reset.h"
#include "base/containers/hash_tables.h"
+#include "base/files/scoped_file.h"
#include "base/lazy_instance.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_local.h"
@@ -68,8 +69,8 @@ NPChannelBase* NPChannelBase::GetChannel(
// On POSIX the channel_handle conveys an FD (socket) which is duped by the
// kernel during the IPC message exchange (via the SCM_RIGHTS mechanism).
// Ensure we do not leak this FD.
- int fd = channel_handle.socket.auto_close ? channel_handle.socket.fd : -1;
- file_util::ScopedFD auto_close_fd(&fd);
+ base::ScopedFD fd(channel_handle.socket.auto_close ?
+ channel_handle.socket.fd : -1);
#endif
scoped_refptr<NPChannelBase> channel;
@@ -86,7 +87,7 @@ NPChannelBase* NPChannelBase::GetChannel(
if (!channel->channel_valid()) {
channel->channel_handle_ = channel_handle;
#if defined(OS_POSIX)
- ignore_result(auto_close_fd.release());
+ ignore_result(fd.release());
#endif
if (mode & IPC::Channel::MODE_SERVER_FLAG) {
channel->channel_handle_.name =

Powered by Google App Engine
This is Rietveld 408576698