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

Side by Side Diff: tools/ipc_fuzzer/fuzzer/fuzzer.cc

Issue 2179693002: Revert of Convert network hints to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_message_start.h ('k') | tools/ipc_fuzzer/message_lib/OWNERS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <tuple> 8 #include <tuple>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1474 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 if (!FuzzParam(&ip_address, fuzzer)) 1485 if (!FuzzParam(&ip_address, fuzzer))
1486 return false; 1486 return false;
1487 if (!FuzzParam(&port, fuzzer)) 1487 if (!FuzzParam(&port, fuzzer))
1488 return false; 1488 return false;
1489 net::IPEndPoint ip_endpoint(ip_address, port); 1489 net::IPEndPoint ip_endpoint(ip_address, port);
1490 *p = ip_endpoint; 1490 *p = ip_endpoint;
1491 return true; 1491 return true;
1492 } 1492 }
1493 }; 1493 };
1494 1494
1495 template <>
1496 struct FuzzTraits<network_hints::LookupRequest> {
1497 static bool Fuzz(network_hints::LookupRequest* p, Fuzzer* fuzzer) {
1498 if (!FuzzParam(&p->hostname_list, fuzzer))
1499 return false;
1500 return true;
1501 }
1502 };
1503
1495 // PP_ traits. 1504 // PP_ traits.
1496 template <> 1505 template <>
1497 struct FuzzTraits<PP_Bool> { 1506 struct FuzzTraits<PP_Bool> {
1498 static bool Fuzz(PP_Bool* p, Fuzzer* fuzzer) { 1507 static bool Fuzz(PP_Bool* p, Fuzzer* fuzzer) {
1499 bool tmp = PP_ToBool(*p); 1508 bool tmp = PP_ToBool(*p);
1500 if (!FuzzParam(&tmp, fuzzer)) 1509 if (!FuzzParam(&tmp, fuzzer))
1501 return false; 1510 return false;
1502 *p = PP_FromBool(tmp); 1511 *p = PP_FromBool(tmp);
1503 return true; 1512 return true;
1504 } 1513 }
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2016 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" 2025 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
2017 #undef IPC_MESSAGE_DECL 2026 #undef IPC_MESSAGE_DECL
2018 #define IPC_MESSAGE_DECL(name, ...) \ 2027 #define IPC_MESSAGE_DECL(name, ...) \
2019 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; 2028 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz;
2020 2029
2021 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { 2030 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) {
2022 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 2031 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
2023 } 2032 }
2024 2033
2025 } // namespace ipc_fuzzer 2034 } // namespace ipc_fuzzer
OLDNEW
« no previous file with comments | « ipc/ipc_message_start.h ('k') | tools/ipc_fuzzer/message_lib/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698