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

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

Issue 2633573002: Add Postscript Printing (Closed)
Patch Set: Fix Linux compile error Created 3 years, 11 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 1492 matching lines...) Expand 10 before | Expand all | Expand 10 after
1503 return true; 1503 return true;
1504 } 1504 }
1505 }; 1505 };
1506 1506
1507 template <> 1507 template <>
1508 struct FuzzTraits<printing::PdfRenderSettings> { 1508 struct FuzzTraits<printing::PdfRenderSettings> {
1509 static bool Fuzz(printing::PdfRenderSettings* p, Fuzzer* fuzzer) { 1509 static bool Fuzz(printing::PdfRenderSettings* p, Fuzzer* fuzzer) {
1510 gfx::Rect area = p->area; 1510 gfx::Rect area = p->area;
1511 int dpi = p->dpi; 1511 int dpi = p->dpi;
1512 bool autorotate = p->autorotate; 1512 bool autorotate = p->autorotate;
1513 gfx::Point offsets = p->offsets;
1514 printing::PdfRenderSettings::Mode mode = p->mode;
1513 if (!FuzzParam(&area, fuzzer)) 1515 if (!FuzzParam(&area, fuzzer))
1514 return false; 1516 return false;
1517 if (!FuzzParam(&offsets, fuzzer))
1518 return false;
1515 if (!FuzzParam(&dpi, fuzzer)) 1519 if (!FuzzParam(&dpi, fuzzer))
1516 return false; 1520 return false;
1517 if (!FuzzParam(&autorotate, fuzzer)) 1521 if (!FuzzParam(&autorotate, fuzzer))
1518 return false; 1522 return false;
1519 *p = printing::PdfRenderSettings(area, dpi, autorotate); 1523 if (!FuzzParam(&mode, fuzzer))
1524 return false;
1525 *p = printing::PdfRenderSettings(area, offsets, dpi, autorotate, mode);
1520 return true; 1526 return true;
1521 } 1527 }
1522 }; 1528 };
1523 1529
1524 template <> 1530 template <>
1525 struct FuzzTraits<SkBitmap> { 1531 struct FuzzTraits<SkBitmap> {
1526 static bool Fuzz(SkBitmap* p, Fuzzer* fuzzer) { 1532 static bool Fuzz(SkBitmap* p, Fuzzer* fuzzer) {
1527 // TODO(mbarbella): This should actually do something. 1533 // TODO(mbarbella): This should actually do something.
1528 return true; 1534 return true;
1529 } 1535 }
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" 1846 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
1841 #undef IPC_MESSAGE_DECL 1847 #undef IPC_MESSAGE_DECL
1842 #define IPC_MESSAGE_DECL(name, ...) \ 1848 #define IPC_MESSAGE_DECL(name, ...) \
1843 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; 1849 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz;
1844 1850
1845 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { 1851 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) {
1846 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 1852 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
1847 } 1853 }
1848 1854
1849 } // namespace ipc_fuzzer 1855 } // namespace ipc_fuzzer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698