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

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

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: nit Created 4 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 <tuple> 8 #include <tuple>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 static bool Fuzz(cc::CompositorFrame* p, Fuzzer* fuzzer) { 676 static bool Fuzz(cc::CompositorFrame* p, Fuzzer* fuzzer) {
677 // TODO(mbarbella): Support mutation. 677 // TODO(mbarbella): Support mutation.
678 if (!fuzzer->ShouldGenerate()) 678 if (!fuzzer->ShouldGenerate())
679 return true; 679 return true;
680 680
681 if (!FuzzParam(&p->metadata, fuzzer)) 681 if (!FuzzParam(&p->metadata, fuzzer))
682 return false; 682 return false;
683 683
684 switch (RandInRange(2)) { 684 switch (RandInRange(2)) {
685 case 0: { 685 case 0: {
686 p->delegated_frame_data.reset(new cc::DelegatedFrameData()); 686 if (!FuzzParam(&p->resource_list, fuzzer))
687 if (!FuzzParam(p->delegated_frame_data.get(), fuzzer)) 687 return false;
688 if (!FuzzParam(&p->render_pass_list, fuzzer))
688 return false; 689 return false;
689 return true; 690 return true;
690 } 691 }
691 default: 692 default:
692 // Fuzz nothing to handle the no frame case. 693 // Fuzz nothing to handle the no frame case.
693 return true; 694 return true;
694 } 695 }
695 } 696 }
696 }; 697 };
697 698
698 template <>
699 struct FuzzTraits<cc::DelegatedFrameData> {
700 static bool Fuzz(cc::DelegatedFrameData* p, Fuzzer* fuzzer) {
701 if (!FuzzParam(&p->resource_list, fuzzer))
702 return false;
703 if (!FuzzParam(&p->render_pass_list, fuzzer))
704 return false;
705 return true;
706 }
707 };
708
709 template <class A> 699 template <class A>
710 struct FuzzTraits<cc::ListContainer<A>> { 700 struct FuzzTraits<cc::ListContainer<A>> {
711 static bool Fuzz(cc::ListContainer<A>* p, Fuzzer* fuzzer) { 701 static bool Fuzz(cc::ListContainer<A>* p, Fuzzer* fuzzer) {
712 // TODO(mbarbella): This should actually do something. 702 // TODO(mbarbella): This should actually do something.
713 return true; 703 return true;
714 } 704 }
715 }; 705 };
716 706
717 template <> 707 template <>
718 struct FuzzTraits<cc::QuadList> { 708 struct FuzzTraits<cc::QuadList> {
(...skipping 1290 matching lines...) Expand 10 before | Expand all | Expand 10 after
2009 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" 1999 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h"
2010 #undef IPC_MESSAGE_DECL 2000 #undef IPC_MESSAGE_DECL
2011 #define IPC_MESSAGE_DECL(name, ...) \ 2001 #define IPC_MESSAGE_DECL(name, ...) \
2012 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; 2002 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz;
2013 2003
2014 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { 2004 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) {
2015 #include "tools/ipc_fuzzer/message_lib/all_messages.h" 2005 #include "tools/ipc_fuzzer/message_lib/all_messages.h"
2016 } 2006 }
2017 2007
2018 } // namespace ipc_fuzzer 2008 } // namespace ipc_fuzzer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698