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

Unified Diff: base/file_descriptor_posix.h

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 side-by-side diff with in-line comments
Download patch
Index: base/file_descriptor_posix.h
diff --git a/base/file_descriptor_posix.h b/base/file_descriptor_posix.h
index c730be65f749473bf1943d14bca0334fcc6bab78..376ad39e307addafe0cd7395d8578c3956a3a621 100644
--- a/base/file_descriptor_posix.h
+++ b/base/file_descriptor_posix.h
@@ -6,6 +6,7 @@
#define BASE_FILE_DESCRIPTOR_POSIX_H_
#include "base/files/file.h"
+#include "base/files/scoped_file.h"
namespace base {
@@ -24,6 +25,7 @@ struct FileDescriptor {
}
FileDescriptor(File file) : fd(file.TakePlatformFile()), auto_close(true) {}
+ explicit FileDescriptor(ScopedFD fd) : fd(fd.release()), auto_close(true) {}
bool operator==(const FileDescriptor& other) const {
return (fd == other.fd && auto_close == other.auto_close);

Powered by Google App Engine
This is Rietveld 408576698