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

Unified Diff: base/test/fuzzed_data_provider.cc

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/fuzzed_data_provider.h ('k') | net/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/fuzzed_data_provider.cc
diff --git a/net/base/fuzzed_data_provider.cc b/base/test/fuzzed_data_provider.cc
similarity index 88%
rename from net/base/fuzzed_data_provider.cc
rename to base/test/fuzzed_data_provider.cc
index b947837dc956533d4e7f7e4519e1a73f83c0b8fa..5ea5862052a7fed7034d4e367e4a24c35f13788b 100644
--- a/net/base/fuzzed_data_provider.cc
+++ b/base/test/fuzzed_data_provider.cc
@@ -2,28 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "net/base/fuzzed_data_provider.h"
+#include "base/test/fuzzed_data_provider.h"
#include <algorithm>
#include <limits>
#include "base/logging.h"
-namespace net {
+namespace base {
FuzzedDataProvider::FuzzedDataProvider(const uint8_t* data, size_t size)
: remaining_data_(reinterpret_cast<const char*>(data), size) {}
FuzzedDataProvider::~FuzzedDataProvider() {}
-base::StringPiece FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
+StringPiece FuzzedDataProvider::ConsumeBytes(size_t num_bytes) {
num_bytes = std::min(num_bytes, remaining_data_.length());
- base::StringPiece result(remaining_data_.data(), num_bytes);
+ StringPiece result(remaining_data_.data(), num_bytes);
remaining_data_ = remaining_data_.substr(num_bytes);
return result;
}
-base::StringPiece FuzzedDataProvider::ConsumeRemainingBytes() {
+StringPiece FuzzedDataProvider::ConsumeRemainingBytes() {
return ConsumeBytes(remaining_data_.length());
}
@@ -73,4 +73,4 @@ uint16_t FuzzedDataProvider::ConsumeUint16() {
return ConsumeUint32InRange(0, 0xFFFF);
}
-} // namespace net
+} // namespace base
« no previous file with comments | « base/test/fuzzed_data_provider.h ('k') | net/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698