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

Unified Diff: net/spdy/fuzzing/hpack_fuzz_util.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/spdy/fuzzing/hpack_fuzz_util.cc
diff --git a/net/spdy/fuzzing/hpack_fuzz_util.cc b/net/spdy/fuzzing/hpack_fuzz_util.cc
index 5e62ca92c25c3a984acef761749587d5a6f30690..f22feb48531025eaa89f9ab3b10ca78f504531bd 100644
--- a/net/spdy/fuzzing/hpack_fuzz_util.cc
+++ b/net/spdy/fuzzing/hpack_fuzz_util.cc
@@ -36,14 +36,20 @@ using base::RandBytesAsString;
using std::map;
using std::string;
-HpackFuzzUtil::GeneratorContext::GeneratorContext() {}
-HpackFuzzUtil::GeneratorContext::~GeneratorContext() {}
+HpackFuzzUtil::GeneratorContext::GeneratorContext() {
+}
+HpackFuzzUtil::GeneratorContext::~GeneratorContext() {
+}
-HpackFuzzUtil::Input::Input() : offset(0) {}
-HpackFuzzUtil::Input::~Input() {}
+HpackFuzzUtil::Input::Input() : offset(0) {
+}
+HpackFuzzUtil::Input::~Input() {
+}
-HpackFuzzUtil::FuzzerContext::FuzzerContext() {}
-HpackFuzzUtil::FuzzerContext::~FuzzerContext() {}
+HpackFuzzUtil::FuzzerContext::FuzzerContext() {
+}
+HpackFuzzUtil::FuzzerContext::~FuzzerContext() {
+}
// static
void HpackFuzzUtil::InitializeGeneratorContext(GeneratorContext* context) {
@@ -76,26 +82,22 @@ map<string, string> HpackFuzzUtil::NextGeneratedHeaderSet(
GeneratorContext* context) {
map<string, string> headers;
- size_t header_count = 1 + SampleExponential(kHeaderCountMean,
- kHeaderCountMax);
+ size_t header_count =
+ 1 + SampleExponential(kHeaderCountMean, kHeaderCountMax);
for (size_t j = 0; j != header_count; ++j) {
- size_t name_index = SampleExponential(kHeaderIndexMean,
- kHeaderIndexMax);
- size_t value_index = SampleExponential(kHeaderIndexMean,
- kHeaderIndexMax);
+ size_t name_index = SampleExponential(kHeaderIndexMean, kHeaderIndexMax);
+ size_t value_index = SampleExponential(kHeaderIndexMean, kHeaderIndexMax);
string name, value;
if (name_index >= context->names.size()) {
- context->names.push_back(
- RandBytesAsString(1 + SampleExponential(kNameLengthMean,
- kNameLengthMax)));
+ context->names.push_back(RandBytesAsString(
+ 1 + SampleExponential(kNameLengthMean, kNameLengthMax)));
name = context->names.back();
} else {
name = context->names[name_index];
}
if (value_index >= context->values.size()) {
- context->values.push_back(
- RandBytesAsString(1 + SampleExponential(kValueLengthMean,
- kValueLengthMax)));
+ context->values.push_back(RandBytesAsString(
+ 1 + SampleExponential(kValueLengthMean, kValueLengthMax)));
value = context->values.back();
} else {
value = context->values[value_index];
@@ -111,8 +113,7 @@ size_t HpackFuzzUtil::SampleExponential(size_t mean, size_t sanity_bound) {
}
// static
-bool HpackFuzzUtil::NextHeaderBlock(Input* input,
- StringPiece* out) {
+bool HpackFuzzUtil::NextHeaderBlock(Input* input, StringPiece* out) {
CHECK_LE(input->offset, input->input.size());
if (input->remaining() == 0) {
return false;
@@ -146,7 +147,7 @@ bool HpackFuzzUtil::RunHeaderBlockThroughFuzzerStages(FuzzerContext* context,
StringPiece input_block) {
// First stage: Decode the input header block. This may fail on invalid input.
if (!context->first_stage->HandleControlFrameHeadersData(
- 1, input_block.data(), input_block.size())) {
+ 1, input_block.data(), input_block.size())) {
return false;
}
if (!context->first_stage->HandleControlFrameHeadersComplete(1)) {
@@ -165,7 +166,8 @@ bool HpackFuzzUtil::RunHeaderBlockThroughFuzzerStages(FuzzerContext* context,
}
// static
-void HpackFuzzUtil::FlipBits(uint8* buffer, size_t buffer_length,
+void HpackFuzzUtil::FlipBits(uint8* buffer,
+ size_t buffer_length,
size_t flip_per_thousand) {
uint64 buffer_bit_length = buffer_length * 8u;
uint64 bits_to_flip = flip_per_thousand * (1 + buffer_bit_length / 1024);

Powered by Google App Engine
This is Rietveld 408576698