summaryrefslogtreecommitdiffstats
path: root/tools/ipc_fuzzer
diff options
context:
space:
mode:
authortsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 04:18:19 +0000
committertsepez@chromium.org <tsepez@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 04:18:19 +0000
commit4e6dca6bd55de339552170781b728563acf662ea (patch)
tree80c080cc59e2516da7c73c40a91e8f54fa0d7350 /tools/ipc_fuzzer
parentcc7a66d49ed87b47fe9350c9eecb552f6d5d1a26 (diff)
downloadchromium_src-4e6dca6bd55de339552170781b728563acf662ea.zip
chromium_src-4e6dca6bd55de339552170781b728563acf662ea.tar.gz
chromium_src-4e6dca6bd55de339552170781b728563acf662ea.tar.bz2
Add specializations for a few more types in the IPC fuzzer.
Also deal with one more guarded message file. R=aedla@chromium.org BUG= Review URL: https://codereview.chromium.org/129873020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246521 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/ipc_fuzzer')
-rw-r--r--tools/ipc_fuzzer/message_lib/all_messages.h1
-rw-r--r--tools/ipc_fuzzer/mutate/generate.cc27
2 files changed, 28 insertions, 0 deletions
diff --git a/tools/ipc_fuzzer/message_lib/all_messages.h b/tools/ipc_fuzzer/message_lib/all_messages.h
index 7fb5838..ee657d1 100644
--- a/tools/ipc_fuzzer/message_lib/all_messages.h
+++ b/tools/ipc_fuzzer/message_lib/all_messages.h
@@ -10,6 +10,7 @@
#undef CHROME_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
#undef COMPONENTS_AUTOFILL_CONTENT_COMMON_AUTOFILL_PARAM_TRAITS_MACROS_H_
#undef CONTENT_COMMON_CONTENT_PARAM_TRAITS_MACROS_H_
+#undef CONTENT_COMMON_FRAME_PARAM_MACROS_H_
#undef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_MACROS_H_
#include "chrome/common/all_messages.h"
diff --git a/tools/ipc_fuzzer/mutate/generate.cc b/tools/ipc_fuzzer/mutate/generate.cc
index 000edc2..493c4e2 100644
--- a/tools/ipc_fuzzer/mutate/generate.cc
+++ b/tools/ipc_fuzzer/mutate/generate.cc
@@ -461,6 +461,18 @@ struct GenerateTraits<base::TimeTicks> {
};
template <>
+struct GenerateTraits<base::PlatformFileInfo> {
+ static bool Generate(base::PlatformFileInfo* p, Generator* generator) {
+ return
+ GenerateParam(&p->size, generator) &&
+ GenerateParam(&p->is_directory, generator) &&
+ GenerateParam(&p->last_modified, generator) &&
+ GenerateParam(&p->last_accessed, generator) &&
+ GenerateParam(&p->creation_time, generator);
+ }
+};
+
+template <>
struct GenerateTraits<GURL> {
static bool Generate(GURL *p, Generator* generator) {
const char url_chars[] = "Ahtp0:/.?+\%&#";
@@ -483,6 +495,21 @@ struct GenerateTraits<GURL> {
};
template <>
+struct GenerateTraits<net::HostPortPair> {
+ static bool Generate(net::HostPortPair *p, Generator* generator) {
+ std::string host;
+ uint16 port;
+ if (!GenerateParam(&host, generator))
+ return false;
+ if (!GenerateParam(&port, generator))
+ return false;
+ p->set_host(host);
+ p->set_port(port);
+ return true;
+ }
+};
+
+template <>
struct GenerateTraits<gfx::Point> {
static bool Generate(gfx::Point *p, Generator* generator) {
int x;