| 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 web schemes that can be |
| 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 |
| 104 // web (e.g. application's internal schemes) or schemes that are used on web but |
| 105 // cannot store data. |
| 106 URL_EXPORT void AddWebStorageScheme(const char* new_scheme); |
| 107 URL_EXPORT const std::vector<std::string>& GetWebStorageSchemes(); |
| 108 |
| 101 // Sets a flag to prevent future calls to Add*Scheme from succeeding. | 109 // Sets a flag to prevent future calls to Add*Scheme from succeeding. |
| 102 // | 110 // |
| 103 // This is designed to help prevent errors for multithreaded applications. | 111 // This is designed to help prevent errors for multithreaded applications. |
| 104 // Normal usage would be to call Add*Scheme for your custom schemes at | 112 // Normal usage would be to call Add*Scheme for your custom schemes at |
| 105 // the beginning of program initialization, and then LockSchemeRegistries. This | 113 // the beginning of program initialization, and then LockSchemeRegistries. This |
| 106 // prevents future callers from mistakenly calling Add*Scheme when the | 114 // prevents future callers from mistakenly calling Add*Scheme when the |
| 107 // program is running with multiple threads, where such usage would be | 115 // program is running with multiple threads, where such usage would be |
| 108 // dangerous. | 116 // dangerous. |
| 109 // | 117 // |
| 110 // We could have had Add*Scheme use a lock instead, but that would add | 118 // 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 | 265 |
| 258 // Escapes the given string as defined by the JS method encodeURIComponent. See | 266 // Escapes the given string as defined by the JS method encodeURIComponent. See |
| 259 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR
IComponent | 267 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR
IComponent |
| 260 URL_EXPORT void EncodeURIComponent(const char* input, | 268 URL_EXPORT void EncodeURIComponent(const char* input, |
| 261 int length, | 269 int length, |
| 262 CanonOutput* output); | 270 CanonOutput* output); |
| 263 | 271 |
| 264 } // namespace url | 272 } // namespace url |
| 265 | 273 |
| 266 #endif // URL_URL_UTIL_H_ | 274 #endif // URL_URL_UTIL_H_ |
| OLD | NEW |