Chromium Code Reviews| Index: url/origin.h |
| diff --git a/url/origin.h b/url/origin.h |
| index aab1f05a2013cc84cd4aedbb91a9e10b0df88307..8294513112a245ca211bad891c2f9a06d16eba57 100644 |
| --- a/url/origin.h |
| +++ b/url/origin.h |
| @@ -89,6 +89,9 @@ class URL_EXPORT Origin { |
| // 3. 'file' URLs all parse as ("file", "", 0). |
| explicit Origin(const GURL& url); |
| + // A convenience: Origin(GURL(url_string)). |
| + explicit Origin(const std::string& url_string); |
| + |
| // Creates an Origin from a |scheme|, |host|, and |port|. All the parameters |
| // must be valid and canonicalized. In particular, note that this cannot be |
| // used to create unique origins; 'url::Origin()' is the right way to do that. |
| @@ -110,6 +113,7 @@ class URL_EXPORT Origin { |
| uint16_t port() const { return tuple_.port(); } |
| bool unique() const { return unique_; } |
| + bool is_empty() const { return empty_; } |
|
Mike West
2016/03/03 09:20:02
If we're going to distinguish between unique origi
palmer
2016/03/03 21:32:56
Done.
|
| // An ASCII serialization of the Origin as per Section 6.2 of RFC 6454, with |
| // the addition that all Origins with a 'file' scheme serialize to "file://". |
| @@ -131,6 +135,7 @@ class URL_EXPORT Origin { |
| SchemeHostPort tuple_; |
| bool unique_; |
| + bool empty_; |
| }; |
| URL_EXPORT std::ostream& operator<<(std::ostream& out, const Origin& origin); |