Changeset 173212 in webkit


Ignore:
Timestamp:
Sep 3, 2014 11:42:54 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

Use StringBuilder append(char) and appendLiteral in more places
https://bugs.webkit.org/show_bug.cgi?id=136470

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2014-09-03
Reviewed by Andreas Kling.

  • Modules/indexeddb/IDBKeyData.cpp:

(WebCore::IDBKeyData::loggingString):

  • Modules/websockets/WebSocket.cpp:

(WebCore::encodeProtocolString):

  • Modules/websockets/WebSocketExtensionDispatcher.cpp:

(WebCore::WebSocketExtensionDispatcher::createHeaderValue):
(WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension):

  • Modules/websockets/WebSocketHandshake.cpp:

(WebCore::WebSocketHandshake::clientLocation):
(WebCore::WebSocketHandshake::clientHandshakeMessage):

  • css/CSSCalculationValue.cpp:

(WebCore::buildCssText):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::cssText):

  • css/CSSMediaRule.cpp:

(WebCore::CSSMediaRule::cssText):

  • css/CSSSelectorList.cpp:

(WebCore::CSSSelectorList::selectorsText):

  • css/CSSSupportsRule.cpp:

(WebCore::CSSSupportsRule::cssText):

  • css/MediaQuery.cpp:

(WebCore::MediaQuery::serialize):

  • editing/MarkupAccumulator.cpp:

(WebCore::MarkupAccumulator::generateUniquePrefix):

  • editing/markup.cpp:

(WebCore::urlToMarkup):

  • fileapi/FileReaderLoader.cpp:

(WebCore::FileReaderLoader::convertToDataURL):

  • html/EmailInputType.cpp:

(WebCore::EmailInputType::sanitizeValue):

  • html/FormController.cpp:

(WebCore::recordFormStructure):

  • html/parser/XSSAuditorDelegate.cpp:

(WebCore::buildConsoleError):

  • html/track/WebVTTParser.cpp:

(WebCore::WebVTTParser::collectCueText):

  • mathml/MathMLMencloseElement.cpp:

(WebCore::MathMLMencloseElement::longDivLeftPadding):

  • page/PageSerializer.cpp:

(WebCore::SerializerMarkupAccumulator::appendElement):

  • page/SecurityOrigin.cpp:

(WebCore::SecurityOrigin::toRawString):

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):

  • page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:

(WebCore::logThreadedScrollingMode):

  • platform/PODInterval.h:

(WebCore::PODInterval::toString):

  • platform/PODRedBlackTree.h:

(WebCore::PODRedBlackTree::dumpFromNode):

  • platform/UUID.cpp:

(WebCore::createCanonicalUUIDString):

  • platform/network/ProxyServer.cpp:

(WebCore::appendProxyServerString):
(WebCore::toString):

  • platform/text/DateTimeFormat.cpp:

(WebCore::DateTimeFormat::quoteAndAppendLiteral):

  • platform/text/PlatformLocale.cpp:

(WebCore::DateTimeStringBuilder::zeroPadString):
(WebCore::Locale::convertFromLocalizedNumber):

  • platform/text/TextStream.cpp:

(WebCore::TextStream::operator<<):

  • rendering/RenderListMarker.cpp:

(WebCore::listMarkerText):

  • testing/Internals.cpp:

(WebCore::Internals::parserMetaData):
(WebCore::Internals::getCurrentCursorInfo):

Location:
trunk/Source/WebCore
Files:
32 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r173209 r173212  
     12014-09-03  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Use StringBuilder append(char) and appendLiteral in more places
     4        https://bugs.webkit.org/show_bug.cgi?id=136470
     5
     6        Reviewed by Andreas Kling.
     7
     8        * Modules/indexeddb/IDBKeyData.cpp:
     9        (WebCore::IDBKeyData::loggingString):
     10        * Modules/websockets/WebSocket.cpp:
     11        (WebCore::encodeProtocolString):
     12        * Modules/websockets/WebSocketExtensionDispatcher.cpp:
     13        (WebCore::WebSocketExtensionDispatcher::createHeaderValue):
     14        (WebCore::WebSocketExtensionDispatcher::appendAcceptedExtension):
     15        * Modules/websockets/WebSocketHandshake.cpp:
     16        (WebCore::WebSocketHandshake::clientLocation):
     17        (WebCore::WebSocketHandshake::clientHandshakeMessage):
     18        * css/CSSCalculationValue.cpp:
     19        (WebCore::buildCssText):
     20        * css/CSSComputedStyleDeclaration.cpp:
     21        (WebCore::CSSComputedStyleDeclaration::cssText):
     22        * css/CSSMediaRule.cpp:
     23        (WebCore::CSSMediaRule::cssText):
     24        * css/CSSSelectorList.cpp:
     25        (WebCore::CSSSelectorList::selectorsText):
     26        * css/CSSSupportsRule.cpp:
     27        (WebCore::CSSSupportsRule::cssText):
     28        * css/MediaQuery.cpp:
     29        (WebCore::MediaQuery::serialize):
     30        * editing/MarkupAccumulator.cpp:
     31        (WebCore::MarkupAccumulator::generateUniquePrefix):
     32        * editing/markup.cpp:
     33        (WebCore::urlToMarkup):
     34        * fileapi/FileReaderLoader.cpp:
     35        (WebCore::FileReaderLoader::convertToDataURL):
     36        * html/EmailInputType.cpp:
     37        (WebCore::EmailInputType::sanitizeValue):
     38        * html/FormController.cpp:
     39        (WebCore::recordFormStructure):
     40        * html/parser/XSSAuditorDelegate.cpp:
     41        (WebCore::buildConsoleError):
     42        * html/track/WebVTTParser.cpp:
     43        (WebCore::WebVTTParser::collectCueText):
     44        * mathml/MathMLMencloseElement.cpp:
     45        (WebCore::MathMLMencloseElement::longDivLeftPadding):
     46        * page/PageSerializer.cpp:
     47        (WebCore::SerializerMarkupAccumulator::appendElement):
     48        * page/SecurityOrigin.cpp:
     49        (WebCore::SecurityOrigin::toRawString):
     50        * page/scrolling/ScrollingCoordinator.cpp:
     51        (WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
     52        * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
     53        (WebCore::logThreadedScrollingMode):
     54        * platform/PODInterval.h:
     55        (WebCore::PODInterval::toString):
     56        * platform/PODRedBlackTree.h:
     57        (WebCore::PODRedBlackTree::dumpFromNode):
     58        * platform/UUID.cpp:
     59        (WebCore::createCanonicalUUIDString):
     60        * platform/network/ProxyServer.cpp:
     61        (WebCore::appendProxyServerString):
     62        (WebCore::toString):
     63        * platform/text/DateTimeFormat.cpp:
     64        (WebCore::DateTimeFormat::quoteAndAppendLiteral):
     65        * platform/text/PlatformLocale.cpp:
     66        (WebCore::DateTimeStringBuilder::zeroPadString):
     67        (WebCore::Locale::convertFromLocalizedNumber):
     68        * platform/text/TextStream.cpp:
     69        (WebCore::TextStream::operator<<):
     70        * rendering/RenderListMarker.cpp:
     71        (WebCore::listMarkerText):
     72        * testing/Internals.cpp:
     73        (WebCore::Internals::parserMetaData):
     74        (WebCore::Internals::getCurrentCursorInfo):
     75
    1762014-09-03  Bear Travis  <betravis@adobe.com>
    277
  • trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp

    r166047 r173212  
    267267                result.append(arrayValue[i].loggingString());
    268268                if (i < arrayValue.size() - 1)
    269                     result.append(", ");
     269                    result.appendLiteral(", ");
    270270            }
    271             result.append(" }");
     271            result.appendLiteral(" }");
    272272            return result.toString();
    273273        }
  • trunk/Source/WebCore/Modules/websockets/WebSocket.cpp

    r170774 r173212  
    9898            builder.append(String::format("\\u%04X", protocol[i]));
    9999        else if (protocol[i] == 0x5c)
    100             builder.append("\\\\");
     100            builder.appendLiteral("\\\\");
    101101        else
    102102            builder.append(protocol[i]);
  • trunk/Source/WebCore/Modules/websockets/WebSocketExtensionDispatcher.cpp

    r130612 r173212  
    7070    builder.append(m_processors[0]->handshakeString());
    7171    for (size_t i = 1; i < numProcessors; ++i) {
    72         builder.append(", ");
     72        builder.appendLiteral(", ");
    7373        builder.append(m_processors[i]->handshakeString());
    7474    }
     
    7979{
    8080    if (!m_acceptedExtensionsBuilder.isEmpty())
    81         m_acceptedExtensionsBuilder.append(", ");
     81        m_acceptedExtensionsBuilder.appendLiteral(", ");
    8282    m_acceptedExtensionsBuilder.append(extensionToken);
    8383    // FIXME: Should use ListHashSet to keep the order of the parameters.
    8484    for (HashMap<String, String>::const_iterator iterator = extensionParameters.begin(); iterator != extensionParameters.end(); ++iterator) {
    85         m_acceptedExtensionsBuilder.append("; ");
     85        m_acceptedExtensionsBuilder.appendLiteral("; ");
    8686        m_acceptedExtensionsBuilder.append(iterator->key);
    8787        if (!iterator->value.isNull()) {
    88             m_acceptedExtensionsBuilder.append("=");
     88            m_acceptedExtensionsBuilder.append('=');
    8989            m_acceptedExtensionsBuilder.append(iterator->value);
    9090        }
  • trunk/Source/WebCore/Modules/websockets/WebSocketHandshake.cpp

    r170029 r173212  
    173173    StringBuilder builder;
    174174    builder.append(m_secure ? "wss" : "ws");
    175     builder.append("://");
     175    builder.appendLiteral("://");
    176176    builder.append(hostName(m_url, m_secure));
    177177    builder.append(resourceName(m_url));
     
    184184    StringBuilder builder;
    185185
    186     builder.append("GET ");
     186    builder.appendLiteral("GET ");
    187187    builder.append(resourceName(m_url));
    188     builder.append(" HTTP/1.1\r\n");
     188    builder.appendLiteral(" HTTP/1.1\r\n");
    189189
    190190    Vector<String> fields;
     
    227227    for (size_t i = 0; i < fields.size(); i++) {
    228228        builder.append(fields[i]);
    229         builder.append("\r\n");
    230     }
    231 
    232     builder.append("\r\n");
     229        builder.appendLiteral("\r\n");
     230    }
     231
     232    builder.appendLiteral("\r\n");
    233233
    234234    return builder.toString().utf8();
  • trunk/Source/WebCore/css/CSSCalculationValue.cpp

    r172192 r173212  
    160160{
    161161    StringBuilder result;
    162     result.append("calc");
     162    result.appendLiteral("calc");
    163163    bool expressionHasSingleTerm = expression[0] != '(';
    164164    if (expressionHasSingleTerm)
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r173156 r173212  
    12791279            result.append(' ');
    12801280        result.append(getPropertyName(computedProperties[i]));
    1281         result.append(": ", 2);
     1281        result.appendLiteral(": ");
    12821282        result.append(getPropertyValue(computedProperties[i]));
    12831283        result.append(';');
  • trunk/Source/WebCore/css/CSSMediaRule.cpp

    r165676 r173212  
    5252{
    5353    StringBuilder result;
    54     result.append("@media ");
     54    result.appendLiteral("@media ");
    5555    if (mediaQueries()) {
    5656        result.append(mediaQueries()->mediaText());
  • trunk/Source/WebCore/css/CSSSelectorList.cpp

    r165921 r173212  
    126126    for (const CSSSelector* s = first(); s; s = next(s)) {
    127127        if (s != first())
    128             result.append(", ");
     128            result.appendLiteral(", ");
    129129        result.append(s->selectorText());
    130130    }
  • trunk/Source/WebCore/css/CSSSupportsRule.cpp

    r148921 r173212  
    5151    StringBuilder result;
    5252
    53     result.append("@supports ");
     53    result.appendLiteral("@supports ");
    5454    result.append(conditionText());
    55     result.append(" {\n");
     55    result.appendLiteral(" {\n");
    5656    appendCssTextForItems(result);
    5757    result.append('}');
  • trunk/Source/WebCore/css/MediaQuery.cpp

    r170774 r173212  
    4242        switch (m_restrictor) {
    4343        case MediaQuery::Only:
    44             result.append("only ");
     44            result.appendLiteral("only ");
    4545            break;
    4646        case MediaQuery::Not:
    47             result.append("not ");
     47            result.appendLiteral("not ");
    4848            break;
    4949        case MediaQuery::None:
     
    5858        if (m_mediaType != "all" || m_restrictor != None) {
    5959            result.append(m_mediaType);
    60             result.append(" and ");
     60            result.appendLiteral(" and ");
    6161        }
    6262
    6363        result.append(m_expressions->at(0)->serialize());
    6464        for (size_t i = 1; i < m_expressions->size(); ++i) {
    65             result.append(" and ");
     65            result.appendLiteral(" and ");
    6666            result.append(m_expressions->at(i)->serialize());
    6767        }
    6868    } else {
    6969        // If query is invalid, serialized text should turn into "not all".
    70         result.append("not all");
     70        result.appendLiteral("not all");
    7171    }
    7272    return result.toString();
  • trunk/Source/WebCore/editing/MarkupAccumulator.cpp

    r165699 r173212  
    494494    do {
    495495        builder.clear();
    496         builder.append("NS");
     496        builder.appendLiteral("NS");
    497497        builder.appendNumber(++m_prefixLevel);
    498498        const AtomicString& name = builder.toAtomicString();
  • trunk/Source/WebCore/editing/markup.cpp

    r171941 r173212  
    859859{
    860860    StringBuilder markup;
    861     markup.append("<a href=\"");
     861    markup.appendLiteral("<a href=\"");
    862862    markup.append(url.string());
    863     markup.append("\">");
     863    markup.appendLiteral("\">");
    864864    MarkupAccumulator::appendCharactersReplacingEntities(markup, title, 0, title.length(), EntityMaskInPCDATA);
    865     markup.append("</a>");
     865    markup.appendLiteral("</a>");
    866866    return markup.toString();
    867867}
  • trunk/Source/WebCore/fileapi/FileReaderLoader.cpp

    r170381 r173212  
    327327{
    328328    StringBuilder builder;
    329     builder.append("data:");
     329    builder.appendLiteral("data:");
    330330
    331331    if (!m_bytesLoaded) {
     
    335335
    336336    builder.append(m_dataType);
    337     builder.append(";base64,");
     337    builder.appendLiteral(";base64,");
    338338
    339339    Vector<char> out;
  • trunk/Source/WebCore/html/EmailInputType.cpp

    r165607 r173212  
    103103    for (unsigned i = 0; i < addresses.size(); ++i) {
    104104        if (i > 0)
    105             strippedValue.append(",");
     105            strippedValue.append(',');
    106106        strippedValue.append(stripLeadingAndTrailingHTMLSpaces(addresses[i]));
    107107    }
  • trunk/Source/WebCore/html/FormController.cpp

    r170774 r173212  
    303303    const size_t namedControlsToBeRecorded = 2;
    304304    const Vector<FormAssociatedElement*>& controls = form.associatedElements();
    305     builder.append(" [");
     305    builder.appendLiteral(" [");
    306306    for (size_t i = 0, namedControls = 0; i < controls.size() && namedControls < namedControlsToBeRecorded; ++i) {
    307307        if (!controls[i]->isFormControlElementWithState())
     
    315315        namedControls++;
    316316        builder.append(name);
    317         builder.append(" ");
    318     }
    319     builder.append("]");
     317        builder.append(' ');
     318    }
     319    builder.append(']');
    320320}
    321321
  • trunk/Source/WebCore/html/parser/XSSAuditorDelegate.cpp

    r165986 r173212  
    5454{
    5555    StringBuilder message;
    56     message.append("The XSS Auditor ");
     56    message.appendLiteral("The XSS Auditor ");
    5757    message.append(xssInfo.m_didBlockEntirePage ? "blocked access to" : "refused to execute a script in");
    58     message.append(" '");
     58    message.appendLiteral(" '");
    5959    message.append(xssInfo.m_originalURL);
    60     message.append("' because ");
     60    message.appendLiteral("' because ");
    6161    message.append(xssInfo.m_didBlockEntirePage ? "the source code of a script" : "its source code");
    62     message.append(" was found within the request.");
     62    message.appendLiteral(" was found within the request.");
    6363
    6464    if (xssInfo.m_didSendCSPHeader)
    65         message.append(" The server sent a 'Content-Security-Policy' header requesting this behavior.");
     65        message.appendLiteral(" The server sent a 'Content-Security-Policy' header requesting this behavior.");
    6666    else if (xssInfo.m_didSendXSSProtectionHeader)
    67         message.append(" The server sent an 'X-XSS-Protection' header requesting this behavior.");
     67        message.appendLiteral(" The server sent an 'X-XSS-Protection' header requesting this behavior.");
    6868    else
    69         message.append(" The auditor was enabled as the server sent neither an 'X-XSS-Protection' nor 'Content-Security-Policy' header.");
     69        message.appendLiteral(" The auditor was enabled as the server sent neither an 'X-XSS-Protection' nor 'Content-Security-Policy' header.");
    7070
    7171    return message.toString();
  • trunk/Source/WebCore/html/track/WebVTTParser.cpp

    r170694 r173212  
    350350    }
    351351    if (!m_currentContent.isEmpty())
    352         m_currentContent.append("\n");
     352        m_currentContent.append('\n');
    353353    m_currentContent.append(line);
    354354
  • trunk/Source/WebCore/mathml/MathMLMencloseElement.cpp

    r170774 r173212  
    130130{
    131131    StringBuilder padding;
    132     float fontSize = 0;
    133132    String closingBrace = ")";
    134133    TextRun run(closingBrace.impl(), closingBrace.length());
     
    136135    if (node && node->renderer()) {
    137136        const Font& font = node->renderer()->style().font();
    138         fontSize = font.width(run);
    139         padding.append(String::number(fontSize));
    140         padding.append("px");
     137        padding.appendNumber(font.width(run));
     138        padding.appendLiteral("px");
    141139    }
    142140    return padding.toString();
  • trunk/Source/WebCore/page/PageSerializer.cpp

    r165848 r173212  
    137137
    138138    if (element.hasTagName(HTMLNames::headTag)) {
    139         out.append("<meta charset=\"");
     139        out.appendLiteral("<meta charset=\"");
    140140        out.append(m_document.charset());
    141         out.append("\">");
     141        out.appendLiteral("\">");
    142142    }
    143143
  • trunk/Source/WebCore/page/SecurityOrigin.cpp

    r171160 r173212  
    478478    result.reserveCapacity(m_protocol.length() + m_host.length() + 10);
    479479    result.append(m_protocol);
    480     result.append("://");
     480    result.appendLiteral("://");
    481481    result.append(m_host);
    482482
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r169733 r173212  
    396396
    397397    if (reasons & ScrollingCoordinator::ForcedOnMainThread)
    398         stringBuilder.append("Forced on main thread, ");
     398        stringBuilder.appendLiteral("Forced on main thread, ");
    399399    if (reasons & ScrollingCoordinator::HasSlowRepaintObjects)
    400         stringBuilder.append("Has slow repaint objects, ");
     400        stringBuilder.appendLiteral("Has slow repaint objects, ");
    401401    if (reasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupportingFixedLayers)
    402         stringBuilder.append("Has viewport constrained objects without supporting fixed layers, ");
     402        stringBuilder.appendLiteral("Has viewport constrained objects without supporting fixed layers, ");
    403403    if (reasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects)
    404         stringBuilder.append("Has non-layer viewport-constrained objects, ");
     404        stringBuilder.appendLiteral("Has non-layer viewport-constrained objects, ");
    405405    if (reasons & ScrollingCoordinator::IsImageDocument)
    406         stringBuilder.append("Is image document, ");
     406        stringBuilder.appendLiteral("Is image document, ");
    407407
    408408    if (stringBuilder.length())
  • trunk/Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm

    r172948 r173212  
    518518
    519519        if (synchronousScrollingReasons & ScrollingCoordinator::ForcedOnMainThread)
    520             reasonsDescription.append("forced,");
     520            reasonsDescription.appendLiteral("forced,");
    521521        if (synchronousScrollingReasons & ScrollingCoordinator::HasSlowRepaintObjects)
    522             reasonsDescription.append("slow-repaint objects,");
     522            reasonsDescription.appendLiteral("slow-repaint objects,");
    523523        if (synchronousScrollingReasons & ScrollingCoordinator::HasViewportConstrainedObjectsWithoutSupportingFixedLayers)
    524             reasonsDescription.append("viewport-constrained objects,");
     524            reasonsDescription.appendLiteral("viewport-constrained objects,");
    525525        if (synchronousScrollingReasons & ScrollingCoordinator::HasNonLayerViewportConstrainedObjects)
    526             reasonsDescription.append("non-layer viewport-constrained objects,");
     526            reasonsDescription.appendLiteral("non-layer viewport-constrained objects,");
    527527        if (synchronousScrollingReasons & ScrollingCoordinator::IsImageDocument)
    528             reasonsDescription.append("image document,");
     528            reasonsDescription.appendLiteral("image document,");
    529529
    530530        // Strip the trailing comma.
  • trunk/Source/WebCore/platform/PODInterval.h

    r159159 r173212  
    145145        builder.append(", maxHigh=");
    146146        builder.append(ValueToString<T>::string(maxHigh()));
    147         builder.append("]");
     147        builder.append(']');
    148148        return builder.toString();
    149149    }
  • trunk/Source/WebCore/platform/PODRedBlackTree.h

    r162139 r173212  
    793793        StringBuilder builder;
    794794        for (int i = 0; i < indentation; i++)
    795             builder.append(" ");
    796         builder.append("-");
     795            builder.append(' ');
     796        builder.append('-');
    797797        if (node) {
    798             builder.append(" ");
     798            builder.append(' ');
    799799            builder.append(ValueToString<T>::string(node->data()));
    800800            builder.append((node->color() == Black) ? " (black)" : " (red)");
  • trunk/Source/WebCore/platform/UUID.cpp

    r149921 r173212  
    4747    builder.reserveCapacity(36);
    4848    appendUnsignedAsHexFixedSize(randomData[0], builder, 8, Lowercase);
    49     builder.append("-");
     49    builder.append('-');
    5050    appendUnsignedAsHexFixedSize(randomData[1] >> 16, builder, 4, Lowercase);
    51     builder.append("-4");
     51    builder.appendLiteral("-4");
    5252    appendUnsignedAsHexFixedSize(randomData[1] & 0x00000fff, builder, 3, Lowercase);
    53     builder.append("-");
     53    builder.append('-');
    5454    appendUnsignedAsHexFixedSize((randomData[2] >> 30) | 0x8, builder, 1, Lowercase);
    5555    appendUnsignedAsHexFixedSize((randomData[2] >> 16) & 0x00000fff, builder, 3, Lowercase);
    56     builder.append("-");
     56    builder.append('-');
    5757    appendUnsignedAsHexFixedSize(randomData[2] & 0x0000ffff, builder, 4, Lowercase);
    5858    appendUnsignedAsHexFixedSize(randomData[3], builder, 8, Lowercase);
  • trunk/Source/WebCore/platform/network/ProxyServer.cpp

    r128014 r173212  
    3535    switch (proxyServer.type()) {
    3636    case ProxyServer::Direct:
    37         builder.append("DIRECT");
     37        builder.appendLiteral("DIRECT");
    3838        return;
    3939    case ProxyServer::HTTP:
    4040    case ProxyServer::HTTPS:
    41         builder.append("PROXY");
     41        builder.appendLiteral("PROXY");
    4242        break;
    4343    case ProxyServer::SOCKS:
    44         builder.append("SOCKS");
     44        builder.appendLiteral("SOCKS");
    4545        break;
    4646    }
     
    6464    for (size_t i = 0; i < proxyServers.size(); ++i) {
    6565        if (i)
    66             stringBuilder.append("; ");
     66            stringBuilder.appendLiteral("; ");
    6767
    6868        appendProxyServerString(stringBuilder, proxyServers[i]);
  • trunk/Source/WebCore/platform/text/DateTimeFormat.cpp

    r133301 r173212  
    258258   
    259259    if (literal.find('\'') == notFound) {
    260         buffer.append("'");
     260        buffer.append('\'');
    261261        buffer.append(literal);
    262         buffer.append("'");
     262        buffer.append('\'');
    263263        return;
    264264    }
     
    269269        else {
    270270            String escaped = literal.substring(i);
    271             escaped.replace(ASCIILiteral("'"), ASCIILiteral("''"));
    272             buffer.append("'");
     271            escaped.replace('\'', "''");
     272            buffer.append('\'');
    273273            buffer.append(escaped);
    274             buffer.append("'");
     274            buffer.append('\'');
    275275            return;
    276276        }
  • trunk/Source/WebCore/platform/text/PlatformLocale.cpp

    r162158 r173212  
    8282    zeroPaddedStringBuilder.reserveCapacity(width);
    8383    for (size_t i = string.length(); i < width; ++i)
    84         zeroPaddedStringBuilder.append("0");
     84        zeroPaddedStringBuilder.append('0');
    8585    zeroPaddedStringBuilder.append(string);
    8686    return zeroPaddedStringBuilder.toString();
     
    312312    builder.reserveCapacity(input.length());
    313313    if (isNegative)
    314         builder.append("-");
     314        builder.append('-');
    315315    for (unsigned i = startIndex; i < endIndex;) {
    316316        unsigned symbolIndex = matchedDecimalSymbolIndex(input, i);
  • trunk/Source/WebCore/platform/text/TextStream.cpp

    r173047 r173212  
    9292TextStream& TextStream::operator<<(float f)
    9393{
    94     m_text.append(String::numberToStringFixedWidth(f, 2));
     94    m_text.appendFixedWidthNumber(f, 2);
    9595    return *this;
    9696}
     
    9898TextStream& TextStream::operator<<(double d)
    9999{
    100     m_text.append(String::numberToStringFixedWidth(d, 2));
     100    m_text.appendFixedWidthNumber(d, 2);
    101101    return *this;
    102102}
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r173047 r173212  
    645645            }
    646646            if (value < 0) {
    647                 builder.append("-0");
     647                builder.appendLiteral("-0");
    648648                builder.appendNumber(-value); // -01 to -09
    649649                break;
  • trunk/Source/WebCore/testing/Internals.cpp

    r173012 r173212  
    12141214        FunctionExecutable* funcExecutable = reinterpret_cast<FunctionExecutable*>(executable);
    12151215        String inferredName = funcExecutable->inferredName().string();
    1216         result.append("function \"");
     1216        result.appendLiteral("function \"");
    12171217        result.append(inferredName);
    1218         result.append("\"");
     1218        result.append('"');
    12191219    } else if (executable->isEvalExecutable())
    1220         result.append("eval");
     1220        result.appendLiteral("eval");
    12211221    else {
    12221222        ASSERT(executable->isProgramExecutable());
    1223         result.append("program");
    1224     }
    1225 
    1226     result.append(" { ");
     1223        result.appendLiteral("program");
     1224    }
     1225
     1226    result.appendLiteral(" { ");
    12271227    result.appendNumber(startLine);
    1228     result.append(":");
     1228    result.append(':');
    12291229    result.appendNumber(startColumn);
    1230     result.append(" - ");
     1230    result.appendLiteral(" - ");
    12311231    result.appendNumber(endLine);
    1232     result.append(":");
     1232    result.append(':');
    12331233    result.appendNumber(endColumn);
    1234     result.append(" }");
     1234    result.appendLiteral(" }");
    12351235
    12361236    return result.toString();
     
    19971997
    19981998    StringBuilder result;
    1999     result.append("type=");
     1999    result.appendLiteral("type=");
    20002000    result.append(cursorTypeToString(cursor.type()));
    2001     result.append(" hotSpot=");
     2001    result.appendLiteral(" hotSpot=");
    20022002    result.appendNumber(cursor.hotSpot().x());
    2003     result.append(",");
     2003    result.append(',');
    20042004    result.appendNumber(cursor.hotSpot().y());
    20052005    if (cursor.image()) {
    20062006        FloatSize size = cursor.image()->size();
    2007         result.append(" image=");
     2007        result.appendLiteral(" image=");
    20082008        result.appendNumber(size.width());
    2009         result.append("x");
     2009        result.append('x');
    20102010        result.appendNumber(size.height());
    20112011    }
    20122012#if ENABLE(MOUSE_CURSOR_SCALE)
    20132013    if (cursor.imageScaleFactor() != 1) {
    2014         result.append(" scale=");
     2014        result.appendLiteral(" scale=");
    20152015        NumberToStringBuffer buffer;
    20162016        result.append(numberToFixedPrecisionString(cursor.imageScaleFactor(), 8, buffer, true));
Note: See TracChangeset for help on using the changeset viewer.