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

Unified Diff: url/origin.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 | « content/renderer/render_frame_impl.cc ('k') | url/origin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/origin.h
diff --git a/url/origin.h b/url/origin.h
index 9ac777949a4c1922b8e91e97cc2b2f898fb31858..273622edc8a0624901af12e2a8eac3d6e5a96b8c 100644
--- a/url/origin.h
+++ b/url/origin.h
@@ -122,6 +122,14 @@ class URL_EXPORT Origin {
return IsSameOriginWith(other);
}
+ // Efficiently returns what GURL(Serialize()) would without re-parsing the
+ // URL. This can be used for the (rare) times a GURL representation is needed
+ // for an Origin.
+ // Note: The returned URL will not necessarily be serialized to the same value
+ // as the Origin would. The GURL will have an added "/" path for Origins with
+ // valid SchemeHostPorts and file Origins.
+ GURL GetURL() const;
+
// Same as GURL::DomainIs. If |this| origin is unique, then returns false.
bool DomainIs(base::StringPiece lower_ascii_domain) const;
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | url/origin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698