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

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

Issue 2144533002: Convert network hints to Mojo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add untracked dependency on mojom Created 4 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 unified diff | Download patch
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
1504 // PP_ traits. 1495 // PP_ traits.
1505 template <> 1496 template <>
1506 struct FuzzTraits<PP_Bool> { 1497 struct FuzzTraits<PP_Bool> {
1507 static bool Fuzz(PP_Bool* p, Fuzzer* fuzzer) { 1498 static bool Fuzz(PP_Bool* p, Fuzzer* fuzzer) {
1508 bool tmp = PP_ToBool(*p); 1499 bool tmp = PP_ToBool(*p);
1509 if (!FuzzParam(&tmp, fuzzer)) 1500 if (!FuzzParam(&tmp, fuzzer))
1510 return false; 1501 return false;
1511 *p = PP_FromBool(tmp); 1502 *p = PP_FromBool(tmp);
1512 return true; 1503 return true;
1513 } 1504 }
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
2025 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" 2016 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
2026 #undef IPC_MESSAGE_DECL 2017 #undef IPC_MESSAGE_DECL
2027 #define IPC_MESSAGE_DECL(name, ...) \ 2018 #define IPC_MESSAGE_DECL(name, ...) \
2028 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; 2019 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz;
2029 2020
2030 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { 2021 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) {
2031 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 2022 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
2032 } 2023 }
2033 2024
2034 } // namespace ipc_fuzzer 2025 } // namespace ipc_fuzzer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698