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

Side by Side Diff: url/url_util.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/public/web/WebSecurityPolicy.h ('k') | url/url_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 URL_URL_UTIL_H_ 5 #ifndef URL_URL_UTIL_H_
6 #define URL_URL_UTIL_H_ 6 #define URL_URL_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 URL_EXPORT const std::vector<std::string>& GetCORSEnabledSchemes(); 99 URL_EXPORT const std::vector<std::string>& GetCORSEnabledSchemes();
100 100
101 // Adds an application-defined scheme to the list of web schemes that can be 101 // Adds an application-defined scheme to the list of web schemes that can be
102 // used by web to store data (e.g. cookies, local storage, ...). This is 102 // used by web to store data (e.g. cookies, local storage, ...). This is
103 // to differentiate them from schemes that can store data but are not used on 103 // to differentiate them from schemes that can store data but are not used on
104 // web (e.g. application's internal schemes) or schemes that are used on web but 104 // web (e.g. application's internal schemes) or schemes that are used on web but
105 // cannot store data. 105 // cannot store data.
106 URL_EXPORT void AddWebStorageScheme(const char* new_scheme); 106 URL_EXPORT void AddWebStorageScheme(const char* new_scheme);
107 URL_EXPORT const std::vector<std::string>& GetWebStorageSchemes(); 107 URL_EXPORT const std::vector<std::string>& GetWebStorageSchemes();
108 108
109 // Adds an application-defined scheme to the list of schemes that can bypass the
110 // Content-Security-Policy(CSP) checks.
111 URL_EXPORT void AddCSPBypassingScheme(const char* new_scheme);
112 URL_EXPORT const std::vector<std::string>& GetCSPBypassingSchemes();
113
109 // Sets a flag to prevent future calls to Add*Scheme from succeeding. 114 // Sets a flag to prevent future calls to Add*Scheme from succeeding.
110 // 115 //
111 // This is designed to help prevent errors for multithreaded applications. 116 // This is designed to help prevent errors for multithreaded applications.
112 // Normal usage would be to call Add*Scheme for your custom schemes at 117 // Normal usage would be to call Add*Scheme for your custom schemes at
113 // the beginning of program initialization, and then LockSchemeRegistries. This 118 // the beginning of program initialization, and then LockSchemeRegistries. This
114 // prevents future callers from mistakenly calling Add*Scheme when the 119 // prevents future callers from mistakenly calling Add*Scheme when the
115 // program is running with multiple threads, where such usage would be 120 // program is running with multiple threads, where such usage would be
116 // dangerous. 121 // dangerous.
117 // 122 //
118 // We could have had Add*Scheme use a lock instead, but that would add 123 // We could have had Add*Scheme use a lock instead, but that would add
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 270
266 // Escapes the given string as defined by the JS method encodeURIComponent. See 271 // Escapes the given string as defined by the JS method encodeURIComponent. See
267 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent 272 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent
268 URL_EXPORT void EncodeURIComponent(const char* input, 273 URL_EXPORT void EncodeURIComponent(const char* input,
269 int length, 274 int length,
270 CanonOutput* output); 275 CanonOutput* output);
271 276
272 } // namespace url 277 } // namespace url
273 278
274 #endif // URL_URL_UTIL_H_ 279 #endif // URL_URL_UTIL_H_
OLDNEW
« no previous file with comments | « third_party/WebKit/public/web/WebSecurityPolicy.h ('k') | url/url_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698