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

Side by Side Diff: net/base/escape.h

Issue 664803003: Update from chromium a8e7c94b1b79a0948d05a1fcfff53391d22ce37a (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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 | « net/base/data_url_unittest.cc ('k') | net/base/escape.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 (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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // Unescapes various characters that will change the meaning of URLs, 82 // Unescapes various characters that will change the meaning of URLs,
83 // including '%', '+', '&', '/', '#'. If we unescaped these characters, the 83 // including '%', '+', '&', '/', '#'. If we unescaped these characters, the
84 // resulting URL won't be the same as the source one. This flag is used when 84 // resulting URL won't be the same as the source one. This flag is used when
85 // generating final output like filenames for URLs where we won't be 85 // generating final output like filenames for URLs where we won't be
86 // interpreting as a URL and want to do as much unescaping as possible. 86 // interpreting as a URL and want to do as much unescaping as possible.
87 URL_SPECIAL_CHARS = 4, 87 URL_SPECIAL_CHARS = 4,
88 88
89 // Unescapes control characters such as %01. This INCLUDES NULLs. This is 89 // Unescapes control characters such as %01. This INCLUDES NULLs. This is
90 // used for rare cases such as data: URL decoding where the result is binary 90 // used for rare cases such as data: URL decoding where the result is binary
91 // data. You should not use this for normal URLs! 91 // data. This flag also unescapes BiDi control characters.
92 //
93 // DO NOT use CONTROL_CHARS if the URL is going to be displayed in the UI
94 // for security reasons.
92 CONTROL_CHARS = 8, 95 CONTROL_CHARS = 8,
93 96
94 // URL queries use "+" for space. This flag controls that replacement. 97 // URL queries use "+" for space. This flag controls that replacement.
95 REPLACE_PLUS_WITH_SPACE = 16, 98 REPLACE_PLUS_WITH_SPACE = 16,
96 }; 99 };
97 }; 100 };
98 101
99 // Unescapes |escaped_text| and returns the result. 102 // Unescapes |escaped_text| and returns the result.
100 // Unescaping consists of looking for the exact pattern "%XX", where each X is 103 // Unescaping consists of looking for the exact pattern "%XX", where each X is
101 // a hex digit, and converting to the character with the numerical value of 104 // a hex digit, and converting to the character with the numerical value of
(...skipping 24 matching lines...) Expand all
126 UnescapeRule::Type rules, 129 UnescapeRule::Type rules,
127 base::OffsetAdjuster::Adjustments* adjustments); 130 base::OffsetAdjuster::Adjustments* adjustments);
128 131
129 // Unescapes the following ampersand character codes from |text|: 132 // Unescapes the following ampersand character codes from |text|:
130 // &lt; &gt; &amp; &quot; &#39; 133 // &lt; &gt; &amp; &quot; &#39;
131 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text); 134 NET_EXPORT base::string16 UnescapeForHTML(const base::string16& text);
132 135
133 } // namespace net 136 } // namespace net
134 137
135 #endif // NET_BASE_ESCAPE_H_ 138 #endif // NET_BASE_ESCAPE_H_
OLDNEW
« no previous file with comments | « net/base/data_url_unittest.cc ('k') | net/base/escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698