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 <tuple> | 8 #include <tuple> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1498 int32_t tmp; | 1498 int32_t tmp; |
1499 p->GetInt32(&tmp); | 1499 p->GetInt32(&tmp); |
1500 if (!FuzzParam(&tmp, fuzzer)) | 1500 if (!FuzzParam(&tmp, fuzzer)) |
1501 return false; | 1501 return false; |
1502 p->SetInt32(tmp); | 1502 p->SetInt32(tmp); |
1503 return true; | 1503 return true; |
1504 } | 1504 } |
1505 }; | 1505 }; |
1506 | 1506 |
1507 template <> | 1507 template <> |
1508 struct FuzzTraits<printing::PdfRenderSettings> { | |
1509 static bool Fuzz(printing::PdfRenderSettings* p, Fuzzer* fuzzer) { | |
1510 gfx::Rect area = p->area; | |
1511 int dpi = p->dpi; | |
1512 bool autorotate = p->autorotate; | |
1513 if (!FuzzParam(&area, fuzzer)) | |
1514 return false; | |
1515 if (!FuzzParam(&dpi, fuzzer)) | |
1516 return false; | |
1517 if (!FuzzParam(&autorotate, fuzzer)) | |
1518 return false; | |
1519 *p = printing::PdfRenderSettings(area, dpi, autorotate); | |
1520 return true; | |
1521 } | |
1522 }; | |
1523 | |
1524 template <> | |
1525 struct FuzzTraits<SkBitmap> { | 1508 struct FuzzTraits<SkBitmap> { |
1526 static bool Fuzz(SkBitmap* p, Fuzzer* fuzzer) { | 1509 static bool Fuzz(SkBitmap* p, Fuzzer* fuzzer) { |
1527 // TODO(mbarbella): This should actually do something. | 1510 // TODO(mbarbella): This should actually do something. |
1528 return true; | 1511 return true; |
1529 } | 1512 } |
1530 }; | 1513 }; |
1531 | 1514 |
1532 template <> | 1515 template <> |
1533 struct FuzzTraits<storage::DataElement> { | 1516 struct FuzzTraits<storage::DataElement> { |
1534 static bool Fuzz(storage::DataElement* p, Fuzzer* fuzzer) { | 1517 static bool Fuzz(storage::DataElement* p, Fuzzer* fuzzer) { |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" | 1823 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" |
1841 #undef IPC_MESSAGE_DECL | 1824 #undef IPC_MESSAGE_DECL |
1842 #define IPC_MESSAGE_DECL(name, ...) \ | 1825 #define IPC_MESSAGE_DECL(name, ...) \ |
1843 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; | 1826 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; |
1844 | 1827 |
1845 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { | 1828 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { |
1846 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 1829 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
1847 } | 1830 } |
1848 | 1831 |
1849 } // namespace ipc_fuzzer | 1832 } // namespace ipc_fuzzer |
OLD | NEW |