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

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

Issue 2792973004: Moved all tests about bypassing CSP into csp-tests (content layer) (Closed)
Patch Set: CR changes Jochen Created 3 years, 8 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ 5 #ifndef CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_
6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ 6 #define CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 virtual void ReportContentSecurityPolicyViolation( 45 virtual void ReportContentSecurityPolicyViolation(
46 const CSPViolationParams& violation_params); 46 const CSPViolationParams& violation_params);
47 47
48 bool SelfSchemeShouldBypassCsp(); 48 bool SelfSchemeShouldBypassCsp();
49 49
50 void ResetContentSecurityPolicies() { policies_.clear(); } 50 void ResetContentSecurityPolicies() { policies_.clear(); }
51 void AddContentSecurityPolicy(const ContentSecurityPolicy& policy) { 51 void AddContentSecurityPolicy(const ContentSecurityPolicy& policy) {
52 policies_.push_back(policy); 52 policies_.push_back(policy);
53 } 53 }
54 54
55 private:
56 virtual bool SchemeShouldBypassCSP(const base::StringPiece& scheme); 55 virtual bool SchemeShouldBypassCSP(const base::StringPiece& scheme);
57 56
57 private:
58 bool has_self_ = false; 58 bool has_self_ = false;
59 std::string self_scheme_; 59 std::string self_scheme_;
60 CSPSource self_source_; 60 CSPSource self_source_;
61 61
62 std::vector<ContentSecurityPolicy> policies_; 62 std::vector<ContentSecurityPolicy> policies_;
63 63
64 DISALLOW_COPY_AND_ASSIGN(CSPContext); 64 DISALLOW_COPY_AND_ASSIGN(CSPContext);
65 }; 65 };
66 66
67 // Used in CSPContext::ReportViolation() 67 // Used in CSPContext::ReportViolation()
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 105
106 // Whether or not the violation happens after a redirect. 106 // Whether or not the violation happens after a redirect.
107 bool after_redirect; 107 bool after_redirect;
108 108
109 // The source code location that triggered the blocked navigation. 109 // The source code location that triggered the blocked navigation.
110 SourceLocation source_location; 110 SourceLocation source_location;
111 }; 111 };
112 112
113 } // namespace content 113 } // namespace content
114 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_ 114 #endif // CONTENT_COMMON_CONTENT_SECURITY_POLICY_CSP_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698