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

Side by Side Diff: url/url_canon.h

Issue 2895953002: Update dangling markup mitigations. (Closed)
Patch Set: Test. Created 3 years, 7 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
OLDNEW
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_CANON_H_ 5 #ifndef URL_URL_CANON_H_
6 #define URL_URL_CANON_H_ 6 #define URL_URL_CANON_H_
7 7
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <string.h> 9 #include <string.h>
10 10
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 // This should be called before parsing if whitespace removal is desired (which 224 // This should be called before parsing if whitespace removal is desired (which
225 // it normally is when you are canonicalizing). 225 // it normally is when you are canonicalizing).
226 // 226 //
227 // If no whitespace is removed, this function will not use the buffer and will 227 // If no whitespace is removed, this function will not use the buffer and will
228 // return a pointer to the input, to avoid the extra copy. If modification is 228 // return a pointer to the input, to avoid the extra copy. If modification is
229 // required, the given |buffer| will be used and the returned pointer will 229 // required, the given |buffer| will be used and the returned pointer will
230 // point to the beginning of the buffer. 230 // point to the beginning of the buffer.
231 // 231 //
232 // Therefore, callers should not use the buffer, since it may actually be empty, 232 // Therefore, callers should not use the buffer, since it may actually be empty,
233 // use the computed pointer and |*output_len| instead. 233 // use the computed pointer and |*output_len| instead.
234 URL_EXPORT const char* RemoveURLWhitespace(const char* input, int input_len, 234 //
235 // If |input| contained both removable whitespace and a raw `<` character,
236 // |potentially_dangling_markup| will be set to `true`. Otherwise, it will be
237 // left untouched.
238 URL_EXPORT const char* RemoveURLWhitespace(const char* input,
239 int input_len,
235 CanonOutputT<char>* buffer, 240 CanonOutputT<char>* buffer,
236 int* output_len); 241 int* output_len,
242 bool* potentially_dangling_markup);
237 URL_EXPORT const base::char16* RemoveURLWhitespace( 243 URL_EXPORT const base::char16* RemoveURLWhitespace(
238 const base::char16* input, 244 const base::char16* input,
239 int input_len, 245 int input_len,
240 CanonOutputT<base::char16>* buffer, 246 CanonOutputT<base::char16>* buffer,
241 int* output_len); 247 int* output_len,
248 bool* potentially_dangling_markup);
242 249
243 // IDN ------------------------------------------------------------------------ 250 // IDN ------------------------------------------------------------------------
244 251
245 // Converts the Unicode input representing a hostname to ASCII using IDN rules. 252 // Converts the Unicode input representing a hostname to ASCII using IDN rules.
246 // The output must fall in the ASCII range, but will be encoded in UTF-16. 253 // The output must fall in the ASCII range, but will be encoded in UTF-16.
247 // 254 //
248 // On success, the output will be filled with the ASCII host name and it will 255 // On success, the output will be filled with the ASCII host name and it will
249 // return true. Unlike most other canonicalization functions, this assumes that 256 // return true. Unlike most other canonicalization functions, this assumes that
250 // the output is empty. The beginning of the host will be at offset 0, and 257 // the output is empty. The beginning of the host will be at offset 0, and
251 // the length of the output will be set to the length of the new host name. 258 // the length of the output will be set to the length of the new host name.
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 bool base_is_file, 923 bool base_is_file,
917 const base::char16* relative_url, 924 const base::char16* relative_url,
918 const Component& relative_component, 925 const Component& relative_component,
919 CharsetConverter* query_converter, 926 CharsetConverter* query_converter,
920 CanonOutput* output, 927 CanonOutput* output,
921 Parsed* out_parsed); 928 Parsed* out_parsed);
922 929
923 } // namespace url 930 } // namespace url
924 931
925 #endif // URL_URL_CANON_H_ 932 #endif // URL_URL_CANON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698