From a1ea4276f87f945dfe922f7c37c08f2d203e4e59 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Tue, 19 Jun 2018 14:37:12 +0000 Subject: fxcrt::{Byte,Wide}String missing move-assign operator This hasn't been a big deal, since no data is copied, but avoids some ref-count churn in the process. Change-Id: I53c059284aa6806793c59a0c19b3e0d7fe4191d6 Reviewed-on: https://pdfium-review.googlesource.com/35350 Commit-Queue: dsinclair Reviewed-by: dsinclair --- core/fxcrt/bytestring.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'core/fxcrt/bytestring.h') diff --git a/core/fxcrt/bytestring.h b/core/fxcrt/bytestring.h index 99b87b1d4c..5722c4925d 100644 --- a/core/fxcrt/bytestring.h +++ b/core/fxcrt/bytestring.h @@ -21,6 +21,7 @@ namespace fxcrt { +class ByteString_Assign_Test; class ByteString_Concat_Test; class StringPool_ByteString_Test; class WideString; @@ -133,7 +134,8 @@ class ByteString { const ByteString& operator=(const char* str); const ByteString& operator=(const ByteStringView& bstrc); - const ByteString& operator=(const ByteString& stringSrc); + const ByteString& operator=(const ByteString& that); + const ByteString& operator=(ByteString&& that); const ByteString& operator+=(char ch); const ByteString& operator+=(const char* str); @@ -209,9 +211,11 @@ class ByteString { void AllocCopy(ByteString& dest, size_t nCopyLen, size_t nCopyIndex) const; void AssignCopy(const char* pSrcData, size_t nSrcLen); void Concat(const char* lpszSrcData, size_t nSrcLen); + intptr_t ReferenceCountForTesting() const; RetainPtr m_pData; + friend ByteString_Assign_Test; friend ByteString_Concat_Test; friend class StringPool_ByteString_Test; }; -- cgit v1.2.3