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

Side by Side Diff: Source/core/frame/csp/ContentSecurityPolicy.h

Issue 353873003: Clean up usage of CSP functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix to apply Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google, Inc. All rights reserved. 2 * Copyright (C) 2011 Google, Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 bool allowMediaFromSource(const KURL&, ReportingStatus = SendReport) const; 119 bool allowMediaFromSource(const KURL&, ReportingStatus = SendReport) const;
120 bool allowConnectToSource(const KURL&, ReportingStatus = SendReport) const; 120 bool allowConnectToSource(const KURL&, ReportingStatus = SendReport) const;
121 bool allowFormAction(const KURL&, ReportingStatus = SendReport) const; 121 bool allowFormAction(const KURL&, ReportingStatus = SendReport) const;
122 bool allowBaseURI(const KURL&, ReportingStatus = SendReport) const; 122 bool allowBaseURI(const KURL&, ReportingStatus = SendReport) const;
123 bool allowAncestors(LocalFrame*, ReportingStatus = SendReport) const; 123 bool allowAncestors(LocalFrame*, ReportingStatus = SendReport) const;
124 bool allowChildContextFromSource(const KURL&, ReportingStatus = SendReport) const; 124 bool allowChildContextFromSource(const KURL&, ReportingStatus = SendReport) const;
125 bool allowWorkerContextFromSource(const KURL&, ReportingStatus = SendReport) const; 125 bool allowWorkerContextFromSource(const KURL&, ReportingStatus = SendReport) const;
126 126
127 // The nonce and hash allow functions are guaranteed to not have any side 127 // The nonce and hash allow functions are guaranteed to not have any side
128 // effects, including reporting. 128 // effects, including reporting.
129 bool allowScriptNonce(const String& nonce) const; 129 // Nonce/Hash functions check all policies relating to use of a script/style
130 bool allowStyleNonce(const String& nonce) const; 130 // with the given nonce/hash and return true all CSP policies allow it.
131 bool allowScriptHash(const String& source) const; 131 // If these return true, callers can then process the content or
132 bool allowStyleHash(const String& source) const; 132 // issue a load and be safe disabling any further CSP checks.
133 bool allowScriptWithNonce(const String& nonce) const;
134 bool allowStyleWithNonce(const String& nonce) const;
135 bool allowScriptWithHash(const String& source) const;
136 bool allowStyleWithHash(const String& source) const;
133 137
134 void usesScriptHashAlgorithms(uint8_t ContentSecurityPolicyHashAlgorithm); 138 void usesScriptHashAlgorithms(uint8_t ContentSecurityPolicyHashAlgorithm);
135 void usesStyleHashAlgorithms(uint8_t ContentSecurityPolicyHashAlgorithm); 139 void usesStyleHashAlgorithms(uint8_t ContentSecurityPolicyHashAlgorithm);
136 140
137 ReflectedXSSDisposition reflectedXSSDisposition() const; 141 ReflectedXSSDisposition reflectedXSSDisposition() const;
138 142
139 ReferrerPolicy referrerPolicy() const; 143 ReferrerPolicy referrerPolicy() const;
140 bool didSetReferrerPolicy() const; 144 bool didSetReferrerPolicy() const;
141 145
142 void setOverrideAllowInlineStyle(bool); 146 void setOverrideAllowInlineStyle(bool);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // We put the hash functions used on the policy object so that we only need 199 // We put the hash functions used on the policy object so that we only need
196 // to calculate a hash once and then distribute it to all of the directives 200 // to calculate a hash once and then distribute it to all of the directives
197 // for validation. 201 // for validation.
198 uint8_t m_scriptHashAlgorithmsUsed; 202 uint8_t m_scriptHashAlgorithmsUsed;
199 uint8_t m_styleHashAlgorithmsUsed; 203 uint8_t m_styleHashAlgorithmsUsed;
200 }; 204 };
201 205
202 } 206 }
203 207
204 #endif 208 #endif
OLDNEW
« no previous file with comments | « Source/core/fetch/ResourceFetcher.cpp ('k') | Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698