| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 NET_BASE_ESCAPE_H_ | 5 #ifndef NET_BASE_ESCAPE_H_ |
| 6 #define NET_BASE_ESCAPE_H_ | 6 #define NET_BASE_ESCAPE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 | 87 |
| 88 // Unescapes various characters that will change the meaning of URLs, | 88 // Unescapes various characters that will change the meaning of URLs, |
| 89 // including '%', '+', '&', '/', '#'. If we unescaped these characters, the | 89 // including '%', '+', '&', '/', '#'. If we unescaped these characters, the |
| 90 // resulting URL won't be the same as the source one. This flag is used when | 90 // resulting URL won't be the same as the source one. This flag is used when |
| 91 // generating final output like filenames for URLs where we won't be | 91 // generating final output like filenames for URLs where we won't be |
| 92 // interpreting as a URL and want to do as much unescaping as possible. | 92 // interpreting as a URL and want to do as much unescaping as possible. |
| 93 URL_SPECIAL_CHARS = 4, | 93 URL_SPECIAL_CHARS = 4, |
| 94 | 94 |
| 95 // Unescapes control characters such as %01. This INCLUDES NULLs. This is | 95 // Unescapes control characters such as %01. This INCLUDES NULLs. This is |
| 96 // used for rare cases such as data: URL decoding where the result is binary | 96 // used for rare cases such as data: URL decoding where the result is binary |
| 97 // data. This flag also unescapes BiDi control characters. | 97 // data. This flag also unescapes BiDi control characters and spoofable |
| 98 // characters (such as LOCK). |
| 98 // | 99 // |
| 99 // DO NOT use CONTROL_CHARS if the URL is going to be displayed in the UI | 100 // DO NOT use CONTROL_CHARS if the URL is going to be displayed in the UI |
| 100 // for security reasons. | 101 // for security reasons. |
| 101 CONTROL_CHARS = 8, | 102 CONTROL_CHARS = 8, |
| 102 | 103 |
| 103 // URL queries use "+" for space. This flag controls that replacement. | 104 // URL queries use "+" for space. This flag controls that replacement. |
| 104 REPLACE_PLUS_WITH_SPACE = 16, | 105 REPLACE_PLUS_WITH_SPACE = 16, |
| 105 }; | 106 }; |
| 106 }; | 107 }; |
| 107 | 108 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 135 UnescapeRule::Type rules, | 136 UnescapeRule::Type rules, |
| 136 base::OffsetAdjuster::Adjustments* adjustments); | 137 base::OffsetAdjuster::Adjustments* adjustments); |
| 137 | 138 |
| 138 // Unescapes the following ampersand character codes from |text|: | 139 // Unescapes the following ampersand character codes from |text|: |
| 139 // < > & " ' | 140 // < > & " ' |
| 140 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); | 141 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); |
| 141 | 142 |
| 142 } // namespace net | 143 } // namespace net |
| 143 | 144 |
| 144 #endif // NET_BASE_ESCAPE_H_ | 145 #endif // NET_BASE_ESCAPE_H_ |
| OLD | NEW |