OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <iostream> | 5 #include <iostream> |
6 #include <set> | 6 #include <set> |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1267 random_url = std::string("file://") + random_url; | 1267 random_url = std::string("file://") + random_url; |
1268 else if (selector == 2) | 1268 else if (selector == 2) |
1269 random_url = std::string("javascript:") + random_url; | 1269 random_url = std::string("javascript:") + random_url; |
1270 else if (selector == 2) | 1270 else if (selector == 2) |
1271 random_url = std::string("data:") + random_url; | 1271 random_url = std::string("data:") + random_url; |
1272 *p = GURL(random_url); | 1272 *p = GURL(random_url); |
1273 return true; | 1273 return true; |
1274 } | 1274 } |
1275 }; | 1275 }; |
1276 | 1276 |
| 1277 template <> |
| 1278 struct FuzzTraits<HostID> { |
| 1279 static bool Fuzz(HostID* p, Fuzzer* fuzzer) { |
| 1280 HostID::HostType type = p->type(); |
| 1281 std::string id = p->id(); |
| 1282 if (!FuzzParam(&type, fuzzer)) |
| 1283 return false; |
| 1284 if (!FuzzParam(&id, fuzzer)) |
| 1285 return false; |
| 1286 *p = HostID(type, id); |
| 1287 return true; |
| 1288 } |
| 1289 }; |
| 1290 |
1277 #if defined(OS_WIN) | 1291 #if defined(OS_WIN) |
1278 template <> | 1292 template <> |
1279 struct FuzzTraits<HWND> { | 1293 struct FuzzTraits<HWND> { |
1280 static bool Fuzz(HWND* p, Fuzzer* fuzzer) { | 1294 static bool Fuzz(HWND* p, Fuzzer* fuzzer) { |
1281 // TODO(aarya): This should actually do something. | 1295 // TODO(aarya): This should actually do something. |
1282 return true; | 1296 return true; |
1283 } | 1297 } |
1284 }; | 1298 }; |
1285 #endif | 1299 #endif |
1286 | 1300 |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2068 #include "ipc/ipc_message_null_macros.h" | 2082 #include "ipc/ipc_message_null_macros.h" |
2069 #undef IPC_MESSAGE_DECL | 2083 #undef IPC_MESSAGE_DECL |
2070 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ | 2084 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ |
2071 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name; | 2085 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name; |
2072 | 2086 |
2073 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { | 2087 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { |
2074 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 2088 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
2075 } | 2089 } |
2076 | 2090 |
2077 } // namespace ipc_fuzzer | 2091 } // namespace ipc_fuzzer |
OLD | NEW |