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

Unified Diff: url/origin.h

Issue 2391383003: Add Origin::CreateFromNormalizedTuple and call from WebSecurityOrigin (Closed)
Patch Set: git cl format 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 | « third_party/WebKit/public/platform/WebSecurityOrigin.h ('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 273622edc8a0624901af12e2a8eac3d6e5a96b8c..89d81da5820823c94b42ef2ac26fc061bc95c0fb 100644
--- a/url/origin.h
+++ b/url/origin.h
@@ -90,8 +90,8 @@ class URL_EXPORT Origin {
explicit Origin(const GURL& url);
// Creates an Origin from a |scheme|, |host|, and |port|. All the parameters
- // must be valid and canonicalized. In particular, note that this cannot be
- // used to create unique origins; 'url::Origin()' is the right way to do that.
+ // must be valid and canonicalized. Do not use this method to create unique
+ // origins. Use Origin() for that.
//
// This constructor should be used in order to pass 'Origin' objects back and
// forth over IPC (as transitioning through GURL would risk potentially
@@ -102,6 +102,13 @@ class URL_EXPORT Origin {
base::StringPiece host,
uint16_t port);
+ // Creates an origin without sanity checking that the host is canonicalized.
+ // This should only be used when converting between already normalized types,
+ // and should NOT be used for IPC.
+ static Origin CreateFromNormalizedTuple(base::StringPiece scheme,
+ base::StringPiece host,
+ uint16_t port);
+
~Origin();
// For unique origins, these return ("", "", 0).
@@ -138,7 +145,10 @@ class URL_EXPORT Origin {
bool operator<(const Origin& other) const;
private:
- Origin(base::StringPiece scheme, base::StringPiece host, uint16_t port);
+ Origin(base::StringPiece scheme,
+ base::StringPiece host,
+ uint16_t port,
+ SchemeHostPort::ConstructPolicy policy);
SchemeHostPort tuple_;
bool unique_;
« no previous file with comments | « third_party/WebKit/public/platform/WebSecurityOrigin.h ('k') | url/origin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698