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

Unified Diff: url/origin.cc

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 | « url/origin.h ('k') | url/scheme_host_port.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/origin.cc
diff --git a/url/origin.cc b/url/origin.cc
index f31d38ababa08e57e89ec9a219f7a2676e9e80a3..473c0d95f14ed542652af9373f94448ef2b1a262 100644
--- a/url/origin.cc
+++ b/url/origin.cc
@@ -39,8 +39,11 @@ Origin::Origin(const GURL& url) : unique_(true) {
unique_ = tuple_.IsInvalid();
}
-Origin::Origin(base::StringPiece scheme, base::StringPiece host, uint16_t port)
- : tuple_(scheme, host, port) {
+Origin::Origin(base::StringPiece scheme,
+ base::StringPiece host,
+ uint16_t port,
+ SchemeHostPort::ConstructPolicy policy)
+ : tuple_(scheme, host, port, policy) {
unique_ = tuple_.IsInvalid();
}
@@ -52,7 +55,13 @@ Origin Origin::UnsafelyCreateOriginWithoutNormalization(
base::StringPiece scheme,
base::StringPiece host,
uint16_t port) {
- return Origin(scheme, host, port);
+ return Origin(scheme, host, port, SchemeHostPort::CHECK_CANONICALIZATION);
+}
+
+Origin Origin::CreateFromNormalizedTuple(base::StringPiece scheme,
+ base::StringPiece host,
+ uint16_t port) {
+ return Origin(scheme, host, port, SchemeHostPort::ALREADY_CANONICALIZED);
}
std::string Origin::Serialize() const {
« no previous file with comments | « url/origin.h ('k') | url/scheme_host_port.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698