OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef NET_QUIC_IOVECTOR_H_ | 5 #ifndef NET_QUIC_IOVECTOR_H_ |
6 #define NET_QUIC_IOVECTOR_H_ | 6 #define NET_QUIC_IOVECTOR_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 |
9 #include <algorithm> | 10 #include <algorithm> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/basictypes.h" | |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "net/base/iovec.h" | 14 #include "net/base/iovec.h" |
15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
16 | 16 |
17 namespace net { | 17 namespace net { |
18 | 18 |
19 // Calculate the total number of bytes in an array of iovec structures. | 19 // Calculate the total number of bytes in an array of iovec structures. |
20 inline size_t TotalIovecLength(const struct iovec* iov, size_t iovcnt) { | 20 inline size_t TotalIovecLength(const struct iovec* iov, size_t iovcnt) { |
21 size_t length = 0; | 21 size_t length = 0; |
22 if (iov != NULL) { | 22 if (iov != NULL) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // assignment operator to preserve compiler-generated copy/move constructors | 228 // assignment operator to preserve compiler-generated copy/move constructors |
229 // and assignment operators. Note that since IOVector does not own the | 229 // and assignment operators. Note that since IOVector does not own the |
230 // actual buffers that the struct iovecs point to, copies and assignments | 230 // actual buffers that the struct iovecs point to, copies and assignments |
231 // result in a shallow copy of the buffers; resulting IOVectors will point | 231 // result in a shallow copy of the buffers; resulting IOVectors will point |
232 // to the same copy of the underlying data. | 232 // to the same copy of the underlying data. |
233 }; | 233 }; |
234 | 234 |
235 } // namespace net | 235 } // namespace net |
236 | 236 |
237 #endif // NET_QUIC_IOVECTOR_H_ | 237 #endif // NET_QUIC_IOVECTOR_H_ |
OLD | NEW |