Chromium Code Reviews| 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 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 675 template <> | 675 template <> |
| 676 struct FuzzTraits<cc::CompositorFrame> { | 676 struct FuzzTraits<cc::CompositorFrame> { |
| 677 static bool Fuzz(cc::CompositorFrame* p, Fuzzer* fuzzer) { | 677 static bool Fuzz(cc::CompositorFrame* p, Fuzzer* fuzzer) { |
| 678 // TODO(mbarbella): Support mutation. | 678 // TODO(mbarbella): Support mutation. |
| 679 if (!fuzzer->ShouldGenerate()) | 679 if (!fuzzer->ShouldGenerate()) |
| 680 return true; | 680 return true; |
| 681 | 681 |
| 682 if (!FuzzParam(&p->metadata, fuzzer)) | 682 if (!FuzzParam(&p->metadata, fuzzer)) |
| 683 return false; | 683 return false; |
| 684 | 684 |
| 685 switch (RandInRange(3)) { | 685 switch (RandInRange(3)) { |
|
danakj
2016/10/04 21:58:40
Reduce this range to match?
kylechar
2016/10/05 13:45:54
Good catch, done.
| |
| 686 case 0: { | 686 case 0: { |
| 687 p->delegated_frame_data.reset(new cc::DelegatedFrameData()); | 687 p->delegated_frame_data.reset(new cc::DelegatedFrameData()); |
| 688 if (!FuzzParam(p->delegated_frame_data.get(), fuzzer)) | 688 if (!FuzzParam(p->delegated_frame_data.get(), fuzzer)) |
| 689 return false; | 689 return false; |
| 690 return true; | 690 return true; |
| 691 } | 691 } |
| 692 case 1: { | |
| 693 p->gl_frame_data.reset(new cc::GLFrameData()); | |
| 694 if (!FuzzParam(p->gl_frame_data.get(), fuzzer)) | |
| 695 return false; | |
| 696 return true; | |
| 697 } | |
| 698 default: | 692 default: |
| 699 // Fuzz nothing to handle the no frame case. | 693 // Fuzz nothing to handle the no frame case. |
| 700 return true; | 694 return true; |
| 701 } | 695 } |
| 702 } | 696 } |
| 703 }; | 697 }; |
| 704 | 698 |
| 705 template <> | 699 template <> |
| 706 struct FuzzTraits<cc::DelegatedFrameData> { | 700 struct FuzzTraits<cc::DelegatedFrameData> { |
| 707 static bool Fuzz(cc::DelegatedFrameData* p, Fuzzer* fuzzer) { | 701 static bool Fuzz(cc::DelegatedFrameData* p, Fuzzer* fuzzer) { |
| (...skipping 1317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2025 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" | 2019 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" |
| 2026 #undef IPC_MESSAGE_DECL | 2020 #undef IPC_MESSAGE_DECL |
| 2027 #define IPC_MESSAGE_DECL(name, ...) \ | 2021 #define IPC_MESSAGE_DECL(name, ...) \ |
| 2028 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; | 2022 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; |
| 2029 | 2023 |
| 2030 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { | 2024 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { |
| 2031 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 2025 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
| 2032 } | 2026 } |
| 2033 | 2027 |
| 2034 } // namespace ipc_fuzzer | 2028 } // namespace ipc_fuzzer |
| OLD | NEW |