| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SCHEME_HOST_PORT_H_ | 5 #ifndef URL_SCHEME_HOST_PORT_H_ |
| 6 #define URL_SCHEME_HOST_PORT_H_ | 6 #define URL_SCHEME_HOST_PORT_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // | 89 // |
| 90 // If |url| is invalid or non-standard, the result will be an invalid | 90 // If |url| is invalid or non-standard, the result will be an invalid |
| 91 // SchemeHostPort object. | 91 // SchemeHostPort object. |
| 92 explicit SchemeHostPort(const GURL& url); | 92 explicit SchemeHostPort(const GURL& url); |
| 93 | 93 |
| 94 ~SchemeHostPort(); | 94 ~SchemeHostPort(); |
| 95 | 95 |
| 96 // Returns the host component, in URL form. That is all IDN domain names will | 96 // Returns the host component, in URL form. That is all IDN domain names will |
| 97 // be expressed as A-Labels ('☃.net' will be returned as 'xn--n3h.net'), and | 97 // be expressed as A-Labels ('☃.net' will be returned as 'xn--n3h.net'), and |
| 98 // and all IPv6 addresses will be enclosed in brackets ("[2001:db8::1]"). | 98 // and all IPv6 addresses will be enclosed in brackets ("[2001:db8::1]"). |
| 99 std::string host() const { return host_; } | 99 const std::string& host() const { return host_; } |
| 100 std::string scheme() const { return scheme_; } | 100 const std::string& scheme() const { return scheme_; } |
| 101 uint16 port() const { return port_; } | 101 uint16 port() const { return port_; } |
| 102 bool IsInvalid() const; | 102 bool IsInvalid() const; |
| 103 | 103 |
| 104 // Serializes the SchemeHostPort tuple to a canonical form. | 104 // Serializes the SchemeHostPort tuple to a canonical form. |
| 105 // | 105 // |
| 106 // While this string form resembles the Origin serialization specified in | 106 // While this string form resembles the Origin serialization specified in |
| 107 // Section 6.2 of RFC 6454, it is important to note that invalid | 107 // Section 6.2 of RFC 6454, it is important to note that invalid |
| 108 // SchemeHostPort tuples serialize to the empty string, rather than being | 108 // SchemeHostPort tuples serialize to the empty string, rather than being |
| 109 // serialized as a unique Origin. | 109 // serialized as a unique Origin. |
| 110 std::string Serialize() const; | 110 std::string Serialize() const; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 std::string scheme_; | 125 std::string scheme_; |
| 126 std::string host_; | 126 std::string host_; |
| 127 uint16 port_; | 127 uint16 port_; |
| 128 }; | 128 }; |
| 129 | 129 |
| 130 } // namespace url | 130 } // namespace url |
| 131 | 131 |
| 132 #endif // URL_SCHEME_HOST_PORT_H_ | 132 #endif // URL_SCHEME_HOST_PORT_H_ |
| OLD | NEW |