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 #ifndef URL_GURL_H_ | 5 #ifndef URL_GURL_H_ |
6 #define URL_GURL_H_ | 6 #define URL_GURL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <iosfwd> | 10 #include <iosfwd> |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 // the given input string. For example, if the hostname of the URL is | 378 // the given input string. For example, if the hostname of the URL is |
379 // "www.google.com", this will return true for "com", "google.com", and | 379 // "www.google.com", this will return true for "com", "google.com", and |
380 // "www.google.com". | 380 // "www.google.com". |
381 // | 381 // |
382 // The input domain should be lower-case ASCII to match the canonicalized | 382 // The input domain should be lower-case ASCII to match the canonicalized |
383 // scheme. This call is more efficient than getting the host and check | 383 // scheme. This call is more efficient than getting the host and check |
384 // whether host has the specific domain or not because no copies or | 384 // whether host has the specific domain or not because no copies or |
385 // object constructions are done. | 385 // object constructions are done. |
386 bool DomainIs(base::StringPiece lower_ascii_domain) const; | 386 bool DomainIs(base::StringPiece lower_ascii_domain) const; |
387 | 387 |
| 388 // Checks whether or not two URLs are differing only in the ref (the part |
| 389 // after the # character). |
| 390 bool EqualsIgnoringRef(const GURL& other) const; |
| 391 |
388 // Swaps the contents of this GURL object with |other|, without doing | 392 // Swaps the contents of this GURL object with |other|, without doing |
389 // any memory allocations. | 393 // any memory allocations. |
390 void Swap(GURL* other); | 394 void Swap(GURL* other); |
391 | 395 |
392 // Returns a reference to a singleton empty GURL. This object is for callers | 396 // Returns a reference to a singleton empty GURL. This object is for callers |
393 // who return references but don't have anything to return in some cases. | 397 // who return references but don't have anything to return in some cases. |
394 // If you just want an empty URL for normal use, prefer GURL(). This function | 398 // If you just want an empty URL for normal use, prefer GURL(). This function |
395 // may be called from any thread. | 399 // may be called from any thread. |
396 static const GURL& EmptyGURL(); | 400 static const GURL& EmptyGURL(); |
397 | 401 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 URL_EXPORT bool operator==(const GURL& x, const GURL& y); | 461 URL_EXPORT bool operator==(const GURL& x, const GURL& y); |
458 URL_EXPORT bool operator!=(const GURL& x, const GURL& y); | 462 URL_EXPORT bool operator!=(const GURL& x, const GURL& y); |
459 | 463 |
460 // Equality operator for comparing raw spec_. This should be used in place of | 464 // Equality operator for comparing raw spec_. This should be used in place of |
461 // url == GURL(spec) where |spec| is known (i.e. constants). This is to prevent | 465 // url == GURL(spec) where |spec| is known (i.e. constants). This is to prevent |
462 // needlessly re-parsing |spec| into a temporary GURL. | 466 // needlessly re-parsing |spec| into a temporary GURL. |
463 URL_EXPORT bool operator==(const GURL& x, const base::StringPiece& spec); | 467 URL_EXPORT bool operator==(const GURL& x, const base::StringPiece& spec); |
464 URL_EXPORT bool operator!=(const GURL& x, const base::StringPiece& spec); | 468 URL_EXPORT bool operator!=(const GURL& x, const base::StringPiece& spec); |
465 | 469 |
466 #endif // URL_GURL_H_ | 470 #endif // URL_GURL_H_ |
OLD | NEW |