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

Unified Diff: tools/ipc_fuzzer/fuzzer/fuzzer.h

Issue 2972773004: Remove ScopedVector from tools/ipc_fuzzer/. (Closed)
Patch Set: rev Created 3 years, 5 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 | « no previous file | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/ipc_fuzzer/fuzzer/fuzzer.h
diff --git a/tools/ipc_fuzzer/fuzzer/fuzzer.h b/tools/ipc_fuzzer/fuzzer/fuzzer.h
index f406a02953c19cca633c32d22f7a1cfc1f999e35..38bf58f25451750c0b4e14e218651b3fb2fc9c08 100644
--- a/tools/ipc_fuzzer/fuzzer/fuzzer.h
+++ b/tools/ipc_fuzzer/fuzzer/fuzzer.h
@@ -8,6 +8,7 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <string>
#include <vector>
@@ -67,16 +68,17 @@ class NoOpFuzzer : public Fuzzer {
void FuzzBytes(void* data, int data_len) override {}
};
-typedef IPC::Message* (*FuzzerFunction)(IPC::Message*, Fuzzer*);
+using FuzzerFunction = std::unique_ptr<IPC::Message> (*)(IPC::Message*,
+ Fuzzer*);
// Used for mutating messages. Once populated, the map associates a message ID
// with a FuzzerFunction used for mutation of that message type.
-typedef base::hash_map<uint32_t, FuzzerFunction> FuzzerFunctionMap;
+using FuzzerFunctionMap = base::hash_map<uint32_t, FuzzerFunction>;
void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map);
// Used for generating new messages. Once populated, the vector contains
// FuzzerFunctions for all message types that we know how to generate.
-typedef std::vector<FuzzerFunction> FuzzerFunctionVector;
+using FuzzerFunctionVector = std::vector<FuzzerFunction>;
void PopulateFuzzerFunctionVector(FuzzerFunctionVector* function_vector);
// Since IPC::Message can be serialized, we also track a global function vector
« no previous file with comments | « no previous file | tools/ipc_fuzzer/fuzzer/fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698