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 #include <algorithm> | 9 #include <algorithm> |
10 #include <vector> | 10 #include <vector> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // | 50 // |
51 // The sequence is the same for readv, except that Consume() in this case is | 51 // The sequence is the same for readv, except that Consume() in this case is |
52 // used to change the IOVector to only keep track of description of blocks of | 52 // used to change the IOVector to only keep track of description of blocks of |
53 // memory not yet written to. | 53 // memory not yet written to. |
54 // | 54 // |
55 // IOVector does not have any method to change the iovec entries that it | 55 // IOVector does not have any method to change the iovec entries that it |
56 // accumulates. This is due to the block merging nature of Append(): we'd like | 56 // accumulates. This is due to the block merging nature of Append(): we'd like |
57 // to avoid accidentally change an entry that is assembled by two or more | 57 // to avoid accidentally change an entry that is assembled by two or more |
58 // Append()'s by simply an index access. | 58 // Append()'s by simply an index access. |
59 // | 59 // |
60 | |
61 class NET_EXPORT_PRIVATE IOVector { | 60 class NET_EXPORT_PRIVATE IOVector { |
62 public: | 61 public: |
63 // Provide a default constructor so it'll never be inhibited by adding other | 62 // Provide a default constructor so it'll never be inhibited by adding other |
64 // constructors. | 63 // constructors. |
65 IOVector(); | 64 IOVector(); |
66 ~IOVector(); | 65 ~IOVector(); |
67 | 66 |
68 // Provides a way to convert system call-like iovec representation to | 67 // Provides a way to convert system call-like iovec representation to |
69 // IOVector. | 68 // IOVector. |
70 void AppendIovec(const struct iovec* iov, size_t iovcnt) { | 69 void AppendIovec(const struct iovec* iov, size_t iovcnt) { |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 // assignment operator to preserve compiler-generated copy/move constructors | 191 // assignment operator to preserve compiler-generated copy/move constructors |
193 // and assignment operators. Note that since IOVector does not own the | 192 // and assignment operators. Note that since IOVector does not own the |
194 // actual buffers that the struct iovecs point to, copies and assignments | 193 // actual buffers that the struct iovecs point to, copies and assignments |
195 // result in a shallow copy of the buffers; resulting IOVectors will point | 194 // result in a shallow copy of the buffers; resulting IOVectors will point |
196 // to the same copy of the underlying data. | 195 // to the same copy of the underlying data. |
197 }; | 196 }; |
198 | 197 |
199 } // namespace net | 198 } // namespace net |
200 | 199 |
201 #endif // NET_QUIC_IOVECTOR_H_ | 200 #endif // NET_QUIC_IOVECTOR_H_ |
OLD | NEW |