Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 35 // Space is escaped as + (if use_plus is true) and other special characters | 35 // Space is escaped as + (if use_plus is true) and other special characters |
| 36 // as %XX (hex). | 36 // as %XX (hex). |
| 37 NET_EXPORT std::string EscapeUrlEncodedData(const std::string& path, | 37 NET_EXPORT std::string EscapeUrlEncodedData(const std::string& path, |
| 38 bool use_plus); | 38 bool use_plus); |
| 39 | 39 |
| 40 // Escapes all non-ASCII input. | 40 // Escapes all non-ASCII input. |
| 41 NET_EXPORT std::string EscapeNonASCII(const std::string& input); | 41 NET_EXPORT std::string EscapeNonASCII(const std::string& input); |
| 42 | 42 |
| 43 // Escapes characters in text suitable for use as an external protocol handler | 43 // Escapes characters in text suitable for use as an external protocol handler |
| 44 // command. | 44 // command. |
| 45 // We %XX everything except alphanumerics and %-_.!~*'() and the restricted | 45 // We %XX everything except alphanumerics and %-_.!~*'(), the restricted |
| 46 // chracters (;/?:@&=+$,). | 46 // chracters (;/?:@&=+$,#[]), and ones which are already escaped. |
|
asanka
2014/10/23 07:20:04
Since % is already mentioned in the exclusion list
Jaekyun Seok (inactive)
2014/10/23 12:43:19
Sorry, I should have removed '%' because here we a
| |
| 47 NET_EXPORT std::string EscapeExternalHandlerValue(const std::string& text); | 47 NET_EXPORT std::string EscapeExternalHandlerValue(const std::string& text); |
| 48 | 48 |
| 49 // Appends the given character to the output string, escaping the character if | 49 // Appends the given character to the output string, escaping the character if |
| 50 // the character would be interpretted as an HTML delimiter. | 50 // the character would be interpretted as an HTML delimiter. |
| 51 NET_EXPORT void AppendEscapedCharForHTML(char c, std::string* output); | 51 NET_EXPORT void AppendEscapedCharForHTML(char c, std::string* output); |
| 52 | 52 |
| 53 // Escapes chars that might cause this text to be interpretted as HTML tags. | 53 // Escapes chars that might cause this text to be interpretted as HTML tags. |
| 54 NET_EXPORT std::string EscapeForHTML(const std::string& text); | 54 NET_EXPORT std::string EscapeForHTML(const std::string& text); |
| 55 NET_EXPORT base::string16 EscapeForHTML(const base::string16& text); | 55 NET_EXPORT base::string16 EscapeForHTML(const base::string16& text); |
| 56 | 56 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 126 UnescapeRule::Type rules, | 126 UnescapeRule::Type rules, |
| 127 base::OffsetAdjuster::Adjustments* adjustments); | 127 base::OffsetAdjuster::Adjustments* adjustments); |
| 128 | 128 |
| 129 // Unescapes the following ampersand character codes from |text|: | 129 // Unescapes the following ampersand character codes from |text|: |
| 130 // < > & " ' | 130 // < > & " ' |
| 131 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); | 131 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); |
| 132 | 132 |
| 133 } // namespace net | 133 } // namespace net |
| 134 | 134 |
| 135 #endif // NET_BASE_ESCAPE_H_ | 135 #endif // NET_BASE_ESCAPE_H_ |
| OLD | NEW |