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

Side by Side Diff: third_party/WebKit/Source/platform/testing/FuzzedDataProvider.cpp

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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/testing/FuzzedDataProvider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "platform/testing/FuzzedDataProvider.h"
6
7 namespace blink {
8
9 FuzzedDataProvider::FuzzedDataProvider(const uint8_t* bytes, size_t numBytes)
10 : m_provider(bytes, numBytes)
11 {
12 }
13
14 CString FuzzedDataProvider::ConsumeBytesInRange(uint32_t minBytes, uint32_t maxB ytes)
15 {
16 size_t numBytes = static_cast<size_t>(m_provider.ConsumeUint32InRange(minByt es, maxBytes));
17 base::StringPiece bytes = m_provider.ConsumeBytes(numBytes);
18 return CString(bytes.data(), bytes.length());
19 }
20
21 CString FuzzedDataProvider::ConsumeRemainingBytes()
22 {
23 base::StringPiece bytes = m_provider.ConsumeRemainingBytes();
24 return CString(bytes.data(), bytes.length());
25 }
26
27 bool FuzzedDataProvider::ConsumeBool()
28 {
29 return m_provider.ConsumeBool();
30 }
31
32 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/testing/FuzzedDataProvider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698