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

Side by Side Diff: third_party/WebKit/public/web/WebSecurityPolicy.h

Issue 2679383003: Share schemes needed for CSP between the browser and the renderer. (Closed)
Patch Set: Rebase and fix conflict. 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
« no previous file with comments | « third_party/WebKit/Source/web/WebSecurityPolicy.cpp ('k') | url/url_util.h » ('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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 BLINK_EXPORT static void registerURLSchemeAsDisplayIsolated(const WebString&); 49 BLINK_EXPORT static void registerURLSchemeAsDisplayIsolated(const WebString&);
50 50
51 // Registers a URL scheme that can register a ServiceWorker. 51 // Registers a URL scheme that can register a ServiceWorker.
52 BLINK_EXPORT static void registerURLSchemeAsAllowingServiceWorkers( 52 BLINK_EXPORT static void registerURLSchemeAsAllowingServiceWorkers(
53 const WebString&); 53 const WebString&);
54 54
55 // Registers an HTTP-like URL scheme that supports the Fetch API. 55 // Registers an HTTP-like URL scheme that supports the Fetch API.
56 BLINK_EXPORT static void registerURLSchemeAsSupportingFetchAPI( 56 BLINK_EXPORT static void registerURLSchemeAsSupportingFetchAPI(
57 const WebString&); 57 const WebString&);
58 58
59 // Registers a URL scheme whose resources can be loaded regardless of a page's
60 // Content Security Policy.
61 BLINK_EXPORT static void registerURLSchemeAsBypassingContentSecurityPolicy(
62 const WebString&);
63
64 // Registers a URL scheme which will always be considered the first-party when 59 // Registers a URL scheme which will always be considered the first-party when
65 // loaded in a top-level context. 60 // loaded in a top-level context.
66 BLINK_EXPORT static void registerURLSchemeAsFirstPartyWhenTopLevel( 61 BLINK_EXPORT static void registerURLSchemeAsFirstPartyWhenTopLevel(
67 const WebString&); 62 const WebString&);
68 63
69 // Registers a URL scheme for which some kinds of resources bypass Content
70 // Security Policy.
71 // This enum should be kept in sync with
72 // Source/platform/weborigin/SchemeRegistry.h.
73 // Enforced in AssertMatchingEnums.cpp.
74 enum PolicyAreas : uint32_t {
75 PolicyAreaNone = 0,
76 PolicyAreaImage = 1 << 0,
77 PolicyAreaStyle = 1 << 1,
78 // Add more policy areas as needed by clients.
79 PolicyAreaAll = ~static_cast<uint32_t>(0),
80 };
81 BLINK_EXPORT static void registerURLSchemeAsBypassingContentSecurityPolicy(
82 const WebString& scheme,
83 PolicyAreas);
84
85 // Registers a URL scheme as strictly empty documents, allowing them to 64 // Registers a URL scheme as strictly empty documents, allowing them to
86 // commit synchronously. 65 // commit synchronously.
87 BLINK_EXPORT static void registerURLSchemeAsEmptyDocument(const WebString&); 66 BLINK_EXPORT static void registerURLSchemeAsEmptyDocument(const WebString&);
88 67
89 // Support for whitelisting access to origins beyond the same-origin policy. 68 // Support for whitelisting access to origins beyond the same-origin policy.
90 BLINK_EXPORT static void addOriginAccessWhitelistEntry( 69 BLINK_EXPORT static void addOriginAccessWhitelistEntry(
91 const WebURL& sourceOrigin, 70 const WebURL& sourceOrigin,
92 const WebString& destinationProtocol, 71 const WebString& destinationProtocol,
93 const WebString& destinationHost, 72 const WebString& destinationHost,
94 bool allowDestinationSubdomains); 73 bool allowDestinationSubdomains);
(...skipping 29 matching lines...) Expand all
124 BLINK_EXPORT static void registerURLSchemeAsAllowedForReferrer( 103 BLINK_EXPORT static void registerURLSchemeAsAllowedForReferrer(
125 const WebString&); 104 const WebString&);
126 105
127 private: 106 private:
128 WebSecurityPolicy(); 107 WebSecurityPolicy();
129 }; 108 };
130 109
131 } // namespace blink 110 } // namespace blink
132 111
133 #endif 112 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebSecurityPolicy.cpp ('k') | url/url_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698