Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / tools / ipc_fuzzer / fuzzer / mutator.h
blob896976d4cb4f0ff1da73d3a840581a0da642f028
1 // Copyright 2015 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.
5 #ifndef TOOLS_IPC_FUZZER_MUTATE_MUTATOR_H_
6 #define TOOLS_IPC_FUZZER_MUTATE_MUTATOR_H_
8 #include <string>
10 #include "tools/ipc_fuzzer/fuzzer/fuzzer.h"
12 namespace ipc_fuzzer {
14 class Mutator : public Fuzzer {
15 public:
16 explicit Mutator(unsigned int frequency) : frequency_(frequency) {}
17 virtual ~Mutator() {}
19 void FuzzBool(bool* value) override;
20 void FuzzInt(int* value) override;
21 void FuzzLong(long* value) override;
22 void FuzzSize(size_t* value) override;
23 void FuzzUChar(unsigned char* value) override;
24 void FuzzWChar(wchar_t* value) override;
25 void FuzzUInt16(uint16* value) override;
26 void FuzzUInt32(uint32* value) override;
27 void FuzzInt64(int64* value) override;
28 void FuzzUInt64(uint64* value) override;
29 void FuzzFloat(float* value) override;
30 void FuzzDouble(double* value) override;
31 void FuzzString(std::string* value) override;
32 void FuzzString16(base::string16* value) override;
33 void FuzzData(char* data, int length) override;
34 void FuzzBytes(void* data, int data_len) override;
35 bool ShouldGenerate() override;
37 private:
38 // TODO(mbarbella): Use double frequencies.
39 unsigned int frequency_;
42 } // namespace ipc_fuzzer
44 #endif // TOOLS_IPC_FUZZER_MUTATE_MUTATOR_H_