| 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_SPDY_SPDY_FRAME_READER_H_ | 5 #ifndef NET_SPDY_SPDY_FRAME_READER_H_ |
| 6 #define NET_SPDY_SPDY_FRAME_READER_H_ | 6 #define NET_SPDY_SPDY_FRAME_READER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // Forwards the internal iterater on success. | 42 // Forwards the internal iterater on success. |
| 43 // Returns true on success, false otherwise. | 43 // Returns true on success, false otherwise. |
| 44 bool ReadUInt16(uint16* result); | 44 bool ReadUInt16(uint16* result); |
| 45 | 45 |
| 46 // Reads a 32-bit unsigned integer into the given output parameter. | 46 // Reads a 32-bit unsigned integer into the given output parameter. |
| 47 // Forwards the internal iterater on success. | 47 // Forwards the internal iterater on success. |
| 48 // Returns true on success, false otherwise. | 48 // Returns true on success, false otherwise. |
| 49 bool ReadUInt32(uint32* result); | 49 bool ReadUInt32(uint32* result); |
| 50 | 50 |
| 51 // Reads a 31-bit unsigned integer into the given output parameter. This is | 51 // Reads a 31-bit unsigned integer into the given output parameter. This is |
| 52 // equivelant to ReadUInt32() above except that the highest-order bit is | 52 // equivalent to ReadUInt32() above except that the highest-order bit is |
| 53 // discarded. | 53 // discarded. |
| 54 // Forwards the internal iterater (by 4B) on success. | 54 // Forwards the internal iterater (by 4B) on success. |
| 55 // Returns true on success, false otherwise. | 55 // Returns true on success, false otherwise. |
| 56 bool ReadUInt31(uint32* result); | 56 bool ReadUInt31(uint32* result); |
| 57 | 57 |
| 58 // Reads a string prefixed with 16-bit length into the given output parameter. | 58 // Reads a string prefixed with 16-bit length into the given output parameter. |
| 59 // | 59 // |
| 60 // NOTE: Does not copy but rather references strings in the underlying buffer. | 60 // NOTE: Does not copy but rather references strings in the underlying buffer. |
| 61 // This should be kept in mind when handling memory management! | 61 // This should be kept in mind when handling memory management! |
| 62 // | 62 // |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // The length of the data buffer that we're reading from. | 106 // The length of the data buffer that we're reading from. |
| 107 const size_t len_; | 107 const size_t len_; |
| 108 | 108 |
| 109 // The location of the next read from our data buffer. | 109 // The location of the next read from our data buffer. |
| 110 size_t ofs_; | 110 size_t ofs_; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 } // namespace net | 113 } // namespace net |
| 114 | 114 |
| 115 #endif // NET_SPDY_SPDY_FRAME_READER_H_ | 115 #endif // NET_SPDY_SPDY_FRAME_READER_H_ |
| OLD | NEW |