| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_descriptor_set_posix.h" | 5 #include "ipc/file_descriptor_set_posix.h" |
| 6 | 6 |
| 7 #include <sys/types.h> | 7 #include <sys/types.h> |
| 8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
| 9 #include <unistd.h> | 9 #include <unistd.h> |
| 10 | 10 |
| 11 #include "base/eintr_wrapper.h" | |
| 12 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/posix/eintr_wrapper.h" |
| 13 | 13 |
| 14 FileDescriptorSet::FileDescriptorSet() | 14 FileDescriptorSet::FileDescriptorSet() |
| 15 : consumed_descriptor_highwater_(0) { | 15 : consumed_descriptor_highwater_(0) { |
| 16 } | 16 } |
| 17 | 17 |
| 18 FileDescriptorSet::~FileDescriptorSet() { | 18 FileDescriptorSet::~FileDescriptorSet() { |
| 19 if (consumed_descriptor_highwater_ == descriptors_.size()) | 19 if (consumed_descriptor_highwater_ == descriptors_.size()) |
| 20 return; | 20 return; |
| 21 | 21 |
| 22 LOG(WARNING) << "FileDescriptorSet destroyed with unconsumed descriptors"; | 22 LOG(WARNING) << "FileDescriptorSet destroyed with unconsumed descriptors"; |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 DCHECK_EQ(consumed_descriptor_highwater_, 0u); | 128 DCHECK_EQ(consumed_descriptor_highwater_, 0u); |
| 129 | 129 |
| 130 descriptors_.reserve(count); | 130 descriptors_.reserve(count); |
| 131 for (unsigned i = 0; i < count; ++i) { | 131 for (unsigned i = 0; i < count; ++i) { |
| 132 struct base::FileDescriptor sd; | 132 struct base::FileDescriptor sd; |
| 133 sd.fd = buffer[i]; | 133 sd.fd = buffer[i]; |
| 134 sd.auto_close = true; | 134 sd.auto_close = true; |
| 135 descriptors_.push_back(sd); | 135 descriptors_.push_back(sd); |
| 136 } | 136 } |
| 137 } | 137 } |
| OLD | NEW |