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

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

Issue 1427543002: Modified old wait sync point functions to also accept new sync tokens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase + autogen Created 5 years, 1 month 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 <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1192 1192
1193 template <> 1193 template <>
1194 struct FuzzTraits<gpu::Mailbox> { 1194 struct FuzzTraits<gpu::Mailbox> {
1195 static bool Fuzz(gpu::Mailbox* p, Fuzzer* fuzzer) { 1195 static bool Fuzz(gpu::Mailbox* p, Fuzzer* fuzzer) {
1196 fuzzer->FuzzBytes(p->name, sizeof(p->name)); 1196 fuzzer->FuzzBytes(p->name, sizeof(p->name));
1197 return true; 1197 return true;
1198 } 1198 }
1199 }; 1199 };
1200 1200
1201 template <> 1201 template <>
1202 struct FuzzTraits<gpu::SyncToken> {
1203 static bool Fuzz(gpu::SyncToken* p, Fuzzer* fuzzer) {
1204 bool verified_flush = false;
1205 gpu::CommandBufferNamespace namespace_id =
1206 gpu::CommandBufferNamespace::INVALID;
1207 uint64_t command_buffer_id = 0;
1208 uint64_t release_count = 0;
1209
1210 if (!FuzzParam(&verified_flush, fuzzer))
1211 return false;
1212 if (!FuzzParam(&namespace_id, fuzzer))
1213 return false;
1214 if (!FuzzParam(&command_buffer_id, fuzzer))
1215 return false;
1216 if (!FuzzParam(&release_count, fuzzer))
1217 return false;
1218
1219 p->Clear();
1220 p->Set(namespace_id, command_buffer_id, release_count);
1221 if (verified_flush)
1222 p->SetVerifyFlush();
1223 }
1224 };
1225
1226 template <>
1202 struct FuzzTraits<gpu::MailboxHolder> { 1227 struct FuzzTraits<gpu::MailboxHolder> {
1203 static bool Fuzz(gpu::MailboxHolder* p, Fuzzer* fuzzer) { 1228 static bool Fuzz(gpu::MailboxHolder* p, Fuzzer* fuzzer) {
1204 if (!FuzzParam(&p->mailbox, fuzzer)) 1229 if (!FuzzParam(&p->mailbox, fuzzer))
1205 return false; 1230 return false;
1231 if (!FuzzParam(&p->sync_token, fuzzer))
1232 return false;
1206 if (!FuzzParam(&p->texture_target, fuzzer)) 1233 if (!FuzzParam(&p->texture_target, fuzzer))
1207 return false; 1234 return false;
1208 if (!FuzzParam(&p->sync_point, fuzzer))
1209 return false;
1210 return true; 1235 return true;
1211 } 1236 }
1212 }; 1237 };
1213 1238
1214 template <> 1239 template <>
1215 struct FuzzTraits<gpu::ValueState> { 1240 struct FuzzTraits<gpu::ValueState> {
1216 static bool Fuzz(gpu::ValueState* p, Fuzzer* fuzzer) { 1241 static bool Fuzz(gpu::ValueState* p, Fuzzer* fuzzer) {
1217 if (!FuzzParamArray(&p->float_value[0], 4, fuzzer)) 1242 if (!FuzzParamArray(&p->float_value[0], 4, fuzzer))
1218 return false; 1243 return false;
1219 if (!FuzzParamArray(&p->int_value[0], 4, fuzzer)) 1244 if (!FuzzParamArray(&p->int_value[0], 4, fuzzer))
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after
2097 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" 2122 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
2098 #undef IPC_MESSAGE_DECL 2123 #undef IPC_MESSAGE_DECL
2099 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \ 2124 #define IPC_MESSAGE_DECL(kind, type, name, in, out, ilist, olist) \
2100 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name; 2125 (*map)[static_cast<uint32>(name::ID)] = fuzzer_for_##name;
2101 2126
2102 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { 2127 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) {
2103 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 2128 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
2104 } 2129 }
2105 2130
2106 } // namespace ipc_fuzzer 2131 } // namespace ipc_fuzzer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698