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

Unified Diff: url/scheme_host_port.h

Issue 2378323003: Add url::Origin::GetURL() to convert Origins to URLs without reparsing (Closed)
Patch Set: revert the file:/// changes Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « url/origin_unittest.cc ('k') | url/scheme_host_port.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/scheme_host_port.h
diff --git a/url/scheme_host_port.h b/url/scheme_host_port.h
index 47a9041e2afd8e1db1b92654b0d72cfddef9bdd4..dc8862aab6f776b60beaec21d185b690a8f03f2f 100644
--- a/url/scheme_host_port.h
+++ b/url/scheme_host_port.h
@@ -16,6 +16,8 @@ class GURL;
namespace url {
+struct Parsed;
+
// This class represents a (scheme, host, port) tuple extracted from a URL.
//
// The primary purpose of this class is to represent relevant network-authority
@@ -111,6 +113,10 @@ class URL_EXPORT SchemeHostPort {
// serialized as a unique Origin.
std::string Serialize() const;
+ // Efficiently returns what GURL(Serialize()) would return, without needing to
+ // re-parse the URL.
+ GURL GetURL() const;
+
// Two SchemeHostPort objects are "equal" iff their schemes, hosts, and ports
// are exact matches.
//
@@ -124,6 +130,8 @@ class URL_EXPORT SchemeHostPort {
bool operator<(const SchemeHostPort& other) const;
private:
+ std::string SerializeInternal(url::Parsed* parsed) const;
+
std::string scheme_;
std::string host_;
uint16_t port_;
« no previous file with comments | « url/origin_unittest.cc ('k') | url/scheme_host_port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698