| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DER_INPUT_H_ | 5 #ifndef NET_DER_INPUT_H_ |
| 6 #define NET_DER_INPUT_H_ | 6 #define NET_DER_INPUT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // input: A ByteReader is copied and then is used to read some number of | 37 // input: A ByteReader is copied and then is used to read some number of |
| 38 // bytes into the input, based on the content it is reading. A Mark can then be | 38 // bytes into the input, based on the content it is reading. A Mark can then be |
| 39 // set using the temporary ByteReader to indicate how far it read into the | 39 // set using the temporary ByteReader to indicate how far it read into the |
| 40 // Input. The original ByteReader can then be synchronized with how far the | 40 // Input. The original ByteReader can then be synchronized with how far the |
| 41 // temporary ByteReader read, by using either AdvanceToMark() or ReadToMark(). | 41 // temporary ByteReader read, by using either AdvanceToMark() or ReadToMark(). |
| 42 class NET_EXPORT_PRIVATE Input { | 42 class NET_EXPORT_PRIVATE Input { |
| 43 public: | 43 public: |
| 44 // Creates an empty Input, one from which no data can be read. | 44 // Creates an empty Input, one from which no data can be read. |
| 45 Input(); | 45 Input(); |
| 46 | 46 |
| 47 // Creates an Input pointed to the same section of |new_base| as |other| |
| 48 // points to in |old_base|. |
| 49 Input(const Input& other, const Input& old_base, const Input& new_base); |
| 50 |
| 47 // Creates an Input from a constant array |data|. | 51 // Creates an Input from a constant array |data|. |
| 48 template <size_t N> | 52 template <size_t N> |
| 49 explicit Input(const uint8_t(&data)[N]) | 53 explicit Input(const uint8_t(&data)[N]) |
| 50 : data_(data), len_(N) {} | 54 : data_(data), len_(N) {} |
| 51 | 55 |
| 52 // Creates an Input from the given |data| and |len|. | 56 // Creates an Input from the given |data| and |len|. |
| 53 explicit Input(const uint8_t* data, size_t len); | 57 explicit Input(const uint8_t* data, size_t len); |
| 54 | 58 |
| 55 // Creates an Input from a base::StringPiece. | 59 // Creates an Input from a base::StringPiece. |
| 56 explicit Input(const base::StringPiece& sp); | 60 explicit Input(const base::StringPiece& sp); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 explicit Mark(const uint8_t* ptr); | 183 explicit Mark(const uint8_t* ptr); |
| 180 Mark(); | 184 Mark(); |
| 181 const uint8_t* ptr_; | 185 const uint8_t* ptr_; |
| 182 }; | 186 }; |
| 183 | 187 |
| 184 } // namespace der | 188 } // namespace der |
| 185 | 189 |
| 186 } // namespace net | 190 } // namespace net |
| 187 | 191 |
| 188 #endif // NET_DER_INPUT_H_ | 192 #endif // NET_DER_INPUT_H_ |
| OLD | NEW |