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

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h

Issue 2401573003: CSP: Fix 'strict-dynamic' with multiple policies. (Closed)
Patch Set: Tests compile. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h b/third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h
index 44e1304166de6ec4f4b47658f62ab75597a9fcbc..8e08208cb55aeb9c641cdfe207cb6ce46d245097 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h
+++ b/third_party/WebKit/Source/core/fetch/ResourceLoaderOptions.h
@@ -67,6 +67,10 @@ enum SynchronousPolicy { RequestSynchronously, RequestAsynchronously };
// an access check upon seeing the response.
enum CORSEnabled { NotCORSEnabled, IsCORSEnabled };
+// Was the request generated from a "parser-inserted" element?
+// https://html.spec.whatwg.org/multipage/scripting.html#parser-inserted
+enum ParserDisposition { ParserInserted, NotParserInserted };
+
struct ResourceLoaderOptions {
USING_FAST_MALLOC(ResourceLoaderOptions);
@@ -78,7 +82,8 @@ struct ResourceLoaderOptions {
contentSecurityPolicyOption(CheckContentSecurityPolicy),
requestInitiatorContext(DocumentContext),
synchronousPolicy(RequestAsynchronously),
- corsEnabled(NotCORSEnabled) {}
+ corsEnabled(NotCORSEnabled),
+ parserDisposition(ParserInserted) {}
ResourceLoaderOptions(
DataBufferingPolicy dataBufferingPolicy,
@@ -92,7 +97,8 @@ struct ResourceLoaderOptions {
contentSecurityPolicyOption(contentSecurityPolicyOption),
requestInitiatorContext(requestInitiatorContext),
synchronousPolicy(RequestAsynchronously),
- corsEnabled(NotCORSEnabled) {}
+ corsEnabled(NotCORSEnabled),
+ parserDisposition(ParserInserted) {}
// Answers the question "can a separate request with these different options
// be re-used" (e.g. preload request) The safe (but possibly slow) answer is
@@ -132,6 +138,7 @@ struct ResourceLoaderOptions {
RefPtr<SecurityOrigin> securityOrigin;
String contentSecurityPolicyNonce;
IntegrityMetadataSet integrityMetadata;
+ ParserDisposition parserDisposition;
};
// Encode AtomicString (in FetchInitiatorInfo) as String to cross threads.
@@ -151,7 +158,8 @@ struct CrossThreadResourceLoaderOptionsData {
? options.securityOrigin->isolatedCopy()
: nullptr),
contentSecurityPolicyNonce(options.contentSecurityPolicyNonce),
- integrityMetadata(options.integrityMetadata) {}
+ integrityMetadata(options.integrityMetadata),
+ parserDisposition(options.parserDisposition) {}
operator ResourceLoaderOptions() const {
ResourceLoaderOptions options;
@@ -166,6 +174,7 @@ struct CrossThreadResourceLoaderOptionsData {
options.securityOrigin = securityOrigin;
options.contentSecurityPolicyNonce = contentSecurityPolicyNonce;
options.integrityMetadata = integrityMetadata;
+ options.parserDisposition = parserDisposition;
return options;
}
@@ -180,6 +189,7 @@ struct CrossThreadResourceLoaderOptionsData {
RefPtr<SecurityOrigin> securityOrigin;
String contentSecurityPolicyNonce;
IntegrityMetadataSet integrityMetadata;
+ ParserDisposition parserDisposition;
};
template <>
« no previous file with comments | « third_party/WebKit/Source/core/fetch/FetchRequest.h ('k') | third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698