| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_FUZZING_HPACK_FUZZ_UTIL_H_ | 5 #ifndef NET_SPDY_FUZZING_HPACK_FUZZ_UTIL_H_ |
| 6 #define NET_SPDY_FUZZING_HPACK_FUZZ_UTIL_H_ | 6 #define NET_SPDY_FUZZING_HPACK_FUZZ_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 GeneratorContext(); | 24 GeneratorContext(); |
| 25 ~GeneratorContext(); | 25 ~GeneratorContext(); |
| 26 std::vector<std::string> names; | 26 std::vector<std::string> names; |
| 27 std::vector<std::string> values; | 27 std::vector<std::string> values; |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 // Initializes a GeneratorContext with a random seed and name/value fixtures. | 30 // Initializes a GeneratorContext with a random seed and name/value fixtures. |
| 31 static void InitializeGeneratorContext(GeneratorContext* context); | 31 static void InitializeGeneratorContext(GeneratorContext* context); |
| 32 | 32 |
| 33 // Generates a header set from the generator context. | 33 // Generates a header set from the generator context. |
| 34 static std::map<std::string, std::string> NextGeneratedHeaderSet( | 34 static SpdyHeaderBlock NextGeneratedHeaderSet(GeneratorContext* context); |
| 35 GeneratorContext* context); | |
| 36 | 35 |
| 37 // Samples a size from the exponential distribution with mean |mean|, | 36 // Samples a size from the exponential distribution with mean |mean|, |
| 38 // upper-bounded by |sanity_bound|. | 37 // upper-bounded by |sanity_bound|. |
| 39 static size_t SampleExponential(size_t mean, size_t sanity_bound); | 38 static size_t SampleExponential(size_t mean, size_t sanity_bound); |
| 40 | 39 |
| 41 // Holds an input string, and manages an offset into that string. | 40 // Holds an input string, and manages an offset into that string. |
| 42 struct NET_EXPORT_PRIVATE Input { | 41 struct NET_EXPORT_PRIVATE Input { |
| 43 Input(); // Initializes |offset| to zero. | 42 Input(); // Initializes |offset| to zero. |
| 44 ~Input(); | 43 ~Input(); |
| 45 | 44 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // |flip_per_thousand| bits for every 1,024 bytes of |buffer_length|, | 83 // |flip_per_thousand| bits for every 1,024 bytes of |buffer_length|, |
| 85 // rounding up. | 84 // rounding up. |
| 86 static void FlipBits(uint8* buffer, | 85 static void FlipBits(uint8* buffer, |
| 87 size_t buffer_length, | 86 size_t buffer_length, |
| 88 size_t flip_per_thousand); | 87 size_t flip_per_thousand); |
| 89 }; | 88 }; |
| 90 | 89 |
| 91 } // namespace net | 90 } // namespace net |
| 92 | 91 |
| 93 #endif // NET_SPDY_FUZZING_HPACK_FUZZ_UTIL_H_ | 92 #endif // NET_SPDY_FUZZING_HPACK_FUZZ_UTIL_H_ |
| OLD | NEW |