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 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1757 return false; | 1757 return false; |
1758 } | 1758 } |
1759 } | 1759 } |
1760 } | 1760 } |
1761 }; | 1761 }; |
1762 | 1762 |
1763 template <> | 1763 template <> |
1764 struct FuzzTraits<ui::LatencyInfo> { | 1764 struct FuzzTraits<ui::LatencyInfo> { |
1765 static bool Fuzz(ui::LatencyInfo* p, Fuzzer* fuzzer) { | 1765 static bool Fuzz(ui::LatencyInfo* p, Fuzzer* fuzzer) { |
1766 // TODO(inferno): Add param traits for |latency_components|. | 1766 // TODO(inferno): Add param traits for |latency_components|. |
1767 p->input_coordinates_size = static_cast<uint32>( | 1767 uint32 input_coordinates_size = static_cast<uint32>( |
1768 RandInRange(ui::LatencyInfo::kMaxInputCoordinates + 1)); | 1768 RandInRange(ui::LatencyInfo::kMaxInputCoordinates + 1)); |
1769 ui::LatencyInfo::InputCoordinate | |
1770 input_coordinates[ui::LatencyInfo::kMaxInputCoordinates]; | |
1771 int64 trace_id = p->trace_id(); | |
1772 bool terminated = p->terminated(); | |
1769 if (!FuzzParamArray( | 1773 if (!FuzzParamArray( |
1770 &p->input_coordinates[0], p->input_coordinates_size, fuzzer)) | 1774 input_coordinates, input_coordinates_size, fuzzer)) |
1771 return false; | 1775 return false; |
1772 if (!FuzzParam(&p->trace_id, fuzzer)) | 1776 if (!FuzzParam(&trace_id, fuzzer)) |
1773 return false; | 1777 return false; |
1774 if (!FuzzParam(&p->terminated, fuzzer)) | 1778 if (!FuzzParam(&terminated, fuzzer)) |
inferno
2015/08/05 15:16:10
Removing the cq since there is a part missing. If
| |
1775 return false; | 1779 return false; |
1776 return true; | 1780 return true; |
1777 } | 1781 } |
1778 }; | 1782 }; |
1779 | 1783 |
1780 template <> | 1784 template <> |
1781 struct FuzzTraits<ui::LatencyInfo::InputCoordinate> { | 1785 struct FuzzTraits<ui::LatencyInfo::InputCoordinate> { |
1782 static bool Fuzz( | 1786 static bool Fuzz( |
1783 ui::LatencyInfo::InputCoordinate* p, Fuzzer* fuzzer) { | 1787 ui::LatencyInfo::InputCoordinate* p, Fuzzer* fuzzer) { |
1784 if (!FuzzParam(&p->x, fuzzer)) | 1788 if (!FuzzParam(&p->x, fuzzer)) |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2094 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" | 2098 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" |
2095 #undef IPC_MESSAGE_DECL | 2099 #undef IPC_MESSAGE_DECL |
2096 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ | 2100 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ |
2097 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name; | 2101 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name; |
2098 | 2102 |
2099 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { | 2103 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { |
2100 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 2104 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
2101 } | 2105 } |
2102 | 2106 |
2103 } // namespace ipc_fuzzer | 2107 } // namespace ipc_fuzzer |
OLD | NEW |