Skip to content

Commit

Permalink
Add specializations for a few more types in the IPC fuzzer.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tsepez@chromium.org committed Jan 23, 2014
1 parent cc7a66d commit 4e6dca6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions tools/ipc_fuzzer/message_lib/all_messages.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
27 changes: 27 additions & 0 deletions tools/ipc_fuzzer/mutate/generate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,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) {
Expand All @@ -482,6 +494,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) {
Expand Down

0 comments on commit 4e6dca6

Please sign in to comment.