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

Side by Side Diff: url/gurl.h

Issue 23549039: Preparing to support fragment resolution against non-hierarchical schemes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: checking is valid Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 bool SchemeIsFileSystem() const { 216 bool SchemeIsFileSystem() const {
217 return SchemeIs("filesystem"); 217 return SchemeIs("filesystem");
218 } 218 }
219 219
220 // If the scheme indicates a secure connection 220 // If the scheme indicates a secure connection
221 bool SchemeIsSecure() const { 221 bool SchemeIsSecure() const {
222 return SchemeIs("https") || SchemeIs("wss") || 222 return SchemeIs("https") || SchemeIs("wss") ||
223 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); 223 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure());
224 } 224 }
225 225
226 // The "content" or the URL is everything after the scheme (skipping the
227 // scheme delimiting colon). It is an error to get the origin of an invalid
228 // URL. The result will be an empty string.
229 std::string GetContent() const;
230
226 // Returns true if the hostname is an IP address. Note: this function isn't 231 // Returns true if the hostname is an IP address. Note: this function isn't
227 // as cheap as a simple getter because it re-parses the hostname to verify. 232 // as cheap as a simple getter because it re-parses the hostname to verify.
228 // This currently identifies only IPv4 addresses (bug 822685). 233 // This currently identifies only IPv4 addresses (bug 822685).
229 bool HostIsIPAddress() const; 234 bool HostIsIPAddress() const;
230 235
231 // Getters for various components of the URL. The returned string will be 236 // Getters for various components of the URL. The returned string will be
232 // empty if the component is empty or is not present. 237 // empty if the component is empty or is not present.
233 std::string scheme() const { // Not including the colon. See also SchemeIs. 238 std::string scheme() const { // Not including the colon. See also SchemeIs.
234 return ComponentString(parsed_.scheme); 239 return ComponentString(parsed_.scheme);
235 } 240 }
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 // Used for nested schemes [currently only filesystem:]. 374 // Used for nested schemes [currently only filesystem:].
370 GURL* inner_url_; 375 GURL* inner_url_;
371 376
372 // TODO bug 684583: Add encoding for query params. 377 // TODO bug 684583: Add encoding for query params.
373 }; 378 };
374 379
375 // Stream operator so GURL can be used in assertion statements. 380 // Stream operator so GURL can be used in assertion statements.
376 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); 381 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url);
377 382
378 #endif // URL_GURL_H_ 383 #endif // URL_GURL_H_
OLDNEW
« no previous file with comments | « content/browser/child_process_security_policy_impl.cc ('k') | url/gurl.cc » ('j') | url/gurl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698