Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Side by Side Diff: content/common/content_security_policy/csp_source_list.h

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Temporary re-add the parser + transmit parsed CSP over IPC. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_BROWSER_COMMON_CONTENT_SECURITY_POLICY_SOURCE_LIST_H
6 #define CONTENT_BROWSER_COMMON_CONTENT_SECURITY_POLICY_SOURCE_LIST_H
7
8 #include <vector>
9
10 #include "content/common/content_security_policy/csp_source.h"
11 #include "url/gurl.h"
12
13 namespace content {
14
15 class CSPContext;
16
17 struct CONTENT_EXPORT CSPSourceList {
18 CSPSourceList();
19 CSPSourceList(bool allow_self,
20 bool allow_star,
21 std::vector<CSPSource> source_list);
22 CSPSourceList(const CSPSourceList&);
23 ~CSPSourceList();
24
25 // Wildcard hosts and 'self' aren't stored in source_list, but as attributes
26 // on the source list itself.
27 bool allow_self;
28 bool allow_star;
29 std::vector<CSPSource> source_list;
30
31 static CSPSourceList Parse(CSPContext* context,
32 const base::StringPiece& directive_name,
33 const base::StringPiece& directive_value);
34
35 bool Allow(CSPContext* context,
36 const GURL& url,
37 bool is_redirect = false) const;
38
39 std::string ToString() const;
40
41 private:
42 bool AllowFromSources(CSPContext* context,
43 const GURL& url,
44 bool is_redirect) const;
45 };
46
47 } // namespace content
48 #endif // CONTENT_BROWSER_COMMON_CONTENT_SECURITY_POLICY_SOURCE_LIST_DIRECTIVE_ H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698