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 <tuple> | 8 #include <tuple> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 template <> | 674 template <> |
675 struct FuzzTraits<cc::CompositorFrame> { | 675 struct FuzzTraits<cc::CompositorFrame> { |
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(3)) { | 684 switch (RandInRange(2)) { |
685 case 0: { | 685 case 0: { |
686 p->delegated_frame_data.reset(new cc::DelegatedFrameData()); | 686 p->delegated_frame_data.reset(new cc::DelegatedFrameData()); |
687 if (!FuzzParam(p->delegated_frame_data.get(), fuzzer)) | 687 if (!FuzzParam(p->delegated_frame_data.get(), fuzzer)) |
688 return false; | 688 return false; |
689 return true; | 689 return true; |
690 } | 690 } |
691 case 1: { | |
692 p->gl_frame_data.reset(new cc::GLFrameData()); | |
693 if (!FuzzParam(p->gl_frame_data.get(), fuzzer)) | |
694 return false; | |
695 return true; | |
696 } | |
697 default: | 691 default: |
698 // Fuzz nothing to handle the no frame case. | 692 // Fuzz nothing to handle the no frame case. |
699 return true; | 693 return true; |
700 } | 694 } |
701 } | 695 } |
702 }; | 696 }; |
703 | 697 |
704 template <> | 698 template <> |
705 struct FuzzTraits<cc::DelegatedFrameData> { | 699 struct FuzzTraits<cc::DelegatedFrameData> { |
706 static bool Fuzz(cc::DelegatedFrameData* p, Fuzzer* fuzzer) { | 700 static bool Fuzz(cc::DelegatedFrameData* p, Fuzzer* fuzzer) { |
(...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2024 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" | 2018 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" |
2025 #undef IPC_MESSAGE_DECL | 2019 #undef IPC_MESSAGE_DECL |
2026 #define IPC_MESSAGE_DECL(name, ...) \ | 2020 #define IPC_MESSAGE_DECL(name, ...) \ |
2027 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; | 2021 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; |
2028 | 2022 |
2029 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { | 2023 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { |
2030 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 2024 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
2031 } | 2025 } |
2032 | 2026 |
2033 } // namespace ipc_fuzzer | 2027 } // namespace ipc_fuzzer |
OLD | NEW |