diff options
-rw-r--r-- | url/origin.h | 7 | ||||
-rw-r--r-- | url/scheme_host_port.h | 4 |
2 files changed, 4 insertions, 7 deletions
diff --git a/url/origin.h b/url/origin.h index 15fe0ea..01703ef 100644 --- a/url/origin.h +++ b/url/origin.h @@ -89,11 +89,8 @@ class URL_EXPORT Origin { ~Origin(); // For unique origins, these return ("", "", 0). - // - // TODO(mkwst): These should be 'const std::string&', along with their - // 'url::SchemeHostPort' analogs. - std::string scheme() const { return tuple_.scheme(); } - std::string host() const { return tuple_.host(); } + const std::string& scheme() const { return tuple_.scheme(); } + const std::string& host() const { return tuple_.host(); } uint16 port() const { return tuple_.port(); } bool unique() const { return unique_; } diff --git a/url/scheme_host_port.h b/url/scheme_host_port.h index 227c1f1..2cc9e07 100644 --- a/url/scheme_host_port.h +++ b/url/scheme_host_port.h @@ -96,8 +96,8 @@ class URL_EXPORT SchemeHostPort { // Returns the host component, in URL form. That is all IDN domain names will // be expressed as A-Labels ('☃.net' will be returned as 'xn--n3h.net'), and // and all IPv6 addresses will be enclosed in brackets ("[2001:db8::1]"). - std::string host() const { return host_; } - std::string scheme() const { return scheme_; } + const std::string& host() const { return host_; } + const std::string& scheme() const { return scheme_; } uint16 port() const { return port_; } bool IsInvalid() const; |