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 #ifdef WIN32 | 5 #ifdef WIN32 |
6 #include <windows.h> | 6 #include <windows.h> |
7 #else | 7 #else |
8 #include <pthread.h> | 8 #include <pthread.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 | 363 |
364 bool GURL::SchemeIs(const char* lower_ascii_scheme) const { | 364 bool GURL::SchemeIs(const char* lower_ascii_scheme) const { |
365 if (parsed_.scheme.len <= 0) | 365 if (parsed_.scheme.len <= 0) |
366 return lower_ascii_scheme == NULL; | 366 return lower_ascii_scheme == NULL; |
367 return url::LowerCaseEqualsASCII(spec_.data() + parsed_.scheme.begin, | 367 return url::LowerCaseEqualsASCII(spec_.data() + parsed_.scheme.begin, |
368 spec_.data() + parsed_.scheme.end(), | 368 spec_.data() + parsed_.scheme.end(), |
369 lower_ascii_scheme); | 369 lower_ascii_scheme); |
370 } | 370 } |
371 | 371 |
372 bool GURL::SchemeIsHTTPOrHTTPS() const { | 372 bool GURL::SchemeIsHTTPOrHTTPS() const { |
373 return SchemeIs("http") || SchemeIs("https"); | 373 return SchemeIs(url::kHttpScheme) || SchemeIs(url::kHttpsScheme); |
374 } | 374 } |
375 | 375 |
376 bool GURL::SchemeIsWSOrWSS() const { | 376 bool GURL::SchemeIsWSOrWSS() const { |
377 return SchemeIs("ws") || SchemeIs("wss"); | 377 return SchemeIs(url::kWsScheme) || SchemeIs(url::kWssScheme); |
378 } | 378 } |
379 | 379 |
380 int GURL::IntPort() const { | 380 int GURL::IntPort() const { |
381 if (parsed_.port.is_nonempty()) | 381 if (parsed_.port.is_nonempty()) |
382 return url::ParsePort(spec_.data(), parsed_.port); | 382 return url::ParsePort(spec_.data(), parsed_.port); |
383 return url::PORT_UNSPECIFIED; | 383 return url::PORT_UNSPECIFIED; |
384 } | 384 } |
385 | 385 |
386 int GURL::EffectiveIntPort() const { | 386 int GURL::EffectiveIntPort() const { |
387 int int_port = IntPort(); | 387 int int_port = IntPort(); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 void GURL::Swap(GURL* other) { | 522 void GURL::Swap(GURL* other) { |
523 spec_.swap(other->spec_); | 523 spec_.swap(other->spec_); |
524 std::swap(is_valid_, other->is_valid_); | 524 std::swap(is_valid_, other->is_valid_); |
525 std::swap(parsed_, other->parsed_); | 525 std::swap(parsed_, other->parsed_); |
526 inner_url_.swap(other->inner_url_); | 526 inner_url_.swap(other->inner_url_); |
527 } | 527 } |
528 | 528 |
529 std::ostream& operator<<(std::ostream& out, const GURL& url) { | 529 std::ostream& operator<<(std::ostream& out, const GURL& url) { |
530 return out << url.possibly_invalid_spec(); | 530 return out << url.possibly_invalid_spec(); |
531 } | 531 } |
OLD | NEW |