| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_QUIC_DATA_READER_H_ | 5 #ifndef NET_QUIC_QUIC_DATA_READER_H_ |
| 6 #define NET_QUIC_QUIC_DATA_READER_H_ | 6 #define NET_QUIC_QUIC_DATA_READER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/strings/string_piece.h" | 9 #include "base/strings/string_piece.h" |
| 10 #include "net/base/int128.h" | 10 #include "net/base/int128.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // Reads a 64-bit unsigned integer into the given output parameter. | 52 // Reads a 64-bit unsigned integer into the given output parameter. |
| 53 // Forwards the internal iterator on success. | 53 // Forwards the internal iterator on success. |
| 54 // Returns true on success, false otherwise. | 54 // Returns true on success, false otherwise. |
| 55 bool ReadUInt64(uint64* result); | 55 bool ReadUInt64(uint64* result); |
| 56 | 56 |
| 57 // Reads a 128-bit unsigned integer into the given output parameter. | 57 // Reads a 128-bit unsigned integer into the given output parameter. |
| 58 // Forwards the internal iterator on success. | 58 // Forwards the internal iterator on success. |
| 59 // Returns true on success, false otherwise. | 59 // Returns true on success, false otherwise. |
| 60 bool ReadUInt128(uint128* result); | 60 bool ReadUInt128(uint128* result); |
| 61 | 61 |
| 62 // Reads a 16-bit unsigned float into the given output parameter. |
| 63 // Forwards the internal iterator on success. |
| 64 // Returns true on success, false otherwise. |
| 65 bool ReadUFloat16(uint64* result); |
| 66 |
| 62 // Reads a string prefixed with 16-bit length into the given output parameter. | 67 // Reads a string prefixed with 16-bit length into the given output parameter. |
| 63 // | 68 // |
| 64 // NOTE: Does not copy but rather references strings in the underlying buffer. | 69 // NOTE: Does not copy but rather references strings in the underlying buffer. |
| 65 // This should be kept in mind when handling memory management! | 70 // This should be kept in mind when handling memory management! |
| 66 // | 71 // |
| 67 // Forwards the internal iterator on success. | 72 // Forwards the internal iterator on success. |
| 68 // Returns true on success, false otherwise. | 73 // Returns true on success, false otherwise. |
| 69 bool ReadStringPiece16(base::StringPiece* result); | 74 bool ReadStringPiece16(base::StringPiece* result); |
| 70 | 75 |
| 71 // Reads a given number of bytes into the given buffer. The buffer | 76 // Reads a given number of bytes into the given buffer. The buffer |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 // The length of the data buffer that we're reading from. | 122 // The length of the data buffer that we're reading from. |
| 118 const size_t len_; | 123 const size_t len_; |
| 119 | 124 |
| 120 // The location of the next read from our data buffer. | 125 // The location of the next read from our data buffer. |
| 121 size_t pos_; | 126 size_t pos_; |
| 122 }; | 127 }; |
| 123 | 128 |
| 124 } // namespace net | 129 } // namespace net |
| 125 | 130 |
| 126 #endif // NET_QUIC_QUIC_DATA_READER_H_ | 131 #endif // NET_QUIC_QUIC_DATA_READER_H_ |
| OLD | NEW |