Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: url/scheme_host_port.h

Issue 1229003007: Constify SchemeHostPort and Origin accessors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1224293002
Patch Set: Rebase. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « url/origin.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « url/origin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698