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

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

Issue 1277483002: Fix LatencyInfo compile error for ipc fuzzer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make FuzzTraits<LatencyInfo> a friend of LatencyInfo Created 5 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 | « no previous file | ui/events/latency_info.h » ('j') | ui/events/latency_info.h » ('J')
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 <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1746 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 p->input_coordinates_size_ = static_cast<uint32>(
1768 RandInRange(ui::LatencyInfo::kMaxInputCoordinates + 1)); 1768 RandInRange(ui::LatencyInfo::kMaxInputCoordinates + 1));
1769 if (!FuzzParamArray( 1769 if (!FuzzParamArray(
1770 &p->input_coordinates[0], p->input_coordinates_size, fuzzer)) 1770 &p->input_coordinates_[0], p->input_coordinates_size_, fuzzer))
1771 return false; 1771 return false;
1772 if (!FuzzParam(&p->trace_id, fuzzer)) 1772 if (!FuzzParam(&p->trace_id_, fuzzer))
1773 return false; 1773 return false;
1774 if (!FuzzParam(&p->terminated, fuzzer)) 1774 if (!FuzzParam(&p->terminated_, fuzzer))
1775 return false; 1775 return false;
1776 return true; 1776 return true;
inferno 2015/08/05 15:40:01 Can't we just call a ui::LatencyInfo constructor t
Yufeng Shen (Slow to review) 2015/08/05 16:08:24 LatencyInfo is not supposed to be constructed with
1777 } 1777 }
1778 }; 1778 };
1779 1779
1780 template <> 1780 template <>
1781 struct FuzzTraits<ui::LatencyInfo::InputCoordinate> { 1781 struct FuzzTraits<ui::LatencyInfo::InputCoordinate> {
1782 static bool Fuzz( 1782 static bool Fuzz(
1783 ui::LatencyInfo::InputCoordinate* p, Fuzzer* fuzzer) { 1783 ui::LatencyInfo::InputCoordinate* p, Fuzzer* fuzzer) {
1784 if (!FuzzParam(&p->x, fuzzer)) 1784 if (!FuzzParam(&p->x, fuzzer))
1785 return false; 1785 return false;
1786 if (!FuzzParam(&p->y, fuzzer)) 1786 if (!FuzzParam(&p->y, fuzzer))
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
2094 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" 2094 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
2095 #undef IPC_MESSAGE_DECL 2095 #undef IPC_MESSAGE_DECL
2096 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ 2096 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \
2097 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name; 2097 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name;
2098 2098
2099 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { 2099 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) {
2100 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 2100 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
2101 } 2101 }
2102 2102
2103 } // namespace ipc_fuzzer 2103 } // namespace ipc_fuzzer
OLDNEW
« no previous file with comments | « no previous file | ui/events/latency_info.h » ('j') | ui/events/latency_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698