Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Side by Side Diff: net/base/fuzzed_data_provider.h

Issue 1919013003: Add fuzzer to test Fuzz URLRequestDataJob (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@url_request_fuzzer
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/BUILD.gn ('k') | net/url_request/url_request_data_job_fuzzer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_BASE_FUZZED_DATA_PROVIDER_H 5 #ifndef NET_BASE_FUZZED_DATA_PROVIDER_H
6 #define NET_BASE_FUZZED_DATA_PROVIDER_H 6 #define NET_BASE_FUZZED_DATA_PROVIDER_H
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 // Returns a uint8_t from the input or 0 if nothing remains. This is 45 // Returns a uint8_t from the input or 0 if nothing remains. This is
46 // equivalent to ConsumeValueInRange(0, 0xFF). 46 // equivalent to ConsumeValueInRange(0, 0xFF).
47 uint8_t ConsumeUint8(); 47 uint8_t ConsumeUint8();
48 48
49 // Returns a uint16_t from the input. If fewer than 2 bytes of data remain 49 // Returns a uint16_t from the input. If fewer than 2 bytes of data remain
50 // will fill the most significant bytes with 0. This is equivalent to 50 // will fill the most significant bytes with 0. This is equivalent to
51 // ConsumeValueInRange(0, 0xFFFF). 51 // ConsumeValueInRange(0, 0xFFFF).
52 uint16_t ConsumeUint16(); 52 uint16_t ConsumeUint16();
53 53
54 // Reports the remaining bytes available for fuzzed input.
55 size_t remaining_bytes() { return remaining_data_.length(); }
56
54 private: 57 private:
55 base::StringPiece remaining_data_; 58 base::StringPiece remaining_data_;
56 59
57 DISALLOW_COPY_AND_ASSIGN(FuzzedDataProvider); 60 DISALLOW_COPY_AND_ASSIGN(FuzzedDataProvider);
58 }; 61 };
59 62
60 } // namespace net 63 } // namespace net
61 64
62 #endif // NET_BASE_FUZZED_DATA_PROVIDER_H 65 #endif // NET_BASE_FUZZED_DATA_PROVIDER_H
OLDNEW
« no previous file with comments | « net/BUILD.gn ('k') | net/url_request/url_request_data_job_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698