summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/platform/network/content_security_policy_parsers.h
blob: 56d7f613c01053ab9aea6be92983f21762bee33e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_NETWORK_CONTENT_SECURITY_POLICY_PARSERS_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_NETWORK_CONTENT_SECURITY_POLICY_PARSERS_H_

#include "third_party/blink/renderer/platform/crypto.h"
#include "third_party/blink/renderer/platform/platform_export.h"
#include "third_party/blink/renderer/platform/wtf/forward.h"

namespace blink {

// Check if value matches
// https://w3c.github.io/webappsec-csp/#grammardef-serialized-policy. We also
// allow a trailing ';', repeated ';'s, and a trailing ';' followed by spaces.
//
// Note: this is currently used only for checking validity of the csp attribute,
// otherwise all CSP parsing is performed by the network parser.
PLATFORM_EXPORT
bool MatchesTheSerializedCSPGrammar(const String& value);

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_NETWORK_CONTENT_SECURITY_POLICY_PARSERS_H_