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

Unified Diff: base/test/fuzzed_data_provider.h

Issue 2250263003: Move FuzzedDataProvider to //base and expose to blink (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add fuzzer for TextResourceDecoder Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: base/test/fuzzed_data_provider.h
diff --git a/net/base/fuzzed_data_provider.h b/base/test/fuzzed_data_provider.h
similarity index 88%
rename from net/base/fuzzed_data_provider.h
rename to base/test/fuzzed_data_provider.h
index 4aa13db6c20a75634e437fd6cb5cfb86fb18b0fe..ebc1d128cafa117ede0b747d20142ac74670aa4e 100644
--- a/net/base/fuzzed_data_provider.h
+++ b/base/test/fuzzed_data_provider.h
@@ -2,20 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef NET_BASE_FUZZED_DATA_PROVIDER_H
-#define NET_BASE_FUZZED_DATA_PROVIDER_H
+#ifndef BASE_FUZZED_DATA_PROVIDER_H_
eroman 2016/08/18 21:37:10 BASE_TEST_....
Charlie Harrison 2016/08/19 18:58:17 Done.
+#define BASE_FUZZED_DATA_PROVIDER_H_
#include <stdint.h>
+#include "base/base_export.h"
#include "base/macros.h"
#include "base/strings/string_piece.h"
-namespace net {
+namespace base {
eroman 2016/08/18 21:37:10 A //base OWNER could advise authoritatively, but s
// Utility class to break up fuzzer input for multiple consumers. Whenever run
// on the same input, provides the same output, as long as its methods are
// called in the same order, with the same arguments.
-class FuzzedDataProvider {
+class BASE_EXPORT FuzzedDataProvider {
public:
// |data| is an array of length |size| that the FuzzedDataProvider wraps to
// provide more granular access. |data| must outlive the FuzzedDataProvider.
@@ -26,12 +27,12 @@ class FuzzedDataProvider {
// |num_bytes| of data remain, returns a shorter StringPiece containing all
// of the data that's left. The data pointed at by the returned StringPiece
// must not be used after the FuzzedDataProvider is destroyed.
- base::StringPiece ConsumeBytes(size_t num_bytes);
+ StringPiece ConsumeBytes(size_t num_bytes);
// Returns a StringPiece containing all remaining bytes of the input data.
// The data pointed at by the returned StringPiece must not be used after the
// FuzzedDataProvider is destroyed.
- base::StringPiece ConsumeRemainingBytes();
+ StringPiece ConsumeRemainingBytes();
// Returns a number in the range [min, max] by consuming bytes from the input
// data. The value might not be uniformly distributed in the given range. If
@@ -64,11 +65,11 @@ class FuzzedDataProvider {
size_t remaining_bytes() { return remaining_data_.length(); }
private:
- base::StringPiece remaining_data_;
+ StringPiece remaining_data_;
DISALLOW_COPY_AND_ASSIGN(FuzzedDataProvider);
};
-} // namespace net
+} // namespace base
-#endif // NET_BASE_FUZZED_DATA_PROVIDER_H
+#endif // BASE_FUZZED_DATA_PROVIDER_H_
« no previous file with comments | « base/test/BUILD.gn ('k') | base/test/fuzzed_data_provider.cc » ('j') | net/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698