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

Unified Diff: Source/platform/weborigin/KURL.cpp

Issue 297223005: Add a move constructor and move assignment operator to KURL (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add FIXME comment Created 6 years, 7 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 | « Source/platform/weborigin/KURL.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/weborigin/KURL.cpp
diff --git a/Source/platform/weborigin/KURL.cpp b/Source/platform/weborigin/KURL.cpp
index 7189f73fac8d9cdac03f98bcabbc9d52cfe82b29..ffb63dd0cd958fa762e182ada2e0697e020f91db 100644
--- a/Source/platform/weborigin/KURL.cpp
+++ b/Source/platform/weborigin/KURL.cpp
@@ -255,6 +255,31 @@ KURL& KURL::operator=(const KURL& other)
return *this;
}
+#if COMPILER_SUPPORTS(CXX_RVALUE_REFERENCES)
+KURL::KURL(KURL&& other)
+ : m_isValid(other.m_isValid)
+ , m_protocolIsInHTTPFamily(other.m_protocolIsInHTTPFamily)
+ , m_parsed(other.m_parsed)
+ // FIXME: Instead of explicitly casting to String&& here, we should use std::move, but that requires us to
+ // have a standard library that supports move semantics.
+ , m_string(static_cast<String&&>(other.m_string))
+ , m_innerURL(other.m_innerURL.release())
+{
+}
+
+KURL& KURL::operator=(KURL&& other)
+{
+ m_isValid = other.m_isValid;
+ m_protocolIsInHTTPFamily = other.m_protocolIsInHTTPFamily;
+ m_parsed = other.m_parsed;
+ // FIXME: Instead of explicitly casting to String&& here, we should use std::move, but that requires us to
+ // have a standard library that supports move semantics.
+ m_string = static_cast<String&&>(other.m_string);
+ m_innerURL = other.m_innerURL.release();
+ return *this;
+}
+#endif
+
KURL KURL::copy() const
{
KURL result;
« no previous file with comments | « Source/platform/weborigin/KURL.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698