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

Unified Diff: url/origin.h

Issue 2561363002: Add std::string constructors for Origin/SchemeHostPort to reduce copies (Closed)
Patch Set: fix content_unittests Created 4 years 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/child/blink_platform_impl_unittest.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 1c28588f311249478f70d01978b76e6f15ff2e18..4b838e420f3ffac5d280d70204030a6d9b84844c 100644
--- a/url/origin.h
+++ b/url/origin.h
@@ -104,18 +104,13 @@ class URL_EXPORT Origin {
// 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);
-
- // Same as CreateFromNormalizedTuple() above, but adds a suborigin component
- // as well.
+ // and should NOT be used for IPC. Method takes std::strings for use with move
+ // operators to avoid copies.
static Origin CreateFromNormalizedTupleWithSuborigin(
- base::StringPiece scheme,
- base::StringPiece host,
+ std::string scheme,
+ std::string host,
uint16_t port,
- base::StringPiece suborigin);
+ std::string suborigin);
~Origin();
@@ -173,6 +168,11 @@ class URL_EXPORT Origin {
uint16_t port,
base::StringPiece suborigin,
SchemeHostPort::ConstructPolicy policy);
+ Origin(std::string scheme,
+ std::string host,
+ uint16_t port,
+ std::string suborigin,
+ SchemeHostPort::ConstructPolicy policy);
SchemeHostPort tuple_;
bool unique_;
« no previous file with comments | « content/child/blink_platform_impl_unittest.cc ('k') | url/origin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698