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

Unified Diff: tools/ipc_fuzzer/mutate/mutator.h

Issue 1000373004: Combine traits for IPC mutation and generation fuzzing plus other refactoring. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add mutation support for more types. Created 5 years, 9 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: tools/ipc_fuzzer/mutate/mutator.h
diff --git a/tools/ipc_fuzzer/mutate/mutator.h b/tools/ipc_fuzzer/mutate/mutator.h
new file mode 100644
index 0000000000000000000000000000000000000000..bb826f793e2891a0e0afc586bf7bf79dbcad1aa3
--- /dev/null
+++ b/tools/ipc_fuzzer/mutate/mutator.h
@@ -0,0 +1,43 @@
+// Copyright 2015 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.
+
+#ifndef TOOLS_IPC_FUZZER_MUTATE_MUTATOR_H_
+#define TOOLS_IPC_FUZZER_MUTATE_MUTATOR_H_
+
+#include <string>
+
+#include "tools/ipc_fuzzer/mutate/fuzzer.h"
+
+namespace ipc_fuzzer {
+
+class Mutator : public Fuzzer {
+ public:
+ explicit Mutator(int frequency) : frequency_(frequency) {}
inferno 2015/03/16 18:56:35 match the return type of frequency.
+ virtual ~Mutator() {}
+
+ void FuzzBool(bool* value) override;
+ void FuzzInt(int* value) override;
+ void FuzzLong(long* value) override;
+ void FuzzSize(size_t* value) override;
+ void FuzzUChar(unsigned char* value) override;
+ void FuzzWChar(wchar_t* value) override;
+ void FuzzUInt16(uint16* value) override;
+ void FuzzUInt32(uint32* value) override;
+ void FuzzInt64(int64* value) override;
+ void FuzzUInt64(uint64* value) override;
+ void FuzzFloat(float* value) override;
+ void FuzzDouble(double* value) override;
+ void FuzzString(std::string* value) override;
+ void FuzzString16(base::string16* value) override;
+ void FuzzData(char* data, int length) override;
+ void FuzzBytes(void* data, int data_len) override;
+ bool ShouldGenerate() override;
+
+ private:
+ unsigned int frequency_;
inferno 2015/03/16 18:56:35 don't need this large frequency, just have frequen
+};
+
+} // namespace ipc_fuzzer
+
+#endif // TOOLS_IPC_FUZZER_MUTATE_MUTATOR_H_

Powered by Google App Engine
This is Rietveld 408576698