Changeset 206196 in webkit
- Timestamp:
- Sep 20, 2016 8:10:57 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r206192 r206196 1 2016-09-20 Alex Christensen <achristensen@webkit.org> 2 3 Require WTFMove for String::adopt 4 https://bugs.webkit.org/show_bug.cgi?id=162313 5 6 Reviewed by Yusuke Suzuki. 7 8 * runtime/JSStringBuilder.h: 9 (JSC::JSStringBuilder::build): 10 1 11 2016-09-20 Joseph Pecoraro <pecoraro@apple.com> 2 12 -
trunk/Source/JavaScriptCore/runtime/JSStringBuilder.h
r205198 r206196 80 80 if (!buffer8.data()) 81 81 return throwOutOfMemoryError(exec, scope); 82 return jsString(exec, String::adopt( buffer8));82 return jsString(exec, String::adopt(WTFMove(buffer8))); 83 83 } 84 84 buffer16.shrinkToFit(); 85 85 if (!buffer16.data()) 86 86 return throwOutOfMemoryError(exec, scope); 87 return jsString(exec, String::adopt( buffer16));87 return jsString(exec, String::adopt(WTFMove(buffer16))); 88 88 } 89 89 -
trunk/Source/WTF/ChangeLog
r206154 r206196 1 2016-09-20 Alex Christensen <achristensen@webkit.org> 2 3 Require WTFMove for String::adopt 4 https://bugs.webkit.org/show_bug.cgi?id=162313 5 6 Reviewed by Yusuke Suzuki. 7 8 * wtf/text/StringImpl.cpp: 9 (WTF::StringImpl::removeCharacters): 10 (WTF::StringImpl::simplifyMatchedCharactersToSpace): 11 (WTF::StringImpl::adopt): 12 * wtf/text/StringImpl.h: 13 (WTF::StringImpl::adopt): 14 * wtf/text/WTFString.h: 15 (WTF::String::adopt): 16 1 17 2016-09-20 Filip Pizlo <fpizlo@apple.com> 2 18 -
trunk/Source/WTF/wtf/text/StringImpl.cpp
r204466 r206196 832 832 data.shrink(outc); 833 833 834 return adopt( data);834 return adopt(WTFMove(data)); 835 835 } 836 836 … … 876 876 data.shrink(outc); 877 877 878 return adopt( data);878 return adopt(WTFMove(data)); 879 879 } 880 880 … … 2003 2003 } 2004 2004 2005 Ref<StringImpl> StringImpl::adopt(StringBuffer<LChar>& buffer)2005 Ref<StringImpl> StringImpl::adopt(StringBuffer<LChar>&& buffer) 2006 2006 { 2007 2007 unsigned length = buffer.length(); … … 2011 2011 } 2012 2012 2013 Ref<StringImpl> StringImpl::adopt(StringBuffer<UChar>& buffer)2013 Ref<StringImpl> StringImpl::adopt(StringBuffer<UChar>&& buffer) 2014 2014 { 2015 2015 unsigned length = buffer.length(); -
trunk/Source/WTF/wtf/text/StringImpl.h
r205819 r206196 427 427 428 428 template<typename CharType, size_t inlineCapacity, typename OverflowHandler> 429 static Ref<StringImpl> adopt(Vector<CharType, inlineCapacity, OverflowHandler>& vector)429 static Ref<StringImpl> adopt(Vector<CharType, inlineCapacity, OverflowHandler>&& vector) 430 430 { 431 431 if (size_t size = vector.size()) { … … 438 438 } 439 439 440 WTF_EXPORT_STRING_API static Ref<StringImpl> adopt(StringBuffer<UChar>& );441 WTF_EXPORT_STRING_API static Ref<StringImpl> adopt(StringBuffer<LChar>& );440 WTF_EXPORT_STRING_API static Ref<StringImpl> adopt(StringBuffer<UChar>&&); 441 WTF_EXPORT_STRING_API static Ref<StringImpl> adopt(StringBuffer<LChar>&&); 442 442 443 443 unsigned length() const { return m_length; } -
trunk/Source/WTF/wtf/text/WTFString.h
r202506 r206196 139 139 void swap(String& o) { m_impl.swap(o.m_impl); } 140 140 141 static String adopt(StringBuffer<LChar>& buffer) { return StringImpl::adopt(buffer); }142 static String adopt(StringBuffer<UChar>& buffer) { return StringImpl::adopt(buffer); }141 static String adopt(StringBuffer<LChar>&& buffer) { return StringImpl::adopt(WTFMove(buffer)); } 142 static String adopt(StringBuffer<UChar>&& buffer) { return StringImpl::adopt(WTFMove(buffer)); } 143 143 template<typename CharacterType, size_t inlineCapacity, typename OverflowHandler> 144 static String adopt(Vector<CharacterType, inlineCapacity, OverflowHandler>& vector) { return StringImpl::adopt(vector); }144 static String adopt(Vector<CharacterType, inlineCapacity, OverflowHandler>&& vector) { return StringImpl::adopt(WTFMove(vector)); } 145 145 146 146 bool isNull() const { return !m_impl; } -
trunk/Source/WebCore/ChangeLog
r206193 r206196 1 2016-09-20 Alex Christensen <achristensen@webkit.org> 2 3 Require WTFMove for String::adopt 4 https://bugs.webkit.org/show_bug.cgi?id=162313 5 6 Reviewed by Yusuke Suzuki. 7 8 No change in behavior. This just makes it more clear what is going on when a String adopts a Vector. 9 10 * bindings/js/SerializedScriptValue.cpp: 11 (WebCore::CloneDeserializer::readString): 12 * css/parser/CSSParser.cpp: 13 (WebCore::quoteCSSStringInternal): 14 * dom/Document.cpp: 15 (WebCore::canonicalizedTitle): 16 * html/canvas/CanvasRenderingContext2D.cpp: 17 (WebCore::normalizeSpaces): 18 * html/parser/HTMLTreeBuilder.cpp: 19 (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace): 20 * platform/Length.cpp: 21 (WebCore::newCoordsArray): 22 * platform/URLParser.cpp: 23 (WebCore::URLParser::parse): 24 (WebCore::URLParser::serialize): 25 * platform/graphics/ca/GraphicsLayerCA.cpp: 26 (WebCore::GraphicsLayerCA::ReplicaState::cloneID): 27 * platform/text/TextCodecUTF16.cpp: 28 (WebCore::TextCodecUTF16::decode): 29 * platform/text/TextCodecUTF8.cpp: 30 (WebCore::TextCodecUTF8::decode): 31 * platform/text/mac/TextCodecMac.cpp: 32 (WebCore::TextCodecMac::decode): 33 1 34 2016-09-20 Jer Noble <jer.noble@apple.com> 2 35 -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r205654 r206196 1708 1708 buffer.append(ch); 1709 1709 } 1710 str = String::adopt( buffer);1710 str = String::adopt(WTFMove(buffer)); 1711 1711 #endif 1712 1712 return true; -
trunk/Source/WebCore/css/parser/CSSParser.cpp
r206181 r206196 13645 13645 13646 13646 ASSERT(quotedStringSize == index); 13647 return String::adopt( buffer);13647 return String::adopt(WTFMove(buffer)); 13648 13648 } 13649 13649 -
trunk/Source/WebCore/dom/Document.cpp
r206119 r206196 1575 1575 document->displayBufferModifiedByEncoding(buffer.characters(), buffer.length()); 1576 1576 1577 return StringWithDirection(String::adopt( buffer), titleWithDirection.direction());1577 return StringWithDirection(String::adopt(WTFMove(buffer)), titleWithDirection.direction()); 1578 1578 } 1579 1579 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r205892 r206196 2358 2358 charVector[i] = ' '; 2359 2359 } 2360 text = String::adopt( charVector);2360 text = String::adopt(WTFMove(charVector)); 2361 2361 } 2362 2362 -
trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp
r205858 r206196 220 220 return String(); 221 221 222 return String::adopt( whitespace);222 return String::adopt(WTFMove(whitespace)); 223 223 } 224 224 -
trunk/Source/WebCore/platform/Length.cpp
r206043 r206196 100 100 spacified[i] = cc; 101 101 } 102 RefPtr<StringImpl> str = StringImpl::adopt( spacified);102 RefPtr<StringImpl> str = StringImpl::adopt(WTFMove(spacified)); 103 103 104 104 str = str->simplifyWhiteSpace(); -
trunk/Source/WebCore/platform/URLParser.cpp
r206177 r206196 1600 1600 } 1601 1601 1602 if (m_unicodeFragmentBuffer.isEmpty()) {1603 // FIXME: String::adopt should require a WTFMove.1604 m_url.m_string = String::adopt(m_asciiBuffer);1605 } else {1602 if (m_unicodeFragmentBuffer.isEmpty()) 1603 m_url.m_string = String::adopt(WTFMove(m_asciiBuffer)); 1604 else { 1605 // FIXME: This should use a Vector<UChar> and adopt it. 1606 1606 StringBuilder builder; 1607 1607 builder.reserveCapacity(m_asciiBuffer.size() + m_unicodeFragmentBuffer.size()); … … 2213 2213 serializeURLEncodedForm(tuple.second, output); 2214 2214 } 2215 return String::adopt( output);2215 return String::adopt(WTFMove(output)); 2216 2216 } 2217 2217 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r205011 r206196 2571 2571 } 2572 2572 2573 return String::adopt( result);2573 return String::adopt(WTFMove(result)); 2574 2574 } 2575 2575 -
trunk/Source/WebCore/platform/text/LocaleICU.cpp
r201973 r206196 79 79 if (U_FAILURE(status)) 80 80 return String(); 81 return String::adopt( buffer);81 return String::adopt(WTFMove(buffer)); 82 82 } 83 83 … … 95 95 if (U_FAILURE(status)) 96 96 return String(); 97 return String::adopt( buffer);97 return String::adopt(WTFMove(buffer)); 98 98 } 99 99 #endif … … 159 159 if (U_FAILURE(status)) 160 160 return emptyString(); 161 return String::adopt( buffer);161 return String::adopt(WTFMove(buffer)); 162 162 } 163 163 … … 181 181 if (U_FAILURE(status)) 182 182 return std::make_unique<Vector<String>>(); 183 labels->append(String::adopt( buffer));183 labels->append(String::adopt(WTFMove(buffer))); 184 184 } 185 185 return WTFMove(labels); … … 271 271 udatpg_getBestPattern(patternGenerator, skeleton, skeletonLength, buffer.data(), length, &status); 272 272 if (U_SUCCESS(status)) 273 format = String::adopt( buffer);273 format = String::adopt(WTFMove(buffer)); 274 274 } 275 275 udatpg_close(patternGenerator); -
trunk/Source/WebCore/platform/text/TextCodecUTF16.cpp
r177280 r206196 112 112 buffer.shrink(q - buffer.characters()); 113 113 114 return String::adopt( buffer);114 return String::adopt(WTFMove(buffer)); 115 115 } 116 116 -
trunk/Source/WebCore/platform/text/TextCodecUTF8.cpp
r204605 r206196 344 344 buffer.shrink(destination - buffer.characters()); 345 345 346 return String::adopt( buffer);346 return String::adopt(WTFMove(buffer)); 347 347 348 348 upConvertTo16Bit: … … 420 420 buffer16.shrink(destination16 - buffer16.characters()); 421 421 422 return String::adopt( buffer16);422 return String::adopt(WTFMove(buffer16)); 423 423 } 424 424 -
trunk/Source/WebCore/platform/text/mac/TextCodecMac.cpp
r177280 r206196 265 265 } 266 266 267 String resultString = String::adopt( result);267 String resultString = String::adopt(WTFMove(result)); 268 268 269 269 // <rdar://problem/3225472> -
trunk/Source/WebCore/platform/win/FileSystemWin.cpp
r204466 r206196 191 191 buffer.shrink(wcslen(buffer.data())); 192 192 193 return String::adopt( buffer);193 return String::adopt(WTFMove(buffer)); 194 194 } 195 195 … … 273 273 return String(); 274 274 buffer.resize(wcslen(buffer.data())); 275 String directory = String::adopt( buffer);275 String directory = String::adopt(WTFMove(buffer)); 276 276 277 277 DEPRECATED_DEFINE_STATIC_LOCAL(String, companyNameDirectory, (ASCIILiteral("Apple Computer\\")));
Note: See TracChangeset
for help on using the changeset viewer.