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

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

Issue 2612793002: Implement ContentSecurityPolicy on the browser-side. (Closed)
Patch Set: Add the TODO and bug ids that was forgotten. Created 3 years, 10 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_COMMON_CONTENT_SECURITY_POLICY_CSP_SOURCE_LIST_H_
6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_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> sources;
30
31 std::string ToString() const;
32
33 bool IsNone() const;
34
35 // Return true when at least one source in the |source_list| matches the
36 // |url| for a given |context|.
37 static bool Allow(const CSPSourceList& source_list,
38 const GURL& url,
39 CSPContext* context,
40 bool is_redirect = false);
41 };
42
43 } // namespace content
44 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_SOURCE_LIST_H_
OLDNEW
« no previous file with comments | « content/common/content_security_policy/csp_source.cc ('k') | content/common/content_security_policy/csp_source_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698