| 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 #include "url/gurl.h" | 5 #include "url/gurl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <ostream> | 10 #include <ostream> |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 GURL::GURL(const GURL& other) | 72 GURL::GURL(const GURL& other) |
| 73 : spec_(other.spec_), | 73 : spec_(other.spec_), |
| 74 is_valid_(other.is_valid_), | 74 is_valid_(other.is_valid_), |
| 75 parsed_(other.parsed_) { | 75 parsed_(other.parsed_) { |
| 76 if (other.inner_url_) | 76 if (other.inner_url_) |
| 77 inner_url_.reset(new GURL(*other.inner_url_)); | 77 inner_url_.reset(new GURL(*other.inner_url_)); |
| 78 // Valid filesystem urls should always have an inner_url_. | 78 // Valid filesystem urls should always have an inner_url_. |
| 79 DCHECK(!is_valid_ || !SchemeIsFileSystem() || inner_url_); | 79 DCHECK(!is_valid_ || !SchemeIsFileSystem() || inner_url_); |
| 80 } | 80 } |
| 81 | 81 |
| 82 GURL::GURL(GURL&& other) | 82 GURL::GURL(GURL&& other) noexcept |
| 83 : spec_(std::move(other.spec_)), | 83 : spec_(std::move(other.spec_)), |
| 84 is_valid_(other.is_valid_), | 84 is_valid_(other.is_valid_), |
| 85 parsed_(other.parsed_), | 85 parsed_(other.parsed_), |
| 86 inner_url_(std::move(other.inner_url_)) { | 86 inner_url_(std::move(other.inner_url_)) { |
| 87 other.is_valid_ = false; | 87 other.is_valid_ = false; |
| 88 other.parsed_ = url::Parsed(); | 88 other.parsed_ = url::Parsed(); |
| 89 } | 89 } |
| 90 | 90 |
| 91 GURL::GURL(base::StringPiece url_string) { | 91 GURL::GURL(base::StringPiece url_string) { |
| 92 InitCanonical(url_string, true); | 92 InitCanonical(url_string, true); |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 | 546 |
| 547 bool operator==(const GURL& x, const base::StringPiece& spec) { | 547 bool operator==(const GURL& x, const base::StringPiece& spec) { |
| 548 DCHECK_EQ(GURL(spec).possibly_invalid_spec(), spec); | 548 DCHECK_EQ(GURL(spec).possibly_invalid_spec(), spec); |
| 549 return x.possibly_invalid_spec() == spec; | 549 return x.possibly_invalid_spec() == spec; |
| 550 } | 550 } |
| 551 | 551 |
| 552 bool operator!=(const GURL& x, const base::StringPiece& spec) { | 552 bool operator!=(const GURL& x, const base::StringPiece& spec) { |
| 553 return !(x == spec); | 553 return !(x == spec); |
| 554 } | 554 } |
| OLD | NEW |