diff options
author | Chris Xiong <chirs241097@gmail.com> | 2021-10-14 19:01:18 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2021-10-14 19:01:18 -0400 |
commit | 846cdbdbf965fc50478bcc4c6436e3dc6a489f3f (patch) | |
tree | 4a39385c982291a110f513871aba340f0a7a061e /www-client/chromium/files/chromium-76-gcc-blink-namespace1.patch | |
download | ppo-846cdbdbf965fc50478bcc4c6436e3dc6a489f3f.tar.xz |
Initial commit.
Diffstat (limited to 'www-client/chromium/files/chromium-76-gcc-blink-namespace1.patch')
-rw-r--r-- | www-client/chromium/files/chromium-76-gcc-blink-namespace1.patch | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/www-client/chromium/files/chromium-76-gcc-blink-namespace1.patch b/www-client/chromium/files/chromium-76-gcc-blink-namespace1.patch new file mode 100644 index 0000000..bae3ede --- /dev/null +++ b/www-client/chromium/files/chromium-76-gcc-blink-namespace1.patch @@ -0,0 +1,91 @@ +From c6afbd59c997c2b64f11abdd1eaef71ae8ea2ddc Mon Sep 17 00:00:00 2001 +From: Jose Dapena Paz <jose.dapena@lge.com> +Date: Fri, 07 Jun 2019 18:11:15 +0000 +Subject: [PATCH] GCC: FeaturePolicyParser ParseValueForFuzzer is not in anonymous namespace + +Compilation fails because we are declaring ParseValueForFuzzer as friend method, +but we are declaring it is in anonymous namespace. Moving to global namespace +still fails (in this case in Clang). + +So final solution is making it a public static method of FeaturePolicyParser. + +Bug: 819294 +Change-Id: Iea307cb6faef675b748d6eb5da2175dcbb17fdc7 +Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1645223 +Commit-Queue: José Dapena Paz <jose.dapena@lge.com> +Reviewed-by: Luna Lu <loonybear@chromium.org> +Cr-Commit-Position: refs/heads/master@{#667228} +--- + +diff --git a/third_party/blink/renderer/core/feature_policy/feature_policy_parser.cc b/third_party/blink/renderer/core/feature_policy/feature_policy_parser.cc +index f1c9594..bae91a1 100644 +--- a/third_party/blink/renderer/core/feature_policy/feature_policy_parser.cc ++++ b/third_party/blink/renderer/core/feature_policy/feature_policy_parser.cc +@@ -323,6 +323,13 @@ + return value; + } + ++void FeaturePolicyParser::ParseValueForFuzzer( ++ blink::mojom::PolicyValueType feature_type, ++ const WTF::String& value_string) { ++ bool ok; ++ ParseValueForType(feature_type, value_string, &ok); ++} ++ + bool IsFeatureDeclared(mojom::FeaturePolicyFeature feature, + const ParsedFeaturePolicy& policy) { + return std::any_of(policy.begin(), policy.end(), +diff --git a/third_party/blink/renderer/core/feature_policy/feature_policy_parser.h b/third_party/blink/renderer/core/feature_policy/feature_policy_parser.h +index fd25d90..8aa7323 100644 +--- a/third_party/blink/renderer/core/feature_policy/feature_policy_parser.h ++++ b/third_party/blink/renderer/core/feature_policy/feature_policy_parser.h +@@ -16,9 +16,6 @@ + #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + #include "third_party/blink/renderer/platform/wtf/vector.h" + +-// Forward declare for friendship. +-void ParseValueForFuzzer(blink::mojom::PolicyValueType, const WTF::String&); +- + namespace blink { + + class Document; +@@ -79,8 +76,10 @@ + const FeatureNameMap& feature_names, + ExecutionContext* execution_context = nullptr); + ++ // Used for LLVM fuzzer test ++ static void ParseValueForFuzzer(mojom::PolicyValueType, const String&); ++ + private: +- friend void ::ParseValueForFuzzer(mojom::PolicyValueType, const String&); + static PolicyValue GetFallbackValueForFeature( + mojom::FeaturePolicyFeature feature); + static PolicyValue ParseValueForType(mojom::PolicyValueType feature_type, +diff --git a/third_party/blink/renderer/core/feature_policy/feature_policy_value_fuzzer.cc b/third_party/blink/renderer/core/feature_policy/feature_policy_value_fuzzer.cc +index 7f8e6aa..1455636 100644 +--- a/third_party/blink/renderer/core/feature_policy/feature_policy_value_fuzzer.cc ++++ b/third_party/blink/renderer/core/feature_policy/feature_policy_value_fuzzer.cc +@@ -13,19 +13,12 @@ + #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h" + #include "third_party/blink/renderer/platform/wtf/vector.h" + +-void ParseValueForFuzzer(blink::mojom::PolicyValueType feature_type, +- const WTF::String& value_string) { +- bool ok; +- blink::FeaturePolicyParser::ParseValueForType(feature_type, value_string, +- &ok); +-} +- + extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { + static blink::BlinkFuzzerTestSupport test_support = + blink::BlinkFuzzerTestSupport(); +- ParseValueForFuzzer(blink::mojom::PolicyValueType::kBool, +- WTF::String(data, size)); +- ParseValueForFuzzer(blink::mojom::PolicyValueType::kDecDouble, +- WTF::String(data, size)); ++ blink::FeaturePolicyParser::ParseValueForFuzzer( ++ blink::mojom::PolicyValueType::kBool, WTF::String(data, size)); ++ blink::FeaturePolicyParser::ParseValueForFuzzer( ++ blink::mojom::PolicyValueType::kDecDouble, WTF::String(data, size)); + return 0; + } |