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

Side by Side Diff: url/gurl.cc

Issue 301353003: Using pre-existing constants instead of hard-coding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing nit Created 6 years, 6 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
« no previous file with comments | « url/gurl.h ('k') | url/url_constants.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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 }
OLDNEW
« no previous file with comments | « url/gurl.h ('k') | url/url_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698