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 // Functions for canonicalizing "mailto:" URLs. | 5 // Functions for canonicalizing "mailto:" URLs. |
6 | 6 |
7 #include "url/url_canon.h" | 7 #include "url/url_canon.h" |
8 #include "url/url_canon_internal.h" | 8 #include "url/url_canon_internal.h" |
9 #include "url/url_file.h" | 9 #include "url/url_file.h" |
10 #include "url/url_parse_internal.h" | 10 #include "url/url_parse_internal.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 else | 48 else |
49 output->push_back(static_cast<char>(uch)); | 49 output->push_back(static_cast<char>(uch)); |
50 } | 50 } |
51 | 51 |
52 new_parsed->path.len = output->length() - new_parsed->path.begin; | 52 new_parsed->path.len = output->length() - new_parsed->path.begin; |
53 } else { | 53 } else { |
54 // No path at all | 54 // No path at all |
55 new_parsed->path.reset(); | 55 new_parsed->path.reset(); |
56 } | 56 } |
57 | 57 |
58 // Query -- always use the default utf8 charset converter. | 58 // Query -- always use the default UTF8 charset converter. |
59 CanonicalizeQuery(source.query, parsed.query, NULL, | 59 CanonicalizeQuery(source.query, parsed.query, NULL, |
60 output, &new_parsed->query); | 60 output, &new_parsed->query); |
61 | 61 |
62 return success; | 62 return success; |
63 } | 63 } |
64 | 64 |
65 } // namespace | 65 } // namespace |
66 | 66 |
67 bool CanonicalizeMailtoURL(const char* spec, | 67 bool CanonicalizeMailtoURL(const char* spec, |
68 int spec_len, | 68 int spec_len, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 Parsed* new_parsed) { | 101 Parsed* new_parsed) { |
102 RawCanonOutput<1024> utf8; | 102 RawCanonOutput<1024> utf8; |
103 URLComponentSource<char> source(base); | 103 URLComponentSource<char> source(base); |
104 Parsed parsed(base_parsed); | 104 Parsed parsed(base_parsed); |
105 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); | 105 SetupUTF16OverrideComponents(base, replacements, &utf8, &source, &parsed); |
106 return DoCanonicalizeMailtoURL<char, unsigned char>( | 106 return DoCanonicalizeMailtoURL<char, unsigned char>( |
107 source, parsed, output, new_parsed); | 107 source, parsed, output, new_parsed); |
108 } | 108 } |
109 | 109 |
110 } // namespace url | 110 } // namespace url |
OLD | NEW |