| 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 <iosfwd> | 8 #include <iosfwd> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 // who return references but don't have anything to return in some cases. | 355 // who return references but don't have anything to return in some cases. |
| 356 // This function may be called from any thread. | 356 // This function may be called from any thread. |
| 357 static const GURL& EmptyGURL(); | 357 static const GURL& EmptyGURL(); |
| 358 | 358 |
| 359 // Returns the inner URL of a nested URL [currently only non-null for | 359 // Returns the inner URL of a nested URL [currently only non-null for |
| 360 // filesystem: URLs]. | 360 // filesystem: URLs]. |
| 361 const GURL* inner_url() const { | 361 const GURL* inner_url() const { |
| 362 return inner_url_.get(); | 362 return inner_url_.get(); |
| 363 } | 363 } |
| 364 | 364 |
| 365 // Returns approximate size of the memory taken by the instance. |
| 366 size_t Bytesize() const; |
| 367 |
| 365 private: | 368 private: |
| 366 // Variant of the string parsing constructor that allows the caller to elect | 369 // Variant of the string parsing constructor that allows the caller to elect |
| 367 // retain trailing whitespace, if any, on the passed URL spec but only if the | 370 // retain trailing whitespace, if any, on the passed URL spec but only if the |
| 368 // scheme is one that allows trailing whitespace. The primary use-case is | 371 // scheme is one that allows trailing whitespace. The primary use-case is |
| 369 // for data: URLs. In most cases, you want to use the single parameter | 372 // for data: URLs. In most cases, you want to use the single parameter |
| 370 // constructor above. | 373 // constructor above. |
| 371 enum RetainWhiteSpaceSelector { RETAIN_TRAILING_PATH_WHITEPACE }; | 374 enum RetainWhiteSpaceSelector { RETAIN_TRAILING_PATH_WHITEPACE }; |
| 372 GURL(const std::string& url_string, RetainWhiteSpaceSelector); | 375 GURL(const std::string& url_string, RetainWhiteSpaceSelector); |
| 373 | 376 |
| 374 template<typename STR> | 377 template<typename STR> |
| (...skipping 22 matching lines...) Expand all Loading... |
| 397 // Used for nested schemes [currently only filesystem:]. | 400 // Used for nested schemes [currently only filesystem:]. |
| 398 scoped_ptr<GURL> inner_url_; | 401 scoped_ptr<GURL> inner_url_; |
| 399 | 402 |
| 400 // TODO bug 684583: Add encoding for query params. | 403 // TODO bug 684583: Add encoding for query params. |
| 401 }; | 404 }; |
| 402 | 405 |
| 403 // Stream operator so GURL can be used in assertion statements. | 406 // Stream operator so GURL can be used in assertion statements. |
| 404 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 407 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
| 405 | 408 |
| 406 #endif // URL_GURL_H_ | 409 #endif // URL_GURL_H_ |
| OLD | NEW |