| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 void Swap(GURL* other); | 387 void Swap(GURL* other); |
| 388 | 388 |
| 389 // Returns a reference to a singleton empty GURL. This object is for callers | 389 // Returns a reference to a singleton empty GURL. This object is for callers |
| 390 // who return references but don't have anything to return in some cases. | 390 // who return references but don't have anything to return in some cases. |
| 391 // If you just want an empty URL for normal use, prefer GURL(). This function | 391 // If you just want an empty URL for normal use, prefer GURL(). This function |
| 392 // may be called from any thread. | 392 // may be called from any thread. |
| 393 static const GURL& EmptyGURL(); | 393 static const GURL& EmptyGURL(); |
| 394 | 394 |
| 395 // Returns the inner URL of a nested URL (currently only non-null for | 395 // Returns the inner URL of a nested URL (currently only non-null for |
| 396 // filesystem URLs). | 396 // filesystem URLs). |
| 397 // |
| 398 // TODO(mmenke): inner_url().spec() currently returns the same value as |
| 399 // caling spec() on the GURL itself. This should be fixed. |
| 400 // See https://crbug.com/619596 |
| 397 const GURL* inner_url() const { | 401 const GURL* inner_url() const { |
| 398 return inner_url_.get(); | 402 return inner_url_.get(); |
| 399 } | 403 } |
| 400 | 404 |
| 401 private: | 405 private: |
| 402 // Variant of the string parsing constructor that allows the caller to elect | 406 // Variant of the string parsing constructor that allows the caller to elect |
| 403 // retain trailing whitespace, if any, on the passed URL spec, but only if | 407 // retain trailing whitespace, if any, on the passed URL spec, but only if |
| 404 // the scheme is one that allows trailing whitespace. The primary use-case is | 408 // the scheme is one that allows trailing whitespace. The primary use-case is |
| 405 // for data: URLs. In most cases, you want to use the single parameter | 409 // for data: URLs. In most cases, you want to use the single parameter |
| 406 // constructor above. | 410 // constructor above. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 437 url::Parsed parsed_; | 441 url::Parsed parsed_; |
| 438 | 442 |
| 439 // Used for nested schemes [currently only filesystem:]. | 443 // Used for nested schemes [currently only filesystem:]. |
| 440 std::unique_ptr<GURL> inner_url_; | 444 std::unique_ptr<GURL> inner_url_; |
| 441 }; | 445 }; |
| 442 | 446 |
| 443 // Stream operator so GURL can be used in assertion statements. | 447 // Stream operator so GURL can be used in assertion statements. |
| 444 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 448 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
| 445 | 449 |
| 446 #endif // URL_GURL_H_ | 450 #endif // URL_GURL_H_ |
| OLD | NEW |