diff options
author | Ben Murdoch <benm@google.com> | 2010-07-29 17:14:53 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-08-04 14:29:45 +0100 |
commit | c407dc5cd9bdc5668497f21b26b09d988ab439de (patch) | |
tree | 7eaf8707c0309516bdb042ad976feedaf72b0bb1 /base/file_descriptor_posix.h | |
parent | 0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff) | |
download | external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2 |
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'base/file_descriptor_posix.h')
-rw-r--r-- | base/file_descriptor_posix.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/file_descriptor_posix.h b/base/file_descriptor_posix.h index e9199ed..abc0789 100644 --- a/base/file_descriptor_posix.h +++ b/base/file_descriptor_posix.h @@ -24,6 +24,15 @@ struct FileDescriptor { : fd(ifd), auto_close(iauto_close) { } + bool operator==(const FileDescriptor& other) const { + return (fd == other.fd && auto_close == other.auto_close); + } + + // A comparison operator so that we can use these as keys in a std::map. + bool operator<(const FileDescriptor& other) const { + return other.fd < fd; + } + int fd; // If true, this file descriptor should be closed after it has been used. For // example an IPC system might interpret this flag as indicating that the |