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

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

Issue 2260103003: CSP: Experimentally harden against nonce-stealing injections. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: yoav@ Created 4 years, 3 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 /* 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 class OrdinalNumber; 50 class OrdinalNumber;
51 } 51 }
52 52
53 namespace blink { 53 namespace blink {
54 54
55 class ContentSecurityPolicyResponseHeaders; 55 class ContentSecurityPolicyResponseHeaders;
56 class ConsoleMessage; 56 class ConsoleMessage;
57 class CSPDirectiveList; 57 class CSPDirectiveList;
58 class CSPSource; 58 class CSPSource;
59 class Document; 59 class Document;
60 class Element;
60 class FrameLoaderClient; 61 class FrameLoaderClient;
61 class KURL; 62 class KURL;
62 class ResourceRequest; 63 class ResourceRequest;
63 class SecurityOrigin; 64 class SecurityOrigin;
64 65
65 typedef int SandboxFlags; 66 typedef int SandboxFlags;
66 typedef HeapVector<Member<CSPDirectiveList>> CSPDirectiveListVector; 67 typedef HeapVector<Member<CSPDirectiveList>> CSPDirectiveListVector;
67 typedef HeapVector<Member<ConsoleMessage>> ConsoleMessageVector; 68 typedef HeapVector<Member<ConsoleMessage>> ConsoleMessageVector;
68 typedef std::pair<String, ContentSecurityPolicyHeaderType> CSPHeaderAndType; 69 typedef std::pair<String, ContentSecurityPolicyHeaderType> CSPHeaderAndType;
69 using RedirectStatus = ResourceRequest::RedirectStatus; 70 using RedirectStatus = ResourceRequest::RedirectStatus;
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 bool selfMatchesInnerURL() const; 274 bool selfMatchesInnerURL() const;
274 275
275 bool experimentalFeaturesEnabled() const; 276 bool experimentalFeaturesEnabled() const;
276 277
277 bool shouldSendCSPHeader(Resource::Type) const; 278 bool shouldSendCSPHeader(Resource::Type) const;
278 279
279 static bool shouldBypassMainWorld(const ExecutionContext*); 280 static bool shouldBypassMainWorld(const ExecutionContext*);
280 281
281 static bool isDirectiveName(const String&); 282 static bool isDirectiveName(const String&);
282 283
284 static bool isNonceableElement(const Element*);
285
283 Document* document() const; 286 Document* document() const;
284 287
285 private: 288 private:
286 FRIEND_TEST_ALL_PREFIXES(ContentSecurityPolicyTest, NonceInline); 289 FRIEND_TEST_ALL_PREFIXES(ContentSecurityPolicyTest, NonceInline);
287 FRIEND_TEST_ALL_PREFIXES(ContentSecurityPolicyTest, NonceSinglePolicy); 290 FRIEND_TEST_ALL_PREFIXES(ContentSecurityPolicyTest, NonceSinglePolicy);
288 FRIEND_TEST_ALL_PREFIXES(ContentSecurityPolicyTest, NonceMultiplePolicy); 291 FRIEND_TEST_ALL_PREFIXES(ContentSecurityPolicyTest, NonceMultiplePolicy);
289 292
290 ContentSecurityPolicy(); 293 ContentSecurityPolicy();
291 294
292 void applyPolicySideEffectsToExecutionContext(); 295 void applyPolicySideEffectsToExecutionContext();
(...skipping 27 matching lines...) Expand all
320 String m_disableEvalErrorMessage; 323 String m_disableEvalErrorMessage;
321 WebInsecureRequestPolicy m_insecureRequestPolicy; 324 WebInsecureRequestPolicy m_insecureRequestPolicy;
322 325
323 Member<CSPSource> m_selfSource; 326 Member<CSPSource> m_selfSource;
324 String m_selfProtocol; 327 String m_selfProtocol;
325 }; 328 };
326 329
327 } // namespace blink 330 } // namespace blink
328 331
329 #endif 332 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698