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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 const std::string& GURL::spec() const { | 172 const std::string& GURL::spec() const { |
173 if (is_valid_ || spec_.empty()) | 173 if (is_valid_ || spec_.empty()) |
174 return spec_; | 174 return spec_; |
175 | 175 |
176 DCHECK(false) << "Trying to get the spec of an invalid URL!"; | 176 DCHECK(false) << "Trying to get the spec of an invalid URL!"; |
177 return EmptyStringForGURL(); | 177 return EmptyStringForGURL(); |
178 } | 178 } |
179 | 179 |
| 180 bool GURL::operator==(const GURL& other) const { |
| 181 return spec_ == other.spec_; |
| 182 } |
| 183 |
| 184 bool GURL::operator!=(const GURL& other) const { |
| 185 return spec_ != other.spec_; |
| 186 } |
| 187 |
| 188 bool GURL::operator<(const GURL& other) const { |
| 189 return spec_ < other.spec_; |
| 190 } |
| 191 |
| 192 bool GURL::operator>(const GURL& other) const { |
| 193 return spec_ > other.spec_; |
| 194 } |
| 195 |
180 GURL GURL::Resolve(const std::string& relative) const { | 196 GURL GURL::Resolve(const std::string& relative) const { |
181 return ResolveWithCharsetConverter(relative, NULL); | 197 return ResolveWithCharsetConverter(relative, NULL); |
182 } | 198 } |
183 GURL GURL::Resolve(const base::string16& relative) const { | 199 GURL GURL::Resolve(const base::string16& relative) const { |
184 return ResolveWithCharsetConverter(relative, NULL); | 200 return ResolveWithCharsetConverter(relative, NULL); |
185 } | 201 } |
186 | 202 |
187 // Note: code duplicated below (it's inconvenient to use a template here). | 203 // Note: code duplicated below (it's inconvenient to use a template here). |
188 GURL GURL::ResolveWithCharsetConverter( | 204 GURL GURL::ResolveWithCharsetConverter( |
189 const std::string& relative, | 205 const std::string& relative, |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 void GURL::Swap(GURL* other) { | 540 void GURL::Swap(GURL* other) { |
525 spec_.swap(other->spec_); | 541 spec_.swap(other->spec_); |
526 std::swap(is_valid_, other->is_valid_); | 542 std::swap(is_valid_, other->is_valid_); |
527 std::swap(parsed_, other->parsed_); | 543 std::swap(parsed_, other->parsed_); |
528 inner_url_.swap(other->inner_url_); | 544 inner_url_.swap(other->inner_url_); |
529 } | 545 } |
530 | 546 |
531 std::ostream& operator<<(std::ostream& out, const GURL& url) { | 547 std::ostream& operator<<(std::ostream& out, const GURL& url) { |
532 return out << url.possibly_invalid_spec(); | 548 return out << url.possibly_invalid_spec(); |
533 } | 549 } |
OLD | NEW |