Index: url/gurl.h |
diff --git a/url/gurl.h b/url/gurl.h |
index cdff0fd146bb814105602ea4f4dd16439c842129..dae87ff630ab243fe8f37d8246074836a850b96c 100644 |
--- a/url/gurl.h |
+++ b/url/gurl.h |
@@ -46,13 +46,17 @@ class URL_EXPORT GURL { |
size_t canonical_spec_len, |
const url::Parsed& parsed, |
bool is_valid); |
- // Notice that we take the canonical_spec by value so that we can convert |
- // from WebURL without copying the string. When we call this constructor |
- // we pass in a temporary std::string, which lets the compiler skip the |
- // copy and just move the std::string into the function argument. In the |
- // implementation, we use swap to move the data into the GURL itself, |
- // which means we end up with zero copies. |
- GURL(std::string canonical_spec, const url::Parsed& parsed, bool is_valid); |
+ |
+ // Notice that we can take the canonical_spec by rvalue reference so that we |
+ // can convert from WebURL without copying the string. When we call this |
ki.stfu
2015/09/21 05:55:55
(the original message is here: https://codereview.
|
+ // constructor we pass in a temporary std::string, which lets the compiler |
+ // skip the copy and just move the std::string into the function argument. |
+ // The const reference version is used in unittests. |
+ GURL(const std::string& canonical_spec, |
+ const url::Parsed& parsed, |
+ bool is_valid); |
+ GURL(std::string&& canonical_spec, const url::Parsed& parsed, |
danakj
2016/04/29 02:17:54
According to the google style guide the way to wri
ki.stfu
2016/05/25 16:53:33
I can't find a mention about this way in style gui
danakj
2016/05/25 19:59:37
https://google.github.io/styleguide/cppguide.html#
ki.stfu
2016/05/26 05:15:30
Doesn't it look like a moving "for perfect forward
|
+ bool is_valid) noexcept; |
~GURL(); |