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

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

Issue 2716393002: Deprecate hpack_table_size flag, remove dead code. (Closed)
Patch Set: Created 3 years, 10 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 | « net/spdy/fuzzing/hpack_fuzz_mutator.cc ('k') | net/spdy/hpack/hpack_header_table.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/fuzzing/hpack_fuzz_wrapper.cc
diff --git a/net/spdy/fuzzing/hpack_fuzz_wrapper.cc b/net/spdy/fuzzing/hpack_fuzz_wrapper.cc
deleted file mode 100644
index f816b1eff62152ecc18765b0489869755e1bd474..0000000000000000000000000000000000000000
--- a/net/spdy/fuzzing/hpack_fuzz_wrapper.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/at_exit.h"
-#include "base/command_line.h"
-#include "base/files/file_util.h"
-#include "net/spdy/fuzzing/hpack_fuzz_util.h"
-
-namespace {
-
-// Specifies a file having HPACK header sets.
-const char kFileToParse[] = "file-to-parse";
-
-} // namespace
-
-using base::StringPiece;
-using net::HpackFuzzUtil;
-using std::string;
-
-// Sequentially runs each given length-prefixed header block through
-// decoding and encoding fuzzing stages (using HpackFuzzUtil).
-int main(int argc, char** argv) {
- base::AtExitManager exit_manager;
-
- base::CommandLine::Init(argc, argv);
- const base::CommandLine& command_line =
- *base::CommandLine::ForCurrentProcess();
-
- if (!command_line.HasSwitch(kFileToParse)) {
- LOG(ERROR) << "Usage: " << argv[0]
- << " --" << kFileToParse << "=/path/to/file.in";
- return -1;
- }
- string file_to_parse = command_line.GetSwitchValueASCII(kFileToParse);
-
- // ClusterFuzz may invoke as --file-to-parse="". Don't crash in this case.
- if (file_to_parse.empty()) {
- LOG(WARNING) << "Empty file to parse given. Doing nothing.";
- return 0;
- }
-
- DVLOG(1) << "Reading input from " << file_to_parse;
- HpackFuzzUtil::Input input;
- CHECK(base::ReadFileToString(base::FilePath::FromUTF8Unsafe(file_to_parse),
- &input.input));
-
- HpackFuzzUtil::FuzzerContext context;
- HpackFuzzUtil::InitializeFuzzerContext(&context);
-
- size_t block_count = 0;
- StringPiece block;
- while (HpackFuzzUtil::NextHeaderBlock(&input, &block)) {
- HpackFuzzUtil::RunHeaderBlockThroughFuzzerStages(&context, block);
- ++block_count;
- }
- DVLOG(1) << "Fuzzed " << block_count << " blocks.";
- return 0;
-}
« no previous file with comments | « net/spdy/fuzzing/hpack_fuzz_mutator.cc ('k') | net/spdy/hpack/hpack_header_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698