Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (248551 => 248552)
--- trunk/Source/_javascript_Core/ChangeLog 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-08-12 23:09:06 UTC (rev 248552)
@@ -1,3 +1,26 @@
+2019-08-12 Sam Weinig <[email protected]>
+
+ Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
+ https://bugs.webkit.org/show_bug.cgi?id=200614
+
+ Reviewed by Darin Adler.
+
+ Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and
+ StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
+
+ Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to
+ StringBuilder::appendSubstring(...).
+
+ * dfg/DFGStrengthReductionPhase.cpp:
+ (JSC::DFG::StrengthReductionPhase::handleNode):
+ * runtime/ConfigFile.cpp:
+ (JSC::ConfigFile::parse):
+ * runtime/LiteralParser.cpp:
+ (JSC::LiteralParser<CharType>::Lexer::lexStringSlow):
+ * tools/FunctionOverrides.cpp:
+ (JSC::parseClause):
+ Update for renames.
+
2019-08-12 Adrian Perez de Castro <[email protected]>
[WPE][GTK] Fix building without unified sources
Modified: trunk/Source/_javascript_Core/dfg/DFGStrengthReductionPhase.cpp (248551 => 248552)
--- trunk/Source/_javascript_Core/dfg/DFGStrengthReductionPhase.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/_javascript_Core/dfg/DFGStrengthReductionPhase.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -854,7 +854,7 @@
unsigned replLen = replace.length();
if (lastIndex < result.start || replLen) {
- builder.append(string, lastIndex, result.start - lastIndex);
+ builder.appendSubstring(string, lastIndex, result.start - lastIndex);
if (replLen) {
StringBuilder replacement;
substituteBackreferences(replacement, replace, string, ovector.data(), regExp);
@@ -899,7 +899,7 @@
m_node->convertToIdentityOn(stringNode);
else {
if (lastIndex < string.length())
- builder.append(string, lastIndex, string.length() - lastIndex);
+ builder.appendSubstring(string, lastIndex, string.length() - lastIndex);
m_node->convertToLazyJSConstant(m_graph, LazyJSValue::newString(m_graph, builder.toString()));
}
Modified: trunk/Source/_javascript_Core/runtime/ConfigFile.cpp (248551 => 248552)
--- trunk/Source/_javascript_Core/runtime/ConfigFile.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/_javascript_Core/runtime/ConfigFile.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -314,7 +314,7 @@
while (*p && !isASCIISpace(*p) && *p != '=')
p++;
- builder.append(optionNameStart, p - optionNameStart);
+ builder.appendCharacters(optionNameStart, p - optionNameStart);
while (*p && isASCIISpace(*p) && *p != '=')
p++;
@@ -336,7 +336,7 @@
while (*p && !isASCIISpace(*p))
p++;
- builder.append(optionValueStart, p - optionValueStart);
+ builder.appendCharacters(optionValueStart, p - optionValueStart);
builder.append('\n');
while (*p && isASCIISpace(*p))
Modified: trunk/Source/_javascript_Core/runtime/LiteralParser.cpp (248551 => 248552)
--- trunk/Source/_javascript_Core/runtime/LiteralParser.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/_javascript_Core/runtime/LiteralParser.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -622,12 +622,12 @@
}
if (!m_builder.isEmpty())
- m_builder.append(runStart, m_ptr - runStart);
+ m_builder.appendCharacters(runStart, m_ptr - runStart);
slowPathBegin:
if ((m_mode != NonStrictJSON) && m_ptr < m_end && *m_ptr == '\\') {
if (m_builder.isEmpty() && runStart < m_ptr)
- m_builder.append(runStart, m_ptr - runStart);
+ m_builder.appendCharacters(runStart, m_ptr - runStart);
++m_ptr;
if (m_ptr >= m_end) {
m_lexErrorMessage = "Unterminated string"_s;
Modified: trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp (248551 => 248552)
--- trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/_javascript_Core/tools/FunctionOverrides.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -217,7 +217,7 @@
if (p[strlen(terminator)] != '\n')
FAIL_WITH_ERROR(SYNTAX_ERROR, ("Unexpected characters after '", keyword, "' clause end delimiter '", delimiter, "':\n", line, "\n"));
- builder.append(line, p - line + 1);
+ builder.appendCharacters(line, p - line + 1);
return builder.toString();
}
builder.append(line);
Modified: trunk/Source/WTF/ChangeLog (248551 => 248552)
--- trunk/Source/WTF/ChangeLog 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WTF/ChangeLog 2019-08-12 23:09:06 UTC (rev 248552)
@@ -1,3 +1,31 @@
+2019-08-12 Sam Weinig <[email protected]>
+
+ Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
+ https://bugs.webkit.org/show_bug.cgi?id=200614
+
+ Reviewed by Darin Adler.
+
+ Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and
+ StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
+
+ Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to
+ StringBuilder::appendSubstring(...).
+
+ * wtf/HexNumber.h:
+ (WTF::appendUnsignedAsHexFixedSize):
+ Add overload that explicitly takes a StringBuilder to work around rename from append to appendCharacters.
+
+ * wtf/text/StringBuilder.cpp:
+ (WTF::StringBuilder::appendCharacters):
+ (WTF::StringBuilder::append):
+ * wtf/text/StringBuilder.h:
+ (WTF::StringBuilder::appendCharacters):
+ (WTF::StringBuilder::append):
+ (WTF::StringBuilder::appendSubstring):
+ (WTF::StringBuilder::appendLiteral):
+ (WTF::IntegerToStringConversionTrait<StringBuilder>::flush):
+ Update for renames.
+
2019-08-12 Yusuke Suzuki <[email protected]>
[WTF][JSC] Make JSC and WTF aggressively-fast-malloced
Modified: trunk/Source/WTF/wtf/HexNumber.h (248551 => 248552)
--- trunk/Source/WTF/wtf/HexNumber.h 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WTF/wtf/HexNumber.h 2019-08-12 23:09:06 UTC (rev 248552)
@@ -21,6 +21,7 @@
#pragma once
#include <array>
+#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringConcatenate.h>
namespace WTF {
@@ -72,6 +73,17 @@
destination.append(result.first, result.second);
}
+// FIXME: Consider renaming to appendHex.
+// Same as appendUnsignedAsHex, but zero-padding to get at least the desired number of digits.
+template<typename NumberType>
+inline void appendUnsignedAsHexFixedSize(NumberType number, StringBuilder& destination, unsigned minimumDigits, HexConversionMode mode = Uppercase)
+{
+ // Each byte can generate up to two digits.
+ std::array<LChar, sizeof(NumberType) * 2> buffer;
+ auto result = Internal::appendHex(buffer, number, minimumDigits, mode);
+ destination.appendCharacters(result.first, result.second);
+}
+
struct HexNumberBuffer {
WTF_MAKE_STRUCT_FAST_ALLOCATED;
Modified: trunk/Source/WTF/wtf/text/StringBuilder.cpp (248551 => 248552)
--- trunk/Source/WTF/wtf/text/StringBuilder.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WTF/wtf/text/StringBuilder.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -303,7 +303,7 @@
return result;
}
-void StringBuilder::append(const UChar* characters, unsigned length)
+void StringBuilder::appendCharacters(const UChar* characters, unsigned length)
{
if (!length || hasOverflowed())
return;
@@ -314,7 +314,7 @@
if (length == 1 && !(*characters & ~0xff)) {
// Append as 8 bit character
LChar lChar = static_cast<LChar>(*characters);
- return append(&lChar, 1);
+ return appendCharacters(&lChar, 1);
}
// Calculate the new size of the builder after appending.
@@ -345,7 +345,7 @@
ASSERT(m_buffer->length() >= m_length.unsafeGet<unsigned>());
}
-void StringBuilder::append(const LChar* characters, unsigned length)
+void StringBuilder::appendCharacters(const LChar* characters, unsigned length)
{
if (!length || hasOverflowed())
return;
@@ -383,7 +383,7 @@
{
// Fast path: avoid constructing a temporary String when possible.
if (auto* characters = CFStringGetCStringPtr(string, kCFStringEncodingISOLatin1)) {
- append(reinterpret_cast<const LChar*>(characters), CFStringGetLength(string));
+ appendCharacters(reinterpret_cast<const LChar*>(characters), CFStringGetLength(string));
return;
}
append(String(string));
Modified: trunk/Source/WTF/wtf/text/StringBuilder.h (248551 => 248552)
--- trunk/Source/WTF/wtf/text/StringBuilder.h 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WTF/wtf/text/StringBuilder.h 2019-08-12 23:09:06 UTC (rev 248552)
@@ -69,10 +69,10 @@
ALWAYS_INLINE bool hasOverflowed() const { return m_length.hasOverflowed(); }
ALWAYS_INLINE bool crashesOnOverflow() const { return m_length.shouldCrashOnOverflow(); }
- WTF_EXPORT_PRIVATE void append(const UChar*, unsigned);
- WTF_EXPORT_PRIVATE void append(const LChar*, unsigned);
+ WTF_EXPORT_PRIVATE void appendCharacters(const UChar*, unsigned);
+ WTF_EXPORT_PRIVATE void appendCharacters(const LChar*, unsigned);
- ALWAYS_INLINE void append(const char* characters, unsigned length) { append(reinterpret_cast<const LChar*>(characters), length); }
+ ALWAYS_INLINE void appendCharacters(const char* characters, unsigned length) { appendCharacters(reinterpret_cast<const LChar*>(characters), length); }
void append(const AtomString& atomString)
{
@@ -97,9 +97,9 @@
}
if (string.is8Bit())
- append(string.characters8(), string.length());
+ appendCharacters(string.characters8(), string.length());
else
- append(string.characters16(), string.length());
+ appendCharacters(string.characters16(), string.length());
}
void append(const StringBuilder& other)
@@ -122,17 +122,17 @@
}
if (other.is8Bit())
- append(other.characters8(), other.m_length.unsafeGet());
+ appendCharacters(other.characters8(), other.m_length.unsafeGet());
else
- append(other.characters16(), other.m_length.unsafeGet());
+ appendCharacters(other.characters16(), other.m_length.unsafeGet());
}
void append(StringView stringView)
{
if (stringView.is8Bit())
- append(stringView.characters8(), stringView.length());
+ appendCharacters(stringView.characters8(), stringView.length());
else
- append(stringView.characters16(), stringView.length());
+ appendCharacters(stringView.characters16(), stringView.length());
}
#if USE(CF)
@@ -142,7 +142,7 @@
void append(NSString *string) { append((__bridge CFStringRef)string); }
#endif
- void append(const String& string, unsigned offset, unsigned length)
+ void appendSubstring(const String& string, unsigned offset, unsigned length)
{
if (!string.length())
return;
@@ -151,15 +151,15 @@
return;
if (string.is8Bit())
- append(string.characters8() + offset, length);
+ appendCharacters(string.characters8() + offset, length);
else
- append(string.characters16() + offset, length);
+ appendCharacters(string.characters16() + offset, length);
}
void append(const char* characters)
{
if (characters)
- append(characters, strlen(characters));
+ appendCharacters(characters, strlen(characters));
}
void append(UChar c)
@@ -180,7 +180,7 @@
return;
}
}
- append(&c, 1);
+ appendCharacters(&c, 1);
}
void append(LChar c)
@@ -195,7 +195,7 @@
m_bufferCharacters16[length] = c;
m_length++;
} else
- append(&c, 1);
+ appendCharacters(&c, 1);
}
void append(char c)
@@ -216,7 +216,7 @@
WTF_EXPORT_PRIVATE void appendQuotedJSONString(const String&);
template<unsigned characterCount>
- ALWAYS_INLINE void appendLiteral(const char (&characters)[characterCount]) { append(characters, characterCount - 1); }
+ ALWAYS_INLINE void appendLiteral(const char (&characters)[characterCount]) { appendCharacters(characters, characterCount - 1); }
WTF_EXPORT_PRIVATE void appendNumber(int);
WTF_EXPORT_PRIVATE void appendNumber(unsigned);
@@ -469,7 +469,7 @@
template<> struct IntegerToStringConversionTrait<StringBuilder> {
using ReturnType = void;
using AdditionalArgumentType = StringBuilder;
- static void flush(LChar* characters, unsigned length, StringBuilder* stringBuilder) { stringBuilder->append(characters, length); }
+ static void flush(LChar* characters, unsigned length, StringBuilder* stringBuilder) { stringBuilder->appendCharacters(characters, length); }
};
} // namespace WTF
Modified: trunk/Source/WebCore/ChangeLog (248551 => 248552)
--- trunk/Source/WebCore/ChangeLog 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/ChangeLog 2019-08-12 23:09:06 UTC (rev 248552)
@@ -1,3 +1,38 @@
+2019-08-12 Sam Weinig <[email protected]>
+
+ Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
+ https://bugs.webkit.org/show_bug.cgi?id=200614
+
+ Reviewed by Darin Adler.
+
+ Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and
+ StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
+
+ Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to
+ StringBuilder::appendSubstring(...).
+
+ * dom/Range.cpp:
+ (WebCore::Range::toString const):
+ * editing/Editing.cpp:
+ (WebCore::stringWithRebalancedWhitespace):
+ * editing/MarkupAccumulator.cpp:
+ (WebCore::appendCharactersReplacingEntitiesInternal):
+ * editing/TextIterator.cpp:
+ (WebCore::TextIteratorCopyableText::appendToStringBuilder const):
+ * html/HTMLTextFormControlElement.cpp:
+ (WebCore::HTMLTextFormControlElement::valueWithHardLineBreaks const):
+ * html/parser/HTMLTokenizer.cpp:
+ (WebCore::HTMLTokenizer::bufferedCharacters const):
+ * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
+ (WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
+ * platform/text/SegmentedString.cpp:
+ (WebCore::SegmentedString::Substring::appendTo const):
+ * platform/text/TextCodecICU.cpp:
+ (WebCore::TextCodecICU::decode):
+ * xml/XSLTProcessorLibxslt.cpp:
+ (WebCore::writeToStringBuilder):
+ Update for renames.
+
2019-08-12 Adrian Perez de Castro <[email protected]>
[WPE][GTK] Fix building without unified sources
Modified: trunk/Source/WebCore/dom/Range.cpp (248551 => 248552)
--- trunk/Source/WebCore/dom/Range.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/dom/Range.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -946,7 +946,7 @@
unsigned length = data.length();
unsigned start = node == &startContainer() ? std::min(m_start.offset(), length) : 0U;
unsigned end = node == &endContainer() ? std::min(std::max(start, m_end.offset()), length) : length;
- builder.append(data, start, end - start);
+ builder.appendSubstring(data, start, end - start);
}
}
Modified: trunk/Source/WebCore/editing/Editing.cpp (248551 => 248552)
--- trunk/Source/WebCore/editing/Editing.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/editing/Editing.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -420,7 +420,7 @@
if (character == selectedWhitespaceCharacter)
continue;
rebalancedString.reserveCapacity(length);
- rebalancedString.append(string, rebalancedString.length(), i - rebalancedString.length());
+ rebalancedString.appendSubstring(string, rebalancedString.length(), i - rebalancedString.length());
rebalancedString.append(selectedWhitespaceCharacter);
}
@@ -428,7 +428,7 @@
return string;
rebalancedString.reserveCapacity(length);
- rebalancedString.append(string, rebalancedString.length(), length - rebalancedString.length());
+ rebalancedString.appendSubstring(string, rebalancedString.length(), length - rebalancedString.length());
return rebalancedString.toString();
}
Modified: trunk/Source/WebCore/editing/MarkupAccumulator.cpp (248551 => 248552)
--- trunk/Source/WebCore/editing/MarkupAccumulator.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/editing/MarkupAccumulator.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -150,12 +150,12 @@
CharacterType character = text[i];
uint8_t substitution = character < WTF_ARRAY_LENGTH(entityMap) ? entityMap[character] : static_cast<uint8_t>(EntitySubstitutionNullIndex);
if (UNLIKELY(substitution != EntitySubstitutionNullIndex) && entitySubstitutionList[substitution].mask & entityMask) {
- result.append(text + positionAfterLastEntity, i - positionAfterLastEntity);
- result.append(entitySubstitutionList[substitution].characters, entitySubstitutionList[substitution].length);
+ result.appendCharacters(text + positionAfterLastEntity, i - positionAfterLastEntity);
+ result.appendCharacters(entitySubstitutionList[substitution].characters, entitySubstitutionList[substitution].length);
positionAfterLastEntity = i + 1;
}
}
- result.append(text + positionAfterLastEntity, length - positionAfterLastEntity);
+ result.appendCharacters(text + positionAfterLastEntity, length - positionAfterLastEntity);
}
void MarkupAccumulator::appendCharactersReplacingEntities(StringBuilder& result, const String& source, unsigned offset, unsigned length, EntityMask entityMask)
Modified: trunk/Source/WebCore/editing/TextIterator.cpp (248551 => 248552)
--- trunk/Source/WebCore/editing/TextIterator.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/editing/TextIterator.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -335,7 +335,7 @@
if (m_singleCharacter)
builder.append(m_singleCharacter);
else
- builder.append(m_string, m_offset, m_length);
+ builder.appendSubstring(m_string, m_offset, m_length);
}
// --------
Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (248551 => 248552)
--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -717,13 +717,13 @@
unsigned position = 0;
while (breakNode == node && breakOffset <= length) {
if (breakOffset > position) {
- result.append(data, position, breakOffset - position);
+ result.appendSubstring(data, position, breakOffset - position);
position = breakOffset;
result.append(newlineCharacter);
}
getNextSoftBreak(line, breakNode, breakOffset);
}
- result.append(data, position, length - position);
+ result.appendSubstring(data, position, length - position);
}
while (breakNode == node)
getNextSoftBreak(line, breakNode, breakOffset);
Modified: trunk/Source/WebCore/html/parser/HTMLTokenizer.cpp (248551 => 248552)
--- trunk/Source/WebCore/html/parser/HTMLTokenizer.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/html/parser/HTMLTokenizer.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -1401,7 +1401,7 @@
characters.reserveCapacity(numberOfBufferedCharacters());
characters.append('<');
characters.append('/');
- characters.append(m_temporaryBuffer.data(), m_temporaryBuffer.size());
+ characters.appendCharacters(m_temporaryBuffer.data(), m_temporaryBuffer.size());
return characters.toString();
}
Modified: trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp (248551 => 248552)
--- trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -529,7 +529,7 @@
// A WebVTT header is terminated by "One or more WebVTT line terminators" so append two line feeds to make sure the parser
// reccognized this string as a full header.
StringBuilder header;
- header.append(reinterpret_cast<const unsigned char*>(CFDataGetBytePtr(webvttHeaderData)), length);
+ header.appendCharacters(reinterpret_cast<const unsigned char*>(CFDataGetBytePtr(webvttHeaderData)), length);
header.append("\n\n");
INFO_LOG(LOGIDENTIFIER, "VTT header ", &header);
Modified: trunk/Source/WebCore/platform/text/SegmentedString.cpp (248551 => 248552)
--- trunk/Source/WebCore/platform/text/SegmentedString.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/platform/text/SegmentedString.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -27,7 +27,7 @@
inline void SegmentedString::Substring::appendTo(StringBuilder& builder) const
{
- builder.append(string, string.length() - length, length);
+ builder.appendSubstring(string, string.length() - length, length);
}
SegmentedString& SegmentedString::operator=(SegmentedString&& other)
Modified: trunk/Source/WebCore/platform/text/TextCodecICU.cpp (248551 => 248552)
--- trunk/Source/WebCore/platform/text/TextCodecICU.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/platform/text/TextCodecICU.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -307,7 +307,7 @@
do {
int ucharsDecoded = decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, flush, err);
- result.append(buffer, ucharsDecoded);
+ result.appendCharacters(buffer, ucharsDecoded);
} while (err == U_BUFFER_OVERFLOW_ERROR);
if (U_FAILURE(err)) {
Modified: trunk/Source/WebCore/platform/wpe/RenderThemeWPE.cpp (248551 => 248552)
--- trunk/Source/WebCore/platform/wpe/RenderThemeWPE.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/platform/wpe/RenderThemeWPE.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -58,8 +58,8 @@
String RenderThemeWPE::mediaControlsScript()
{
StringBuilder scriptBuilder;
- scriptBuilder.append(mediaControlsLocalizedStringsJavaScript, sizeof(mediaControlsLocalizedStringsJavaScript));
- scriptBuilder.append(mediaControlsBaseJavaScript, sizeof(mediaControlsBaseJavaScript));
+ scriptBuilder.appendCharacters(mediaControlsLocalizedStringsJavaScript, sizeof(mediaControlsLocalizedStringsJavaScript));
+ scriptBuilder.appendCharacters(mediaControlsBaseJavaScript, sizeof(mediaControlsBaseJavaScript));
return scriptBuilder.toString();
}
#endif
Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (248551 => 248552)
--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -1212,9 +1212,9 @@
String RenderThemeGtk::mediaControlsScript()
{
StringBuilder scriptBuilder;
- scriptBuilder.append(mediaControlsLocalizedStringsJavaScript, sizeof(mediaControlsLocalizedStringsJavaScript));
- scriptBuilder.append(mediaControlsBaseJavaScript, sizeof(mediaControlsBaseJavaScript));
- scriptBuilder.append(mediaControlsGtkJavaScript, sizeof(mediaControlsGtkJavaScript));
+ scriptBuilder.appendCharacters(mediaControlsLocalizedStringsJavaScript, sizeof(mediaControlsLocalizedStringsJavaScript));
+ scriptBuilder.appendCharacters(mediaControlsBaseJavaScript, sizeof(mediaControlsBaseJavaScript));
+ scriptBuilder.appendCharacters(mediaControlsGtkJavaScript, sizeof(mediaControlsGtkJavaScript));
return scriptBuilder.toString();
}
#endif // ENABLE(VIDEO)
Modified: trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp (248551 => 248552)
--- trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -190,7 +190,7 @@
}
}
- resultOutput.append(outputBuffer.data(), outputOffset);
+ resultOutput.appendCharacters(outputBuffer.data(), outputOffset);
return inputOffset;
}
Modified: trunk/Source/WebKit/ChangeLog (248551 => 248552)
--- trunk/Source/WebKit/ChangeLog 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebKit/ChangeLog 2019-08-12 23:09:06 UTC (rev 248552)
@@ -1,3 +1,22 @@
+2019-08-12 Sam Weinig <[email protected]>
+
+ Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
+ https://bugs.webkit.org/show_bug.cgi?id=200614
+
+ Reviewed by Darin Adler.
+
+ Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and
+ StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
+
+ Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to
+ StringBuilder::appendSubstring(...).
+
+ * Shared/mac/AuxiliaryProcessMac.mm:
+ (WebKit::setAndSerializeSandboxParameters):
+ * UIProcess/WebProcessPool.cpp:
+ (WebKit::WebProcessPool::didReceiveInvalidMessage):
+ Update for renames.
+
2019-08-12 Dean Jackson <[email protected]>
Contextual menu Hide and Show Link Previews should not have a symbol
Modified: trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm (248551 => 248552)
--- trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebKit/Shared/mac/AuxiliaryProcessMac.mm 2019-08-12 23:09:06 UTC (rev 248552)
@@ -234,9 +234,9 @@
WTFLogAlways("%s: Could not set sandbox parameter: %s\n", getprogname(), strerror(errno));
CRASH();
}
- builder.append(name, strlen(name));
+ builder.append(name);
builder.append(':');
- builder.append(value, strlen(value));
+ builder.append(value);
builder.append(':');
}
if (isProfilePath) {
@@ -243,7 +243,7 @@
auto contents = fileContents(profileOrProfilePath);
if (!contents)
return WTF::nullopt;
- builder.append(contents->data(), contents->size());
+ builder.appendCharacters(contents->data(), contents->size());
} else
builder.append(profileOrProfilePath);
return builder.toString().ascii();
Modified: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (248551 => 248552)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -792,9 +792,9 @@
return;
StringBuilder messageNameStringBuilder;
- messageNameStringBuilder.append(messageReceiverName.data(), messageReceiverName.size());
+ messageNameStringBuilder.appendCharacters(messageReceiverName.data(), messageReceiverName.size());
messageNameStringBuilder.append('.');
- messageNameStringBuilder.append(messageName.data(), messageName.size());
+ messageNameStringBuilder.appendCharacters(messageName.data(), messageName.size());
s_invalidMessageCallback(toAPI(API::String::create(messageNameStringBuilder.toString()).ptr()));
}
Modified: trunk/Tools/ChangeLog (248551 => 248552)
--- trunk/Tools/ChangeLog 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Tools/ChangeLog 2019-08-12 23:09:06 UTC (rev 248552)
@@ -1,3 +1,20 @@
+2019-08-12 Sam Weinig <[email protected]>
+
+ Replace multiparameter overloads of append() in StringBuilder as a first step toward standardizinging on the flexibleAppend() implementation
+ https://bugs.webkit.org/show_bug.cgi?id=200614
+
+ Reviewed by Darin Adler.
+
+ Renames StringBuilder::append(const LChar*, unsigned), StringBuilder::append(const UChar*, unsigned) and
+ StringBuilder::append(const char*, unsigned) to StringBuilder::appendCharacters(...).
+
+ Renames StringBuilder::append(const String& string, unsigned offset, unsigned length) to
+ StringBuilder::appendSubstring(...).
+
+ * TestWebKitAPI/Tests/WTF/StringBuilder.cpp:
+ (TestWebKitAPI::TEST):
+ Update for renames.
+
2019-08-12 Megan Gardner <[email protected]>
Fix Crash in Mail Search
Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp (248551 => 248552)
--- trunk/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/StringBuilder.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -64,7 +64,7 @@
expectBuilderContent("0123456789", builder);
builder.append("abcd");
expectBuilderContent("0123456789abcd", builder);
- builder.append("efgh", 3);
+ builder.appendCharacters("efgh", 3);
expectBuilderContent("0123456789abcdefg", builder);
builder.append("");
expectBuilderContent("0123456789abcdefg", builder);
@@ -73,11 +73,11 @@
builder.toString(); // Test after reifyString().
StringBuilder builder1;
- builder.append("", 0);
+ builder.appendCharacters("", 0);
expectBuilderContent("0123456789abcdefg#", builder);
- builder1.append(builder.characters8(), builder.length());
+ builder1.appendCharacters(builder.characters8(), builder.length());
builder1.append("XYZ");
- builder.append(builder1.characters8(), builder1.length());
+ builder.appendCharacters(builder1.characters8(), builder1.length());
expectBuilderContent("0123456789abcdefg#0123456789abcdefg#XYZ", builder);
StringBuilder builder2;
@@ -104,12 +104,12 @@
StringBuilder builder2;
UChar32 frakturAChar = 0x1D504;
const UChar data[] = { U16_LEAD(frakturAChar), U16_TRAIL(frakturAChar) };
- builder2.append(data, 2);
+ builder2.appendCharacters(data, 2);
ASSERT_EQ(2U, builder2.length());
String result2 = builder2.toString();
ASSERT_EQ(2U, result2.length());
builder.append(builder2);
- builder.append(data, 2);
+ builder.appendCharacters(data, 2);
ASSERT_EQ(4U, builder.length());
const UChar resultArray[] = { U16_LEAD(frakturAChar), U16_TRAIL(frakturAChar), U16_LEAD(frakturAChar), U16_TRAIL(frakturAChar) };
expectBuilderContent(String(resultArray, WTF_ARRAY_LENGTH(resultArray)), builder);
@@ -360,7 +360,7 @@
}
{ // AtomString constructed from an empty char* string.
StringBuilder builder;
- builder.append("", 0);
+ builder.appendCharacters("", 0);
AtomString atomString = builder.toAtomString();
ASSERT_EQ(emptyAtom(), atomString);
}
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp (248551 => 248552)
--- trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp 2019-08-12 22:26:53 UTC (rev 248551)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitWebContext.cpp 2019-08-12 23:09:06 UTC (rev 248552)
@@ -271,7 +271,7 @@
builder.append("<html><body>");
if (contentLength <= baseLength)
- builder.append(baseString, 0, contentLength);
+ builder.appendSubstring(baseString, 0, contentLength);
else {
unsigned currentLength = 0;
while (currentLength < contentLength) {
@@ -278,7 +278,7 @@
if ((currentLength + baseLength) <= contentLength)
builder.append(baseString);
else
- builder.append(baseString, 0, contentLength - currentLength);
+ builder.appendSubstring(baseString, 0, contentLength - currentLength);
// Account for the 12 characters of the '<html><body>' prefix.
currentLength = builder.length() - 12;