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

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: ... also remove PLATFORM_EXPORT 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
« no previous file with comments | « base/test/BUILD.gn ('k') | base/test/fuzzed_data_provider.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 89%
rename from net/base/fuzzed_data_provider.h
rename to base/test/fuzzed_data_provider.h
index 4aa13db6c20a75634e437fd6cb5cfb86fb18b0fe..293d723904f4fec680e603ed711b7c3b1841dac8 100644
--- a/net/base/fuzzed_data_provider.h
+++ b/base/test/fuzzed_data_provider.h
@@ -2,15 +2,16 @@
// 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_TEST_FUZZED_DATA_PROVIDER_H_
+#define BASE_TEST_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 {
// 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
@@ -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_TEST_FUZZED_DATA_PROVIDER_H_
« no previous file with comments | « base/test/BUILD.gn ('k') | base/test/fuzzed_data_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698