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 <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 if (!fuzzer->ShouldGenerate()) { | 778 if (!fuzzer->ShouldGenerate()) { |
779 for (size_t i = 0; i < p->size(); ++i) { | 779 for (size_t i = 0; i < p->size(); ++i) { |
780 if (!FuzzParam(p->at(i).get(), fuzzer)) | 780 if (!FuzzParam(p->at(i).get(), fuzzer)) |
781 return false; | 781 return false; |
782 } | 782 } |
783 return true; | 783 return true; |
784 } | 784 } |
785 | 785 |
786 size_t count = RandElementCount(); | 786 size_t count = RandElementCount(); |
787 for (size_t i = 0; i < count; ++i) { | 787 for (size_t i = 0; i < count; ++i) { |
788 scoped_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); | 788 std::unique_ptr<cc::RenderPass> render_pass = cc::RenderPass::Create(); |
789 if (!FuzzParam(render_pass.get(), fuzzer)) | 789 if (!FuzzParam(render_pass.get(), fuzzer)) |
790 return false; | 790 return false; |
791 p->push_back(std::move(render_pass)); | 791 p->push_back(std::move(render_pass)); |
792 } | 792 } |
793 return true; | 793 return true; |
794 } | 794 } |
795 }; | 795 }; |
796 | 796 |
797 template <> | 797 template <> |
798 struct FuzzTraits<content::IndexedDBKey> { | 798 struct FuzzTraits<content::IndexedDBKey> { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 }; | 921 }; |
922 | 922 |
923 template <> | 923 template <> |
924 struct FuzzTraits<content::SyntheticGesturePacket> { | 924 struct FuzzTraits<content::SyntheticGesturePacket> { |
925 static bool Fuzz(content::SyntheticGesturePacket* p, | 925 static bool Fuzz(content::SyntheticGesturePacket* p, |
926 Fuzzer* fuzzer) { | 926 Fuzzer* fuzzer) { |
927 // TODO(mbarbella): Support mutation. | 927 // TODO(mbarbella): Support mutation. |
928 if (!fuzzer->ShouldGenerate()) | 928 if (!fuzzer->ShouldGenerate()) |
929 return true; | 929 return true; |
930 | 930 |
931 scoped_ptr<content::SyntheticGestureParams> gesture_params; | 931 std::unique_ptr<content::SyntheticGestureParams> gesture_params; |
932 switch (RandInRange( | 932 switch (RandInRange( |
933 content::SyntheticGestureParams::SYNTHETIC_GESTURE_TYPE_MAX + 1)) { | 933 content::SyntheticGestureParams::SYNTHETIC_GESTURE_TYPE_MAX + 1)) { |
934 case content::SyntheticGestureParams::GestureType:: | 934 case content::SyntheticGestureParams::GestureType:: |
935 SMOOTH_SCROLL_GESTURE: { | 935 SMOOTH_SCROLL_GESTURE: { |
936 content::SyntheticSmoothScrollGestureParams* params = | 936 content::SyntheticSmoothScrollGestureParams* params = |
937 new content::SyntheticSmoothScrollGestureParams(); | 937 new content::SyntheticSmoothScrollGestureParams(); |
938 if (!FuzzParam(¶ms->anchor, fuzzer)) | 938 if (!FuzzParam(¶ms->anchor, fuzzer)) |
939 return false; | 939 return false; |
940 if (!FuzzParam(¶ms->distances, fuzzer)) | 940 if (!FuzzParam(¶ms->distances, fuzzer)) |
941 return false; | 941 return false; |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2042 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" | 2042 #include "tools/ipc_fuzzer/message_lib/all_message_null_macros.h" |
2043 #undef IPC_MESSAGE_DECL | 2043 #undef IPC_MESSAGE_DECL |
2044 #define IPC_MESSAGE_DECL(name, ...) \ | 2044 #define IPC_MESSAGE_DECL(name, ...) \ |
2045 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; | 2045 (*map)[static_cast<uint32_t>(name::ID)] = FuzzerHelper<name>::Fuzz; |
2046 | 2046 |
2047 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { | 2047 void PopulateFuzzerFunctionMap(FuzzerFunctionMap* map) { |
2048 #include "tools/ipc_fuzzer/message_lib/all_messages.h" | 2048 #include "tools/ipc_fuzzer/message_lib/all_messages.h" |
2049 } | 2049 } |
2050 | 2050 |
2051 } // namespace ipc_fuzzer | 2051 } // namespace ipc_fuzzer |
OLD | NEW |