Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 // loaded with them to not have access to pages loaded with any other URL | 91 // loaded with them to not have access to pages loaded with any other URL |
| 92 // scheme. | 92 // scheme. |
| 93 URL_EXPORT void AddNoAccessScheme(const char* new_scheme); | 93 URL_EXPORT void AddNoAccessScheme(const char* new_scheme); |
| 94 URL_EXPORT const std::vector<std::string>& GetNoAccessSchemes(); | 94 URL_EXPORT const std::vector<std::string>& GetNoAccessSchemes(); |
| 95 | 95 |
| 96 // Adds an application-defined scheme to the list of schemes that can be sent | 96 // Adds an application-defined scheme to the list of schemes that can be sent |
| 97 // CORS requests. | 97 // CORS requests. |
| 98 URL_EXPORT void AddCORSEnabledScheme(const char* new_scheme); | 98 URL_EXPORT void AddCORSEnabledScheme(const char* new_scheme); |
| 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 schemes that can bypass the | |
| 102 // Content-Security-Policy(CSP) checks. | |
| 103 URL_EXPORT void AddBypassingCSPScheme(const char* new_scheme); | |
| 104 URL_EXPORT const std::vector<std::string>& GetBypassingCSPSchemes(); | |
|
Mike West
2017/02/08 14:59:53
I'm pretty hard-pressed to call this a concept tha
| |
| 105 | |
| 101 // Sets a flag to prevent future calls to Add*Scheme from succeeding. | 106 // Sets a flag to prevent future calls to Add*Scheme from succeeding. |
| 102 // | 107 // |
| 103 // This is designed to help prevent errors for multithreaded applications. | 108 // This is designed to help prevent errors for multithreaded applications. |
| 104 // Normal usage would be to call Add*Scheme for your custom schemes at | 109 // Normal usage would be to call Add*Scheme for your custom schemes at |
| 105 // the beginning of program initialization, and then LockSchemeRegistries. This | 110 // the beginning of program initialization, and then LockSchemeRegistries. This |
| 106 // prevents future callers from mistakenly calling Add*Scheme when the | 111 // prevents future callers from mistakenly calling Add*Scheme when the |
| 107 // program is running with multiple threads, where such usage would be | 112 // program is running with multiple threads, where such usage would be |
| 108 // dangerous. | 113 // dangerous. |
| 109 // | 114 // |
| 110 // We could have had Add*Scheme use a lock instead, but that would add | 115 // 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 Loading... | |
| 257 | 262 |
| 258 // Escapes the given string as defined by the JS method encodeURIComponent. See | 263 // Escapes the given string as defined by the JS method encodeURIComponent. See |
| 259 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent | 264 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent |
| 260 URL_EXPORT void EncodeURIComponent(const char* input, | 265 URL_EXPORT void EncodeURIComponent(const char* input, |
| 261 int length, | 266 int length, |
| 262 CanonOutput* output); | 267 CanonOutput* output); |
| 263 | 268 |
| 264 } // namespace url | 269 } // namespace url |
| 265 | 270 |
| 266 #endif // URL_URL_UTIL_H_ | 271 #endif // URL_URL_UTIL_H_ |
| OLD | NEW |