OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_DIRECTIVE_ |
| 6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_DIRECTIVE_ |
| 7 |
| 8 #include <string> |
| 9 #include "content/common/content_export.h" |
| 10 #include "content/common/content_security_policy/csp_source_list.h" |
| 11 |
| 12 namespace content { |
| 13 |
| 14 struct CONTENT_EXPORT CSPDirective { |
| 15 enum Name { |
| 16 DefaultSrc, |
| 17 ChildSrc, |
| 18 FrameSrc, |
| 19 FormAction, |
| 20 |
| 21 Unknown, |
| 22 NameLast = Unknown, |
| 23 }; |
| 24 |
| 25 static std::string NameToString(Name name); |
| 26 static Name StringToName(const std::string& name); |
| 27 |
| 28 CSPDirective(); |
| 29 CSPDirective(Name name, const CSPSourceList& source_list); |
| 30 CSPDirective(const CSPDirective&); |
| 31 |
| 32 Name name; |
| 33 CSPSourceList source_list; |
| 34 |
| 35 std::string ToString() const; |
| 36 }; |
| 37 |
| 38 } // namespace content |
| 39 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_DIRECTIVE_ |
OLD | NEW |