Changeset 170055 in webkit
- Timestamp:
- Jun 17, 2014, 9:16:38 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r169999 r170055 1 2014-06-17 Dan Bernstein <mitz@apple.com> 2 3 String::isolatedCopy doesn’t return an isolated copy when used on an rvalue reference 4 https://bugs.webkit.org/show_bug.cgi?id=133968 5 6 Reviewed by Anders Carlsson. 7 8 Made the rvalue reference overload of isolatedCopy() non-const, so that std::move(*this) is 9 an rvalue reference that can be moved, rather than copied, into the returned String. 10 11 * wtf/text/WTFString.cpp: 12 (WTF::String::isolatedCopy): 13 * wtf/text/WTFString.h: 14 1 15 2014-06-15 Dan Bernstein <mitz@apple.com> 2 16 -
trunk/Source/WTF/wtf/text/WTFString.cpp
r169358 r170055 689 689 } 690 690 691 String String::isolatedCopy() const&&691 String String::isolatedCopy() && 692 692 { 693 693 if (isSafeToSendToAnotherThread()) { -
trunk/Source/WTF/wtf/text/WTFString.h
r169731 r170055 374 374 #if COMPILER_SUPPORTS(CXX_REFERENCE_QUALIFIED_FUNCTIONS) 375 375 WTF_EXPORT_STRING_API String isolatedCopy() const &; 376 WTF_EXPORT_STRING_API String isolatedCopy() const&&;376 WTF_EXPORT_STRING_API String isolatedCopy() &&; 377 377 #else 378 378 WTF_EXPORT_STRING_API String isolatedCopy() const; -
trunk/Tools/ChangeLog
r170054 r170055 1 2014-06-17 Dan Bernstein <mitz@apple.com> 2 3 String::isolatedCopy doesn’t return an isolated copy when used on an rvalue reference 4 https://bugs.webkit.org/show_bug.cgi?id=133968 5 6 Reviewed by Anders Carlsson. 7 8 * TestWebKitAPI/Tests/WTF/WTFString.cpp: 9 (TestWebKitAPI::TEST): Added a test that an isolated copy of an rvalue reference doesn’t 10 share an impl() with the original. 11 1 12 2014-06-17 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp
r152201 r170055 154 154 } 155 155 156 TEST(WTF, StringIsolatedCopy) 157 { 158 String original = "1234"; 159 auto copy = std::move(original).isolatedCopy(); 160 ASSERT_FALSE(original.impl() == copy.impl()); 161 } 156 162 157 163 } // namespace TestWebKitAPI
Note:
See TracChangeset
for help on using the changeset viewer.