diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-06-19 14:37:12 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-19 14:37:12 +0000 |
commit | a1ea4276f87f945dfe922f7c37c08f2d203e4e59 (patch) | |
tree | 125f9e604c64f1bd38f8ff44d8784b062f0245c4 /core/fxcrt/widestring.h | |
parent | ee3e3a4f3cbaa99ae3609f575ff9b2c329c5df2a (diff) | |
download | pdfium-a1ea4276f87f945dfe922f7c37c08f2d203e4e59.tar.xz |
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 <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/widestring.h')
-rw-r--r-- | core/fxcrt/widestring.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h index 4b097c4430..b531292c57 100644 --- a/core/fxcrt/widestring.h +++ b/core/fxcrt/widestring.h @@ -23,6 +23,7 @@ namespace fxcrt { class ByteString; class StringPool_WideString_Test; +class WideString_Assign_Test; class WideString_ConcatInPlace_Test; // A mutable string with shared buffers using copy-on-write semantics that @@ -111,8 +112,9 @@ class WideString { bool IsValidLength(size_t length) const { return length <= GetLength(); } const WideString& operator=(const wchar_t* str); - const WideString& operator=(const WideString& stringSrc); const WideString& operator=(const WideStringView& stringSrc); + const WideString& operator=(const WideString& that); + const WideString& operator=(WideString&& that); const WideString& operator+=(const wchar_t* str); const WideString& operator+=(wchar_t ch); @@ -208,10 +210,12 @@ class WideString { void AllocCopy(WideString& dest, size_t nCopyLen, size_t nCopyIndex) const; void AssignCopy(const wchar_t* pSrcData, size_t nSrcLen); void Concat(const wchar_t* lpszSrcData, size_t nSrcLen); + intptr_t ReferenceCountForTesting() const; RetainPtr<StringData> m_pData; friend WideString_ConcatInPlace_Test; + friend WideString_Assign_Test; friend StringPool_WideString_Test; }; |