| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 // Set the path, since the path is longer than one, we can just set the | 298 // Set the path, since the path is longer than one, we can just set the |
| 299 // first character and resize. | 299 // first character and resize. |
| 300 other.spec_[other.parsed_.path.begin] = '/'; | 300 other.spec_[other.parsed_.path.begin] = '/'; |
| 301 other.parsed_.path.len = 1; | 301 other.parsed_.path.len = 1; |
| 302 other.spec_.resize(other.parsed_.path.begin + 1); | 302 other.spec_.resize(other.parsed_.path.begin + 1); |
| 303 return other; | 303 return other; |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool GURL::IsStandard() const { | 306 bool GURL::IsStandard() const { |
| 307 return url_util::IsStandard(spec_.data(), static_cast<int>(spec_.length()), | 307 return url_util::IsStandard(spec_.data(), parsed_.scheme); |
| 308 parsed_.scheme); | |
| 309 } | 308 } |
| 310 | 309 |
| 311 bool GURL::SchemeIs(const char* lower_ascii_scheme) const { | 310 bool GURL::SchemeIs(const char* lower_ascii_scheme) const { |
| 312 if (parsed_.scheme.len <= 0) | 311 if (parsed_.scheme.len <= 0) |
| 313 return lower_ascii_scheme == NULL; | 312 return lower_ascii_scheme == NULL; |
| 314 return url_util::LowerCaseEqualsASCII(spec_.data() + parsed_.scheme.begin, | 313 return url_util::LowerCaseEqualsASCII(spec_.data() + parsed_.scheme.begin, |
| 315 spec_.data() + parsed_.scheme.end(), | 314 spec_.data() + parsed_.scheme.end(), |
| 316 lower_ascii_scheme); | 315 lower_ascii_scheme); |
| 317 } | 316 } |
| 318 | 317 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 | 440 |
| 442 return true; | 441 return true; |
| 443 } | 442 } |
| 444 | 443 |
| 445 void GURL::Swap(GURL* other) { | 444 void GURL::Swap(GURL* other) { |
| 446 spec_.swap(other->spec_); | 445 spec_.swap(other->spec_); |
| 447 std::swap(is_valid_, other->is_valid_); | 446 std::swap(is_valid_, other->is_valid_); |
| 448 std::swap(parsed_, other->parsed_); | 447 std::swap(parsed_, other->parsed_); |
| 449 } | 448 } |
| 450 | 449 |
| OLD | NEW |