| Index: third_party/WebKit/Source/platform/feature_policy/FeaturePolicyFuzzer.cpp
|
| diff --git a/third_party/WebKit/Source/platform/json/JSONParserFuzzer.cpp b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyFuzzer.cpp
|
| similarity index 50%
|
| copy from third_party/WebKit/Source/platform/json/JSONParserFuzzer.cpp
|
| copy to third_party/WebKit/Source/platform/feature_policy/FeaturePolicyFuzzer.cpp
|
| index 467c0ece0afe1cf3e4cfbdb4c96b3c3c4470c25b..d6863f52fba665f389a35fa3f039e86372eeb389 100644
|
| --- a/third_party/WebKit/Source/platform/json/JSONParserFuzzer.cpp
|
| +++ b/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyFuzzer.cpp
|
| @@ -2,16 +2,24 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "platform/json/JSONParser.h"
|
| +#include "platform/feature_policy/FeaturePolicy.h"
|
|
|
| -#include "platform/json/JSONValues.h"
|
| +#include "platform/heap/Handle.h"
|
| #include "platform/testing/BlinkFuzzerTestSupport.h"
|
| +#include "platform/weborigin/SecurityOrigin.h"
|
| +#include "wtf/Vector.h"
|
| #include "wtf/text/WTFString.h"
|
| +#include <memory>
|
| #include <stddef.h>
|
| #include <stdint.h>
|
|
|
| extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
| - blink::parseJSON(WTF::String(data, size));
|
| + WTF::Vector<WTF::String> messages;
|
| + RefPtr<blink::SecurityOrigin> origin =
|
| + blink::SecurityOrigin::createFromString("https://example.com/");
|
| + std::unique_ptr<blink::FeaturePolicy> policy =
|
| + blink::FeaturePolicy::createFromParentPolicy(nullptr, origin);
|
| + policy->setHeaderPolicy(WTF::String(data, size), messages);
|
| return 0;
|
| }
|
|
|
|
|