| OLD | NEW |
| 1 // Copyright 2007, Google Inc. | 1 // Copyright 2007, Google Inc. |
| 2 // All rights reserved. | 2 // All rights reserved. |
| 3 // | 3 // |
| 4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
| 5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
| 6 // met: | 6 // met: |
| 7 // | 7 // |
| 8 // * Redistributions of source code must retain the above copyright | 8 // * Redistributions of source code must retain the above copyright |
| 9 // notice, this list of conditions and the following disclaimer. | 9 // notice, this list of conditions and the following disclaimer. |
| 10 // * Redistributions in binary form must reproduce the above | 10 // * Redistributions in binary form must reproduce the above |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 out_parsed->path.end()); | 344 out_parsed->path.end()); |
| 345 return success; | 345 return success; |
| 346 } | 346 } |
| 347 | 347 |
| 348 // If we get here, the path is unchanged: copy to output. | 348 // If we get here, the path is unchanged: copy to output. |
| 349 CopyOneComponent(base_url, base_parsed.path, output, &out_parsed->path); | 349 CopyOneComponent(base_url, base_parsed.path, output, &out_parsed->path); |
| 350 | 350 |
| 351 if (query.is_valid()) { | 351 if (query.is_valid()) { |
| 352 // Just the query specified, replace the query and reference (ignore | 352 // Just the query specified, replace the query and reference (ignore |
| 353 // failures for refs) | 353 // failures for refs) |
| 354 CanonicalizeQuery(relative_url, query, NULL, output, &out_parsed->query); | 354 CanonicalizeQuery(relative_url, query, query_converter, |
| 355 output, &out_parsed->query); |
| 355 CanonicalizeRef(relative_url, ref, output, &out_parsed->ref); | 356 CanonicalizeRef(relative_url, ref, output, &out_parsed->ref); |
| 356 return success; | 357 return success; |
| 357 } | 358 } |
| 358 | 359 |
| 359 // If we get here, the query is unchanged: copy to output. Note that the | 360 // If we get here, the query is unchanged: copy to output. Note that the |
| 360 // range of the query parameter doesn't include the question mark, so we | 361 // range of the query parameter doesn't include the question mark, so we |
| 361 // have to add it manually if there is a component. | 362 // have to add it manually if there is a component. |
| 362 if (base_parsed.query.is_valid()) | 363 if (base_parsed.query.is_valid()) |
| 363 output->push_back('?'); | 364 output->push_back('?'); |
| 364 CopyOneComponent(base_url, base_parsed.query, output, &out_parsed->query); | 365 CopyOneComponent(base_url, base_parsed.query, output, &out_parsed->query); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 const url_parse::Component& relative_component, | 562 const url_parse::Component& relative_component, |
| 562 CharsetConverter* query_converter, | 563 CharsetConverter* query_converter, |
| 563 CanonOutput* output, | 564 CanonOutput* output, |
| 564 url_parse::Parsed* out_parsed) { | 565 url_parse::Parsed* out_parsed) { |
| 565 return DoResolveRelativeURL<char16>( | 566 return DoResolveRelativeURL<char16>( |
| 566 base_url, base_parsed, base_is_file, relative_url, | 567 base_url, base_parsed, base_is_file, relative_url, |
| 567 relative_component, query_converter, output, out_parsed); | 568 relative_component, query_converter, output, out_parsed); |
| 568 } | 569 } |
| 569 | 570 |
| 570 } // namespace url_canon | 571 } // namespace url_canon |
| OLD | NEW |