Changeset 126967 in webkit


Ignore:
Timestamp:
Aug 29, 2012 12:32:31 AM (12 years ago)
Author:
abarth@webkit.org
Message:

Deploy ASCIILiteral and StringBuilder in more places in WebCore
https://bugs.webkit.org/show_bug.cgi?id=95291

Reviewed by Benjamin Poulain.

I wanted to deploy ASCIILiteral in more places in WebCore, but there's
a bunch of code that should be using StringBuilder, which I couldn't
resist deploying as well.

  • Modules/mediastream/PeerConnection00.cpp:

(WebCore::PeerConnection00::createIceOptions):

  • bindings/js/JSBlobCustom.cpp:

(WebCore::JSBlobConstructor::constructJSBlob):

  • bindings/v8/V8LazyEventListener.cpp:

(WebCore::V8LazyEventListener::prepareListenerObject):

  • bindings/v8/custom/V8BlobCustom.cpp:

(WebCore::V8Blob::constructorCallback):

  • css/CSSCanvasValue.cpp:

(WebCore::CSSCanvasValue::customCssText):

  • css/CSSCrossfadeValue.cpp:

(WebCore::CSSCrossfadeValue::customCssText):

  • css/CSSPageRule.cpp:

(WebCore::CSSPageRule::selectorText):

  • css/CSSSelector.cpp:

(WebCore::CSSSelector::selectorText):

  • editing/EditorCommand.cpp:

(WebCore::executeToggleStyleInList):

  • editing/SmartReplaceICU.cpp:

(WebCore::getSmartSet):

  • editing/markup.cpp:

(WebCore::fillContainerFromString):

  • html/HTMLTitleElement.cpp:

(WebCore::HTMLTitleElement::text):

  • inspector/InspectorConsoleAgent.cpp:

(WebCore::InspectorConsoleAgent::didFailLoading):

  • page/EventSource.cpp:

(WebCore::EventSource::didReceiveResponse):

  • platform/blackberry/LocalizedStringsBlackBerry.cpp:

(WebCore::platformLanguage):

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::animationNameForTransition):

  • platform/network/blackberry/rss/RSSAtomParser.cpp:

(WebCore::RSSAtomParser::parseContent):

  • platform/sql/SQLiteDatabase.cpp:

(WebCore::SQLiteDatabase::open):
(WebCore::SQLiteDatabase::setFullsync):
(WebCore::SQLiteDatabase::maximumSize):
(WebCore::SQLiteDatabase::pageSize):
(WebCore::SQLiteDatabase::freeSpaceSize):
(WebCore::SQLiteDatabase::totalSize):
(WebCore::SQLiteDatabase::tableExists):
(WebCore::SQLiteDatabase::clearAllTables):
(WebCore::SQLiteDatabase::runVacuumCommand):
(WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
(WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum):

  • platform/win/FileSystemWin.cpp:

(WebCore::bundleName):
(WebCore::storageDirectory):

  • plugins/PluginStream.cpp:

(WebCore::PluginStream::startStream):

  • rendering/RenderMenuList.cpp:

(WebCore::RenderMenuList::setTextFromOption):

Location:
trunk/Source/WebCore
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126966 r126967  
     12012-08-28  Adam Barth  <abarth@webkit.org>
     2
     3        Deploy ASCIILiteral and StringBuilder in more places in WebCore
     4        https://bugs.webkit.org/show_bug.cgi?id=95291
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        I wanted to deploy ASCIILiteral in more places in WebCore, but there's
     9        a bunch of code that should be using StringBuilder, which I couldn't
     10        resist deploying as well.
     11
     12        * Modules/mediastream/PeerConnection00.cpp:
     13        (WebCore::PeerConnection00::createIceOptions):
     14        * bindings/js/JSBlobCustom.cpp:
     15        (WebCore::JSBlobConstructor::constructJSBlob):
     16        * bindings/v8/V8LazyEventListener.cpp:
     17        (WebCore::V8LazyEventListener::prepareListenerObject):
     18        * bindings/v8/custom/V8BlobCustom.cpp:
     19        (WebCore::V8Blob::constructorCallback):
     20        * css/CSSCanvasValue.cpp:
     21        (WebCore::CSSCanvasValue::customCssText):
     22        * css/CSSCrossfadeValue.cpp:
     23        (WebCore::CSSCrossfadeValue::customCssText):
     24        * css/CSSPageRule.cpp:
     25        (WebCore::CSSPageRule::selectorText):
     26        * css/CSSSelector.cpp:
     27        (WebCore::CSSSelector::selectorText):
     28        * editing/EditorCommand.cpp:
     29        (WebCore::executeToggleStyleInList):
     30        * editing/SmartReplaceICU.cpp:
     31        (WebCore::getSmartSet):
     32        * editing/markup.cpp:
     33        (WebCore::fillContainerFromString):
     34        * html/HTMLTitleElement.cpp:
     35        (WebCore::HTMLTitleElement::text):
     36        * inspector/InspectorConsoleAgent.cpp:
     37        (WebCore::InspectorConsoleAgent::didFailLoading):
     38        * page/EventSource.cpp:
     39        (WebCore::EventSource::didReceiveResponse):
     40        * platform/blackberry/LocalizedStringsBlackBerry.cpp:
     41        (WebCore::platformLanguage):
     42        * platform/graphics/GraphicsLayer.cpp:
     43        (WebCore::GraphicsLayer::animationNameForTransition):
     44        * platform/network/blackberry/rss/RSSAtomParser.cpp:
     45        (WebCore::RSSAtomParser::parseContent):
     46        * platform/sql/SQLiteDatabase.cpp:
     47        (WebCore::SQLiteDatabase::open):
     48        (WebCore::SQLiteDatabase::setFullsync):
     49        (WebCore::SQLiteDatabase::maximumSize):
     50        (WebCore::SQLiteDatabase::pageSize):
     51        (WebCore::SQLiteDatabase::freeSpaceSize):
     52        (WebCore::SQLiteDatabase::totalSize):
     53        (WebCore::SQLiteDatabase::tableExists):
     54        (WebCore::SQLiteDatabase::clearAllTables):
     55        (WebCore::SQLiteDatabase::runVacuumCommand):
     56        (WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
     57        (WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum):
     58        * platform/win/FileSystemWin.cpp:
     59        (WebCore::bundleName):
     60        (WebCore::storageDirectory):
     61        * plugins/PluginStream.cpp:
     62        (WebCore::PluginStream::startStream):
     63        * rendering/RenderMenuList.cpp:
     64        (WebCore::RenderMenuList::setTextFromOption):
     65
    1662012-08-29  Yoshifumi Inoue  <yosin@chromium.org>
    267
  • trunk/Source/WebCore/Modules/mediastream/PeerConnection00.cpp

    r118586 r126967  
    230230PassRefPtr<IceOptions> PeerConnection00::createIceOptions(const Dictionary& dictionary, ExceptionCode& ec)
    231231{
    232     String useCandidates = "";
     232    String useCandidates = emptyString();
    233233    dictionary.get("use_candidates", useCandidates);
    234234
  • trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp

    r125386 r126967  
    7777
    7878    String type;
    79     String endings = "transparent";
     79    String endings = ASCIILiteral("transparent");
    8080
    8181    if (exec->argumentCount() > 1) {
  • trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp

    r126399 r126967  
    146146    // By calling the function with 4 arguments, we create a setter on arguments object
    147147    // which would shadow property "3" on the prototype.
    148     String code = "(function() {" \
     148    String code = ASCIILiteral("(function() {" \
    149149        "with (this[2]) {" \
    150150        "with (this[1]) {" \
    151         "with (this[0]) {";
     151        "with (this[0]) {");
    152152    code.append("return function(");
    153153    code.append(m_eventParameterName);
     
    220220        toStringFunction = toStringTemplate->GetFunction();
    221221    if (!toStringFunction.IsEmpty()) {
    222         String toStringResult = "function ";
     222        String toStringResult = ASCIILiteral("function ");
    223223        toStringResult.append(m_functionName);
    224224        toStringResult.append("(");
  • trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp

    r126399 r126967  
    8080
    8181    String type;
    82     String endings = "transparent";
     82    String endings = ASCIILiteral("transparent");
    8383
    8484    if (args.Length() > 1) {
  • trunk/Source/WebCore/css/CSSCanvasValue.cpp

    r126926 r126967  
    3030#include "MemoryInstrumentation.h"
    3131#include "RenderObject.h"
     32#include <wtf/text/StringBuilder.h>
    3233
    3334namespace WebCore {
     
    4142String CSSCanvasValue::customCssText() const
    4243{
    43     String result = "-webkit-canvas(";
    44     result += m_name  + ")";
    45     return result;
     44    StringBuilder result;
     45    result.appendLiteral("-webkit-canvas(");
     46    result.append(m_name);
     47    result.append(')');
     48    return result.toString();
    4649}
    4750
  • trunk/Source/WebCore/css/CSSCrossfadeValue.cpp

    r126926 r126967  
    3636#include "StyleCachedImage.h"
    3737#include "StyleGeneratedImage.h"
     38#include <wtf/text/StringBuilder.h>
    3839
    3940namespace WebCore {
     
    8687String CSSCrossfadeValue::customCssText() const
    8788{
    88     String result = "-webkit-cross-fade(";
    89     result += m_fromValue->cssText() + ", ";
    90     result += m_toValue->cssText() + ", ";
    91     result += m_percentageValue->cssText();
    92     result += ")";
    93     return result;
     89    StringBuilder result;
     90    result.appendLiteral("-webkit-cross-fade(");
     91    result.append(m_fromValue->cssText());
     92    result.appendLiteral(", ");
     93    result.append(m_toValue->cssText());
     94    result.appendLiteral(", ");
     95    result.append(m_percentageValue->cssText());
     96    result.append(')');
     97    return result.toString();
    9498}
    9599
  • trunk/Source/WebCore/css/CSSPageRule.cpp

    r126656 r126967  
    5656String CSSPageRule::selectorText() const
    5757{
    58     String text = "@page";
     58    StringBuilder text;
     59    text.appendLiteral("@page");
    5960    const CSSSelector* selector = m_pageRule->selector();
    6061    if (selector) {
    6162        String pageSpecification = selector->selectorText();
    62         if (!pageSpecification.isEmpty() && pageSpecification != starAtom)
    63             text += " " + pageSpecification;
     63        if (!pageSpecification.isEmpty() && pageSpecification != starAtom) {
     64            text.append(' ');
     65            text.append(pageSpecification);
     66        }
    6467    }
    65     return text;
     68    return text.toString();
    6669}
    6770
  • trunk/Source/WebCore/css/CSSSelector.cpp

    r126926 r126967  
    3434#include <wtf/StdLibExtras.h>
    3535#include <wtf/Vector.h>
     36#include <wtf/text/StringBuilder.h>
    3637
    3738namespace WebCore {
     
    516517String CSSSelector::selectorText() const
    517518{
    518     String str = "";
     519    StringBuilder str;
    519520
    520521    const AtomicString& prefix = m_tag.prefix();
     
    522523    if (m_match == CSSSelector::None || !prefix.isNull() || localName != starAtom) {
    523524        if (prefix.isNull())
    524             str = localName;
     525            str.append(localName);
    525526        else {
    526             str = prefix.string();
    527             str.append("|");
     527            str.append(prefix.string());
     528            str.append('|');
    528529            str.append(localName);
    529530        }
     
    533534    while (true) {
    534535        if (cs->m_match == CSSSelector::Id) {
    535             str += "#";
     536            str.append('#');
    536537            serializeIdentifier(cs->value(), str);
    537538        } else if (cs->m_match == CSSSelector::Class) {
    538             str += ".";
     539            str.append('.');
    539540            serializeIdentifier(cs->value(), str);
    540541        } else if (cs->m_match == CSSSelector::PseudoClass || cs->m_match == CSSSelector::PagePseudoClass) {
    541             str += ":";
    542             str += cs->value();
     542            str.append(':');
     543            str.append(cs->value());
    543544
    544545            switch (cs->pseudoType()) {
    545546            case PseudoNot:
    546547                if (CSSSelectorList* selectorList = cs->selectorList())
    547                     str += selectorList->first()->selectorText();
    548                 str += ")";
     548                    str.append(selectorList->first()->selectorText());
     549                str.append(')');
    549550                break;
    550551            case PseudoLang:
     
    553554            case PseudoNthOfType:
    554555            case PseudoNthLastOfType:
    555                 str += cs->argument();
    556                 str += ")";
     556                str.append(cs->argument());
     557                str.append(')');
    557558                break;
    558559            case PseudoAny: {
     
    560561                for (CSSSelector* subSelector = firstSubSelector; subSelector; subSelector = CSSSelectorList::next(subSelector)) {
    561562                    if (subSelector != firstSubSelector)
    562                         str += ",";
    563                     str += subSelector->selectorText();
     563                        str.append(',');
     564                    str.append(subSelector->selectorText());
    564565                }
    565                 str += ")";
     566                str.append(')');
    566567                break;
    567568            }
     
    570571            }
    571572        } else if (cs->m_match == CSSSelector::PseudoElement) {
    572             str += "::";
    573             str += cs->value();
     573            str.appendLiteral("::");
     574            str.append(cs->value());
    574575        } else if (cs->isAttributeSelector()) {
    575             str += "[";
     576            str.append('[');
    576577            const AtomicString& prefix = cs->attribute().prefix();
    577578            if (!prefix.isNull()) {
     
    579580                str.append("|");
    580581            }
    581             str += cs->attribute().localName();
     582            str.append(cs->attribute().localName());
    582583            switch (cs->m_match) {
    583584                case CSSSelector::Exact:
    584                     str += "=";
     585                    str.append('=');
    585586                    break;
    586587                case CSSSelector::Set:
    587588                    // set has no operator or value, just the attrName
    588                     str += "]";
     589                    str.append(']');
    589590                    break;
    590591                case CSSSelector::List:
    591                     str += "~=";
     592                    str.appendLiteral("~=");
    592593                    break;
    593594                case CSSSelector::Hyphen:
    594                     str += "|=";
     595                    str.appendLiteral("|=");
    595596                    break;
    596597                case CSSSelector::Begin:
    597                     str += "^=";
     598                    str.appendLiteral("^=");
    598599                    break;
    599600                case CSSSelector::End:
    600                     str += "$=";
     601                    str.appendLiteral("$=");
    601602                    break;
    602603                case CSSSelector::Contain:
    603                     str += "*=";
     604                    str.appendLiteral("*=");
    604605                    break;
    605606                default:
     
    608609            if (cs->m_match != CSSSelector::Set) {
    609610                serializeString(cs->value(), str);
    610                 str += "]";
     611                str.append(']');
    611612            }
    612613        }
     
    619620        String tagHistoryText = tagHistory->selectorText();
    620621        if (cs->relation() == CSSSelector::DirectAdjacent)
    621             str = tagHistoryText + " + " + str;
     622            return tagHistoryText + " + " + str.toString();
    622623        else if (cs->relation() == CSSSelector::IndirectAdjacent)
    623             str = tagHistoryText + " ~ " + str;
     624            return tagHistoryText + " ~ " + str.toString();
    624625        else if (cs->relation() == CSSSelector::Child)
    625             str = tagHistoryText + " > " + str;
     626            return tagHistoryText + " > " + str.toString();
    626627        else if (cs->relation() == CSSSelector::ShadowDescendant)
    627             str = tagHistoryText + str;
    628         else
     628            return tagHistoryText + str.toString();
     629        else {
    629630            // Descendant
    630             str = tagHistoryText + " " + str;
    631     }
    632 
    633     return str;
     631            return tagHistoryText + " " + str.toString();
     632        }
     633    }
     634
     635    return str.toString();
    634636}
    635637
  • trunk/Source/WebCore/editing/EditorCommand.cpp

    r124586 r126967  
    140140
    141141    RefPtr<CSSValue> selectedCSSValue = selectionStyle->style()->getPropertyCSSValue(propertyID);
    142     String newStyle = "none";
     142    String newStyle = ASCIILiteral("none");
    143143    if (selectedCSSValue->isValueList()) {
    144144        RefPtr<CSSValueList> selectedCSSValueList = static_cast<CSSValueList*>(selectedCSSValue.get());
  • trunk/Source/WebCore/editing/SmartReplaceICU.cpp

    r95901 r126967  
    5555        // Whitespace and newline (kCFCharacterSetWhitespaceAndNewline)
    5656        UErrorCode ec = U_ZERO_ERROR;
    57         String whitespaceAndNewline = "[[:WSpace:] [\\u000A\\u000B\\u000C\\u000D\\u0085]]";
     57        String whitespaceAndNewline = ASCIILiteral("[[:WSpace:] [\\u000A\\u000B\\u000C\\u000D\\u0085]]");
    5858        smartSet = uset_openPattern(whitespaceAndNewline.characters(), whitespaceAndNewline.length(), &ec);
    5959        ASSERT(U_SUCCESS(ec));
     
    7272
    7373        if (isPreviousCharacter) {
    74             addAllCodePoints(smartSet, "([\"\'#$/-`{");
     74            addAllCodePoints(smartSet, ASCIILiteral("([\"\'#$/-`{"));
    7575            preSmartSet = smartSet;
    7676        } else {
    77             addAllCodePoints(smartSet, ")].,;:?\'!\"%*-/}");
     77            addAllCodePoints(smartSet, ASCIILiteral(")].,;:?\'!\"%*-/}"));
    7878
    7979            // Punctuation (kCFCharacterSetPunctuation)
    8080            UErrorCode ec = U_ZERO_ERROR;
    81             String punctuationClass = "[:P:]";
     81            String punctuationClass = ASCIILiteral("[:P:]");
    8282            USet* icuPunct = uset_openPattern(punctuationClass.characters(), punctuationClass.length(), &ec);
    8383            ASSERT(U_SUCCESS(ec));
  • trunk/Source/WebCore/editing/markup.cpp

    r123788 r126967  
    795795    Vector<String> tabList;
    796796    string.split('\t', true, tabList);
    797     String tabText = "";
     797    String tabText = emptyString();
    798798    bool first = true;
    799799    size_t numEntries = tabList.size();
     
    806806                paragraph->appendChild(createTabSpanElement(document, tabText), ec);
    807807                ASSERT(!ec);
    808                 tabText = "";
     808                tabText = emptyString();
    809809            }
    810810            RefPtr<Node> textNode = document->createTextNode(stringWithRebalancedWhitespace(s, first, i + 1 == numEntries));
  • trunk/Source/WebCore/html/HTMLTitleElement.cpp

    r126359 r126967  
    3030#include "StyleInheritedData.h"
    3131#include "Text.h"
     32#include <wtf/text/StringBuilder.h>
    3233
    3334namespace WebCore {
     
    7172String HTMLTitleElement::text() const
    7273{
    73     String val = "";
    74    
     74    StringBuilder result;
     75
    7576    for (Node *n = firstChild(); n; n = n->nextSibling()) {
    7677        if (n->isTextNode())
    77             val += toText(n)->data();
     78            result.append(toText(n)->data());
    7879    }
    7980
    80     return val;
     81    return result.toString();
    8182}
    8283
  • trunk/Source/WebCore/inspector/InspectorConsoleAgent.cpp

    r126926 r126967  
    250250    if (error.isCancellation()) // Report failures only.
    251251        return;
    252     String message = "Failed to load resource";
     252    String message = ASCIILiteral("Failed to load resource");
    253253    if (!error.localizedDescription().isEmpty())
    254254        message += ": " + error.localizedDescription();
  • trunk/Source/WebCore/page/EventSource.cpp

    r121195 r126967  
    5252#include "TextResourceDecoder.h"
    5353#include "ThreadableLoader.h"
     54#include <wtf/text/StringBuilder.h>
    5455
    5556namespace WebCore {
     
    211212        responseIsValid = charset.isEmpty() || equalIgnoringCase(charset, "UTF-8");
    212213        if (!responseIsValid) {
    213             String message = "EventSource's response has a charset (\"";
    214             message += charset;
    215             message += "\") that is not UTF-8. Aborting the connection.";
     214            StringBuilder message;
     215            message.appendLiteral("EventSource's response has a charset (\"");
     216            message.append(charset);
     217            message.appendLiteral("\") that is not UTF-8. Aborting the connection.");
    216218            // FIXME: We are missing the source line.
    217             scriptExecutionContext()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message);
     219            scriptExecutionContext()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message.toString());
    218220        }
    219221    } else {
    220222        // To keep the signal-to-noise ratio low, we only log 200-response with an invalid MIME type.
    221223        if (statusCode == 200 && !mimeTypeIsValid) {
    222             String message = "EventSource's response has a MIME type (\"";
    223             message += response.mimeType();
    224             message += "\") that is not \"text/event-stream\". Aborting the connection.";
     224            StringBuilder message;
     225            message.appendLiteral("EventSource's response has a MIME type (\"");
     226            message.append(response.mimeType());
     227            message.appendLiteral("\") that is not \"text/event-stream\". Aborting the connection.");
    225228            // FIXME: We are missing the source line.
    226             scriptExecutionContext()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message);
     229            scriptExecutionContext()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, message.toString());
    227230        }
    228231    }
  • trunk/Source/WebCore/platform/blackberry/LocalizedStringsBlackBerry.cpp

    r124636 r126967  
    6767    // However, we use '-' instead of '_' in WebCore (e.g. en_us should read en-us)
    6868    size_t underscorePosition = lang.find('_');
    69     String replaceWith = "-";
     69    String replaceWith = ASCIILiteral("-");
    7070    if (underscorePosition != notFound)
    7171        return lang.replace(underscorePosition, replaceWith.length(), replaceWith);
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r126816 r126967  
    3636#include "TextStream.h"
    3737#include <wtf/text/CString.h>
     38#include <wtf/text/StringBuilder.h>
    3839#include <wtf/text/WTFString.h>
    3940
     
    324325{
    325326    // | is not a valid identifier character in CSS, so this can never conflict with a keyframe identifier.
    326     String id = "-|transition";
     327    StringBuilder id;
     328    id.appendLiteral("-|transition");
    327329    id.append(static_cast<char>(property));
    328330    id.append('-');
    329     return id;
     331    return id.toString();
    330332}
    331333
  • trunk/Source/WebCore/platform/network/blackberry/rss/RSSAtomParser.cpp

    r126230 r126967  
    231231
    232232    BLACKBERRY_ASSERT(node);
     233    // Why does Blackberry have its own RSS parser?
     234    // FIXME: content should be a StringBuilder.
    233235    String content;
    234236    String type = "default";
  • trunk/Source/WebCore/platform/sql/SQLiteDatabase.cpp

    r125992 r126967  
    9494        m_openErrorMessage = "sqlite_open returned null";
    9595
    96     if (!SQLiteStatement(*this, "PRAGMA temp_store = MEMORY;").executeCommand())
     96    if (!SQLiteStatement(*this, ASCIILiteral("PRAGMA temp_store = MEMORY;")).executeCommand())
    9797        LOG_ERROR("SQLite database could not set temp_store to memory");
    9898
     
    141141{
    142142    if (fsync)
    143         executeCommand("PRAGMA fullfsync = 1;");
     143        executeCommand(ASCIILiteral("PRAGMA fullfsync = 1;"));
    144144    else
    145         executeCommand("PRAGMA fullfsync = 0;");
     145        executeCommand(ASCIILiteral("PRAGMA fullfsync = 0;"));
    146146}
    147147
     
    153153        MutexLocker locker(m_authorizerLock);
    154154        enableAuthorizer(false);
    155         SQLiteStatement statement(*this, "PRAGMA max_page_count");
     155        SQLiteStatement statement(*this, ASCIILiteral("PRAGMA max_page_count"));
    156156        maxPageCount = statement.getColumnInt64(0);
    157157        enableAuthorizer(true);
     
    195195        enableAuthorizer(false);
    196196       
    197         SQLiteStatement statement(*this, "PRAGMA page_size");
     197        SQLiteStatement statement(*this, ASCIILiteral("PRAGMA page_size"));
    198198        m_pageSize = statement.getColumnInt(0);
    199199       
     
    212212        enableAuthorizer(false);
    213213        // Note: freelist_count was added in SQLite 3.4.1.
    214         SQLiteStatement statement(*this, "PRAGMA freelist_count");
     214        SQLiteStatement statement(*this, ASCIILiteral("PRAGMA freelist_count"));
    215215        freelistCount = statement.getColumnInt64(0);
    216216        enableAuthorizer(true);
     
    227227        MutexLocker locker(m_authorizerLock);
    228228        enableAuthorizer(false);
    229         SQLiteStatement statement(*this, "PRAGMA page_count");
     229        SQLiteStatement statement(*this, ASCIILiteral("PRAGMA page_count"));
    230230        pageCount = statement.getColumnInt64(0);
    231231        enableAuthorizer(true);
     
    270270    if (!isOpen())
    271271        return false;
    272        
     272
    273273    String statement = "SELECT name FROM sqlite_master WHERE type = 'table' AND name = '" + tablename + "';";
    274    
     274
    275275    SQLiteStatement sql(*this, statement);
    276276    sql.prepare();
     
    280280void SQLiteDatabase::clearAllTables()
    281281{
    282     String query = "SELECT name FROM sqlite_master WHERE type='table';";
     282    String query = ASCIILiteral("SELECT name FROM sqlite_master WHERE type='table';");
    283283    Vector<String> tables;
    284284    if (!SQLiteStatement(*this, query).returnTextResults(0, tables)) {
     
    297297int SQLiteDatabase::runVacuumCommand()
    298298{
    299     if (!executeCommand("VACUUM;"))
     299    if (!executeCommand(ASCIILiteral("VACUUM;")))
    300300        LOG(SQLDatabase, "Unable to vacuum database - %s", lastErrorMsg());
    301301    return lastError();
     
    307307    enableAuthorizer(false);
    308308
    309     if (!executeCommand("PRAGMA incremental_vacuum"))
     309    if (!executeCommand(ASCIILiteral("PRAGMA incremental_vacuum")))
    310310        LOG(SQLDatabase, "Unable to run incremental vacuum - %s", lastErrorMsg());
    311311
     
    458458bool SQLiteDatabase::turnOnIncrementalAutoVacuum()
    459459{
    460     SQLiteStatement statement(*this, "PRAGMA auto_vacuum");
     460    SQLiteStatement statement(*this, ASCIILiteral("PRAGMA auto_vacuum"));
    461461    int autoVacuumMode = statement.getColumnInt(0);
    462462    int error = lastError();
     
    475475        return true;
    476476    case AutoVacuumFull:
    477         return executeCommand("PRAGMA auto_vacuum = 2");
     477        return executeCommand(ASCIILiteral("PRAGMA auto_vacuum = 2"));
    478478    case AutoVacuumNone:
    479479    default:
    480         if (!executeCommand("PRAGMA auto_vacuum = 2"))
     480        if (!executeCommand(ASCIILiteral("PRAGMA auto_vacuum = 2")))
    481481            return false;
    482482        runVacuumCommand();
  • trunk/Source/WebCore/platform/win/FileSystemWin.cpp

    r126926 r126967  
    199199static String bundleName()
    200200{
    201     static String name = "WebKit";
     201    DEFINE_STATIC_LOCAL(String, name, (ASCIILiteral("WebKit")));
    202202
    203203#if USE(CF)
     
    225225    String directory = String::adopt(buffer);
    226226
    227     static const String companyNameDirectory = "Apple Computer\\";
     227    DEFINE_STATIC_LOCAL(String, companyNameDirectory, (ASCIILiteral("Apple Computer\\")));
    228228    directory = pathByAppendingComponent(directory, companyNameDirectory + bundleName());
    229229    if (!makeAllDirectories(directory))
  • trunk/Source/WebCore/plugins/PluginStream.cpp

    r126926 r126967  
    141141    if (m_resourceResponse.isHTTP()) {
    142142        StringBuilder stringBuilder;
    143         String separator(": ");
     143        String separator = ASCIILiteral(": ");
    144144
    145145        String statusLine = "HTTP " + String::number(m_resourceResponse.httpStatusCode()) + " OK\n";
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r125644 r126967  
    213213
    214214    int i = select->optionToListIndex(optionIndex);
    215     String text = "";
     215    String text = emptyString();
    216216    if (i >= 0 && i < size) {
    217217        Element* element = listItems[i];
Note: See TracChangeset for help on using the changeset viewer.