Deploy ASCIILiteral hotness throughout WebCore
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2012 07:38:10 +0000 (07:38 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2012 07:38:10 +0000 (07:38 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95282

Reviewed by Eric Seidel.

As recommended by http://trac.webkit.org/wiki/EfficientStrings.
This patch converts all the DEFINE_STATIC_LOCAL Strings.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::openKeyCursor):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::openCursor):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::kind):
* css/CSSPropertySourceData.cpp:
(WebCore::CSSPropertySourceData::toString):
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* dom/MicroDataItemList.cpp:
(WebCore::MicroDataItemList::undefinedItemType):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::notifyFinished):
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::shouldAddNamespaceElement):
* html/FormController.cpp:
(WebCore::formStateSignature):
* html/HTMLTrackElement.cpp:
(WebCore::HTMLTrackElement::canLoadUrl):
* html/ImageInputType.cpp:
(WebCore::ImageInputType::appendFormData):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::getImageData):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
(WebCore::XSSAuditor::filterToken):
(WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
* inspector/InspectorCSSAgent.cpp:
(WebCore::computePseudoClassMask):
* inspector/InspectorDebuggerAgent.cpp:
(WebCore::InspectorDebuggerAgent::sourceMapURLForScript):
* inspector/InspectorIndexedDBAgent.cpp:
(WebCore):
* inspector/InspectorOverlay.cpp:
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::setPropertyText):
(WebCore::InspectorStyle::newLineAndWhitespaceDelimiters):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::notifyFinished):
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::didReceiveResponse):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::corsPolicyPreventedLoad):
* loader/icon/IconDatabase.cpp:
(WebCore::IconDatabase::defaultDatabaseFilename):
* page/ContentSecurityPolicy.cpp:
(WebCore::CSPDirectiveList::allowJavaScriptURLs):
(WebCore::CSPDirectiveList::allowInlineEventHandlers):
(WebCore::CSPDirectiveList::allowInlineScript):
(WebCore::CSPDirectiveList::allowInlineStyle):
(WebCore::CSPDirectiveList::allowEval):
(WebCore::CSPDirectiveList::allowScriptNonce):
(WebCore::CSPDirectiveList::allowScriptFromSource):
(WebCore::CSPDirectiveList::allowObjectFromSource):
(WebCore::CSPDirectiveList::allowChildFrameFromSource):
(WebCore::CSPDirectiveList::allowImageFromSource):
(WebCore::CSPDirectiveList::allowStyleFromSource):
(WebCore::CSPDirectiveList::allowFontFromSource):
(WebCore::CSPDirectiveList::allowMediaFromSource):
(WebCore::CSPDirectiveList::allowConnectToSource):
(WebCore::CSPDirectiveList::allowFormAction):
(WebCore::CSPDirectiveList::addDirective):
* page/Page.cpp:
(WebCore::Page::groupName):
* platform/animation/Animation.cpp:
(WebCore::Animation::initialAnimationName):
* platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp:
(WebCore::CookieDatabaseBackingStore::upgradeTableIfNeeded):
* platform/blackberry/RenderThemeBlackBerry.cpp:
(WebCore::RenderThemeBlackBerry::defaultGUIFont):
* platform/chromium/ClipboardUtilitiesChromium.cpp:
(WebCore::replaceNewlinesWithWindowsStyleNewlines):
* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::systemFont):
* platform/graphics/filters/CustomFilterCompiledProgram.cpp:
(WebCore):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::replaceNewlinesWithWindowsStyleNewlines):
* rendering/RenderThemeChromiumSkia.cpp:
(WebCore::RenderThemeChromiumSkia::defaultGUIFont):
* svg/SVGAngle.cpp:
(WebCore::SVGAngle::valueAsString):
* svg/SVGTransform.cpp:
(WebCore::SVGTransform::transformTypePrefixForParsing):
* xml/parser/XMLTokenizer.cpp:
(WebCore::XMLTokenizer::nextToken):
* xml/parser/XMLTreeBuilder.cpp:
(WebCore::XMLTreeBuilder::processXMLEntity):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126968 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBDatabase.cpp
Source/WebCore/Modules/indexeddb/IDBIndex.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/mediastream/MediaStreamTrack.cpp
Source/WebCore/css/CSSPropertySourceData.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/MicroDataItemList.cpp
Source/WebCore/dom/ScriptElement.cpp
Source/WebCore/editing/MarkupAccumulator.cpp
Source/WebCore/html/FormController.cpp
Source/WebCore/html/HTMLTrackElement.cpp
Source/WebCore/html/ImageInputType.cpp
Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
Source/WebCore/html/parser/XSSAuditor.cpp
Source/WebCore/inspector/InspectorCSSAgent.cpp
Source/WebCore/inspector/InspectorDebuggerAgent.cpp
Source/WebCore/inspector/InspectorIndexedDBAgent.cpp
Source/WebCore/inspector/InspectorOverlay.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/loader/ImageLoader.cpp
Source/WebCore/loader/MainResourceLoader.cpp
Source/WebCore/loader/TextTrackLoader.cpp
Source/WebCore/loader/icon/IconDatabase.cpp
Source/WebCore/page/ContentSecurityPolicy.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/platform/animation/Animation.cpp
Source/WebCore/platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp
Source/WebCore/platform/blackberry/RenderThemeBlackBerry.cpp
Source/WebCore/platform/chromium/ClipboardUtilitiesChromium.cpp
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/graphics/filters/CustomFilterCompiledProgram.cpp
Source/WebCore/platform/win/ClipboardUtilitiesWin.cpp
Source/WebCore/rendering/RenderThemeChromiumSkia.cpp
Source/WebCore/svg/SVGAngle.cpp
Source/WebCore/svg/SVGTransform.cpp
Source/WebCore/xml/parser/XMLTokenizer.cpp
Source/WebCore/xml/parser/XMLTreeBuilder.cpp

index d21e1ff..9f8c3f9 100644 (file)
@@ -1,3 +1,106 @@
+2012-08-29  Adam Barth  <abarth@webkit.org>
+
+        Deploy ASCIILiteral hotness throughout WebCore
+        https://bugs.webkit.org/show_bug.cgi?id=95282
+
+        Reviewed by Eric Seidel.
+
+        As recommended by http://trac.webkit.org/wiki/EfficientStrings.
+        This patch converts all the DEFINE_STATIC_LOCAL Strings.
+
+        * Modules/indexeddb/IDBDatabase.cpp:
+        (WebCore::IDBDatabase::transaction):
+        * Modules/indexeddb/IDBIndex.cpp:
+        (WebCore::IDBIndex::openCursor):
+        (WebCore::IDBIndex::openKeyCursor):
+        * Modules/indexeddb/IDBObjectStore.cpp:
+        (WebCore::IDBObjectStore::openCursor):
+        * Modules/mediastream/MediaStreamTrack.cpp:
+        (WebCore::MediaStreamTrack::kind):
+        * css/CSSPropertySourceData.cpp:
+        (WebCore::CSSPropertySourceData::toString):
+        * dom/Document.cpp:
+        (WebCore::Document::processHttpEquiv):
+        * dom/MicroDataItemList.cpp:
+        (WebCore::MicroDataItemList::undefinedItemType):
+        * dom/ScriptElement.cpp:
+        (WebCore::ScriptElement::notifyFinished):
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
+        * html/FormController.cpp:
+        (WebCore::formStateSignature):
+        * html/HTMLTrackElement.cpp:
+        (WebCore::HTMLTrackElement::canLoadUrl):
+        * html/ImageInputType.cpp:
+        (WebCore::ImageInputType::appendFormData):
+        * html/canvas/CanvasRenderingContext2D.cpp:
+        (WebCore::CanvasRenderingContext2D::getImageData):
+        * html/parser/XSSAuditor.cpp:
+        (WebCore::XSSAuditor::init):
+        (WebCore::XSSAuditor::filterToken):
+        (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::computePseudoClassMask):
+        * inspector/InspectorDebuggerAgent.cpp:
+        (WebCore::InspectorDebuggerAgent::sourceMapURLForScript):
+        * inspector/InspectorIndexedDBAgent.cpp:
+        (WebCore):
+        * inspector/InspectorOverlay.cpp:
+        * inspector/InspectorStyleSheet.cpp:
+        (WebCore::InspectorStyle::setPropertyText):
+        (WebCore::InspectorStyle::newLineAndWhitespaceDelimiters):
+        * loader/ImageLoader.cpp:
+        (WebCore::ImageLoader::notifyFinished):
+        * loader/MainResourceLoader.cpp:
+        (WebCore::MainResourceLoader::didReceiveResponse):
+        * loader/TextTrackLoader.cpp:
+        (WebCore::TextTrackLoader::corsPolicyPreventedLoad):
+        * loader/icon/IconDatabase.cpp:
+        (WebCore::IconDatabase::defaultDatabaseFilename):
+        * page/ContentSecurityPolicy.cpp:
+        (WebCore::CSPDirectiveList::allowJavaScriptURLs):
+        (WebCore::CSPDirectiveList::allowInlineEventHandlers):
+        (WebCore::CSPDirectiveList::allowInlineScript):
+        (WebCore::CSPDirectiveList::allowInlineStyle):
+        (WebCore::CSPDirectiveList::allowEval):
+        (WebCore::CSPDirectiveList::allowScriptNonce):
+        (WebCore::CSPDirectiveList::allowScriptFromSource):
+        (WebCore::CSPDirectiveList::allowObjectFromSource):
+        (WebCore::CSPDirectiveList::allowChildFrameFromSource):
+        (WebCore::CSPDirectiveList::allowImageFromSource):
+        (WebCore::CSPDirectiveList::allowStyleFromSource):
+        (WebCore::CSPDirectiveList::allowFontFromSource):
+        (WebCore::CSPDirectiveList::allowMediaFromSource):
+        (WebCore::CSPDirectiveList::allowConnectToSource):
+        (WebCore::CSPDirectiveList::allowFormAction):
+        (WebCore::CSPDirectiveList::addDirective):
+        * page/Page.cpp:
+        (WebCore::Page::groupName):
+        * platform/animation/Animation.cpp:
+        (WebCore::Animation::initialAnimationName):
+        * platform/blackberry/CookieDatabaseBackingStore/CookieDatabaseBackingStore.cpp:
+        (WebCore::CookieDatabaseBackingStore::upgradeTableIfNeeded):
+        * platform/blackberry/RenderThemeBlackBerry.cpp:
+        (WebCore::RenderThemeBlackBerry::defaultGUIFont):
+        * platform/chromium/ClipboardUtilitiesChromium.cpp:
+        (WebCore::replaceNewlinesWithWindowsStyleNewlines):
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::systemFont):
+        * platform/graphics/filters/CustomFilterCompiledProgram.cpp:
+        (WebCore):
+        * platform/win/ClipboardUtilitiesWin.cpp:
+        (WebCore::replaceNewlinesWithWindowsStyleNewlines):
+        * rendering/RenderThemeChromiumSkia.cpp:
+        (WebCore::RenderThemeChromiumSkia::defaultGUIFont):
+        * svg/SVGAngle.cpp:
+        (WebCore::SVGAngle::valueAsString):
+        * svg/SVGTransform.cpp:
+        (WebCore::SVGTransform::transformTypePrefixForParsing):
+        * xml/parser/XMLTokenizer.cpp:
+        (WebCore::XMLTokenizer::nextToken):
+        * xml/parser/XMLTreeBuilder.cpp:
+        (WebCore::XMLTreeBuilder::processXMLEntity):
+
 2012-08-28  Adam Barth  <abarth@webkit.org>
 
         Deploy ASCIILiteral and StringBuilder in more places in WebCore
index aa93e6a..b3f70ad 100644 (file)
@@ -263,7 +263,8 @@ PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* cont
 
 PassRefPtr<IDBTransaction> IDBDatabase::transaction(ScriptExecutionContext* context, PassRefPtr<DOMStringList> prpStoreNames, unsigned short mode, ExceptionCode& ec)
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric transaction modes are deprecated in IDBDatabase.transaction. Use \"readonly\" or \"readwrite\"."));
+    // FIXME: Is this thread-safe?
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Numeric transaction modes are deprecated in IDBDatabase.transaction. Use \"readonly\" or \"readwrite\".")));
     context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
     AtomicString modeString = IDBTransaction::modeToString(IDBTransaction::Mode(mode), ec);
     if (ec)
index 1e02d90..e37ef0b 100644 (file)
@@ -87,7 +87,8 @@ PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, Pas
 PassRefPtr<IDBRequest> IDBIndex::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec)
 {
     IDB_TRACE("IDBIndex::openCursor");
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBIndex.openCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\"."));
+    // FIXME: Is this thread-safe?
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Numeric direction values are deprecated in IDBIndex.openCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\".")));
     context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
     const String& directionString = IDBCursor::directionToString(direction, ec);
     if (ec)
@@ -170,7 +171,8 @@ PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context,
 PassRefPtr<IDBRequest> IDBIndex::openKeyCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> keyRange, unsigned short direction, ExceptionCode& ec)
 {
     IDB_TRACE("IDBIndex::openKeyCursor");
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\"."));
+    // FIXME: Is this thread-safe?
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Numeric direction values are deprecated in IDBIndex.openKeyCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\".")));
     context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
     const String& directionString = IDBCursor::directionToString(direction, ec);
     if (ec)
index c30a253..a7aa8a3 100644 (file)
@@ -519,7 +519,8 @@ PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* contex
 PassRefPtr<IDBRequest> IDBObjectStore::openCursor(ScriptExecutionContext* context, PassRefPtr<IDBKeyRange> range, unsigned short direction, ExceptionCode& ec)
 {
     IDB_TRACE("IDBObjectStore::openCursor");
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Numeric direction values are deprecated in IDBObjectStore.openCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\"."));
+    // FIXME: Is this thread-safe?
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Numeric direction values are deprecated in IDBObjectStore.openCursor. Use \"next\", \"nextunique\", \"prev\", or \"prevunique\".")));
     context->addConsoleMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage);
     const String& directionString = IDBCursor::directionToString(direction, ec);
     if (ec)
index fa071fe..210a2f3 100644 (file)
@@ -57,8 +57,8 @@ MediaStreamTrack::~MediaStreamTrack()
 
 String MediaStreamTrack::kind() const
 {
-    DEFINE_STATIC_LOCAL(String, audioKind, ("audio"));
-    DEFINE_STATIC_LOCAL(String, videoKind, ("video"));
+    DEFINE_STATIC_LOCAL(String, audioKind, (ASCIILiteral("audio")));
+    DEFINE_STATIC_LOCAL(String, videoKind, (ASCIILiteral("video")));
 
     switch (m_component->source()->type()) {
     case MediaStreamSource::TypeAudio:
index d17ac8d..96fa121 100644 (file)
@@ -88,8 +88,8 @@ CSSPropertySourceData::CSSPropertySourceData()
 
 String CSSPropertySourceData::toString() const
 {
-    DEFINE_STATIC_LOCAL(String, emptyValue, ("e"));
-    DEFINE_STATIC_LOCAL(String, importantSuffix, (" !important"));
+    DEFINE_STATIC_LOCAL(String, emptyValue, (ASCIILiteral("e")));
+    DEFINE_STATIC_LOCAL(String, importantSuffix, (ASCIILiteral(" !important")));
     if (!name && value == emptyValue)
         return String();
 
index 91fa2e8..beb6359 100644 (file)
@@ -3063,7 +3063,7 @@ void Document::processHttpEquiv(const String& equiv, const String& content)
                 frameLoader->stopAllLoaders();
                 frame->navigationScheduler()->scheduleLocationChange(securityOrigin(), blankURL(), String());
 
-                DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to display document because display forbidden by X-Frame-Options.\n"));
+                DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to display document because display forbidden by X-Frame-Options.\n")));
                 addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
             }
         }
index 38460ce..534c0d0 100644 (file)
@@ -41,6 +41,7 @@ using namespace HTMLNames;
 const String& MicroDataItemList::undefinedItemType()
 {
     DEFINE_STATIC_LOCAL(String, undefinedItemTypeString, (""));
+    // FIXME: Why not just return emptyString(); ?
     return undefinedItemTypeString;
 }
 
index 62e8230..209fc79 100644 (file)
@@ -335,7 +335,7 @@ void ScriptElement::notifyFinished(CachedResource* resource)
         && !m_cachedScript->passesAccessControlCheck(m_element->document()->securityOrigin())) {
 
         dispatchErrorEvent();
-        DEFINE_STATIC_LOCAL(String, consoleMessage, ("Cross-origin script load denied by Cross-Origin Resource Sharing policy."));
+        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin script load denied by Cross-Origin Resource Sharing policy.")));
         m_element->document()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
         return;
     }
index ca3c249..2df114c 100644 (file)
@@ -235,7 +235,7 @@ bool MarkupAccumulator::shouldAddNamespaceElement(const Element* element)
     if (prefix.isEmpty())
         return !element->hasAttribute(xmlnsAtom);
 
-    DEFINE_STATIC_LOCAL(String, xmlnsWithColon, ("xmlns:"));
+    DEFINE_STATIC_LOCAL(String, xmlnsWithColon, (ASCIILiteral("xmlns:")));
     return !element->hasAttribute(xmlnsWithColon + prefix);
 }
 
index e35eff1..49412be 100644 (file)
@@ -391,7 +391,7 @@ static String formStateSignature()
     // In the legacy version of serialized state, the first item was a name
     // attribute value of a form control. The following string literal should
     // contain some characters which are rarely used for name attribute values.
-    DEFINE_STATIC_LOCAL(String, signature, ("\n\r?% WebKit serialized form state version 7 \n\r=&"));
+    DEFINE_STATIC_LOCAL(String, signature, (ASCIILiteral("\n\r?% WebKit serialized form state version 7 \n\r=&")));
     return signature;
 }
 
index b31662c..6c6c9e4 100644 (file)
@@ -234,7 +234,7 @@ bool HTMLTrackElement::canLoadUrl(const KURL& url)
         return false;
 
     if (!document()->contentSecurityPolicy()->allowMediaFromSource(url)) {
-        DEFINE_STATIC_LOCAL(String, consoleMessage, ("Text track load denied by Content Security Policy."));
+        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Text track load denied by Content Security Policy.")));
         document()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
         LOG(Media, "HTMLTrackElement::canLoadUrl(%s) -> rejected by Content Security Policy", urlForLogging(url).utf8().data());
         return false;
index af4cc90..1101547 100644 (file)
@@ -68,8 +68,8 @@ bool ImageInputType::appendFormData(FormDataList& encoding, bool) const
         return true;
     }
 
-    DEFINE_STATIC_LOCAL(String, dotXString, (".x"));
-    DEFINE_STATIC_LOCAL(String, dotYString, (".y"));
+    DEFINE_STATIC_LOCAL(String, dotXString, (ASCIILiteral(".x")));
+    DEFINE_STATIC_LOCAL(String, dotYString, (ASCIILiteral(".y")));
     encoding.appendData(name + dotXString, m_clickLocation.x());
     encoding.appendData(name + dotYString, m_clickLocation.y());
 
index 34833c7..c6b7732 100644 (file)
@@ -1867,7 +1867,7 @@ PassRefPtr<ImageData> CanvasRenderingContext2D::webkitGetImageDataHD(float sx, f
 PassRefPtr<ImageData> CanvasRenderingContext2D::getImageData(ImageBuffer::CoordinateSystem coordinateSystem, float sx, float sy, float sw, float sh, ExceptionCode& ec) const
 {
     if (!canvas()->originClean()) {
-        DEFINE_STATIC_LOCAL(String, consoleMessage, ("Unable to get image data from canvas because the canvas has been tainted by cross-origin data."));
+        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Unable to get image data from canvas because the canvas has been tainted by cross-origin data.")));
         canvas()->document()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
         ec = SECURITY_ERR;
         return 0;
index 7c81647..822fa3a 100644 (file)
@@ -215,7 +215,7 @@ void XSSAuditor::init()
         m_decodedURL = String();
 
     if (DocumentLoader* documentLoader = m_parser->document()->frame()->loader()->documentLoader()) {
-        DEFINE_STATIC_LOCAL(String, XSSProtectionHeader, ("X-XSS-Protection"));
+        DEFINE_STATIC_LOCAL(String, XSSProtectionHeader, (ASCIILiteral("X-XSS-Protection")));
         m_xssProtection = parseXSSProtectionHeader(documentLoader->response().httpHeaderField(XSSProtectionHeader));
 
         FormData* httpBody = documentLoader->originalRequest().httpBody();
@@ -256,7 +256,7 @@ void XSSAuditor::filterToken(HTMLToken& token)
 
     if (didBlockScript) {
         // FIXME: Consider using a more helpful console message.
-        DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute a JavaScript script. Source code of script found within request.\n"));
+        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to execute a JavaScript script. Source code of script found within request.\n")));
         m_parser->document()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
 
         bool didBlockEntirePage = (m_xssProtection == XSSProtectionBlockEnabled);
@@ -433,7 +433,7 @@ bool XSSAuditor::filterFormToken(HTMLToken& token)
 
 bool XSSAuditor::eraseDangerousAttributesIfInjected(HTMLToken& token)
 {
-    DEFINE_STATIC_LOCAL(String, safeJavaScriptURL, ("javascript:void(0)"));
+    DEFINE_STATIC_LOCAL(String, safeJavaScriptURL, (ASCIILiteral("javascript:void(0)")));
 
     bool didBlockScript = false;
     for (size_t i = 0; i < token.attributes().size(); ++i) {
index 53a353f..ca0a4c5 100644 (file)
@@ -133,10 +133,10 @@ private:
 
 static unsigned computePseudoClassMask(InspectorArray* pseudoClassArray)
 {
-    DEFINE_STATIC_LOCAL(String, active, ("active"));
-    DEFINE_STATIC_LOCAL(String, hover, ("hover"));
-    DEFINE_STATIC_LOCAL(String, focus, ("focus"));
-    DEFINE_STATIC_LOCAL(String, visited, ("visited"));
+    DEFINE_STATIC_LOCAL(String, active, (ASCIILiteral("active")));
+    DEFINE_STATIC_LOCAL(String, hover, (ASCIILiteral("hover")));
+    DEFINE_STATIC_LOCAL(String, focus, (ASCIILiteral("focus")));
+    DEFINE_STATIC_LOCAL(String, visited, (ASCIILiteral("visited")));
     if (!pseudoClassArray || !pseudoClassArray->length())
         return PseudoNone;
 
index 1bc16f2..76c9c95 100644 (file)
@@ -594,7 +594,7 @@ PassRefPtr<Array<TypeBuilder::Debugger::CallFrame> > InspectorDebuggerAgent::cur
 
 String InspectorDebuggerAgent::sourceMapURLForScript(const Script& script)
 {
-    DEFINE_STATIC_LOCAL(String, sourceMapHttpHeader, ("X-SourceMap"));
+    DEFINE_STATIC_LOCAL(String, sourceMapHttpHeader, (ASCIILiteral("X-SourceMap")));
 
     String sourceMapURL = ContentSearchUtils::findSourceMapURL(script.source);
     if (!sourceMapURL.isEmpty())
index 33b21b4..87961d8 100644 (file)
@@ -366,10 +366,10 @@ static PassRefPtr<IDBKey> idbKeyFromInspectorObject(InspectorObject* key)
     if (!key->getString("type", &type))
         return 0;
 
-    DEFINE_STATIC_LOCAL(String, number, ("number"));
-    DEFINE_STATIC_LOCAL(String, string, ("string"));
-    DEFINE_STATIC_LOCAL(String, date, ("date"));
-    DEFINE_STATIC_LOCAL(String, array, ("array"));
+    DEFINE_STATIC_LOCAL(String, number, (ASCIILiteral("number")));
+    DEFINE_STATIC_LOCAL(String, string, (ASCIILiteral("string")));
+    DEFINE_STATIC_LOCAL(String, date, (ASCIILiteral("date")));
+    DEFINE_STATIC_LOCAL(String, array, (ASCIILiteral("array")));
 
     if (type == number) {
         double number;
index b6cd5f2..699eb4b 100644 (file)
@@ -232,7 +232,7 @@ void drawElementTitle(GraphicsContext* context, Node* node, RenderObject* render
     DEFINE_STATIC_LOCAL(Color, normalColor, (Color::black));
     DEFINE_STATIC_LOCAL(Color, pxAndBorderColor, (128, 128, 128));
 
-    DEFINE_STATIC_LOCAL(String, pxString, ("px"));
+    DEFINE_STATIC_LOCAL(String, pxString, (ASCIILiteral("px")));
     const static UChar timesUChar[] = { 0x0020, 0x00D7, 0x0020, 0 };
     DEFINE_STATIC_LOCAL(String, timesString, (timesUChar)); // &times; string
 
index 83b402d..9cca7ac 100644 (file)
@@ -325,7 +325,7 @@ PassRefPtr<TypeBuilder::Array<TypeBuilder::CSS::CSSComputedStyleProperty> > Insp
 bool InspectorStyle::setPropertyText(unsigned index, const String& propertyText, bool overwrite, String* oldText, ExceptionCode& ec)
 {
     ASSERT(m_parentStyleSheet);
-    DEFINE_STATIC_LOCAL(String, bogusPropertyName, ("-webkit-boguz-propertee"));
+    DEFINE_STATIC_LOCAL(String, bogusPropertyName, (ASCIILiteral("-webkit-boguz-propertee")));
 
     if (!m_parentStyleSheet->ensureParsedDataReady()) {
         ec = NOT_FOUND_ERR;
@@ -635,7 +635,7 @@ Vector<String> InspectorStyle::longhandProperties(const String& shorthandPropert
 
 NewLineAndWhitespace& InspectorStyle::newLineAndWhitespaceDelimiters() const
 {
-    DEFINE_STATIC_LOCAL(String, defaultPrefix, ("    "));
+    DEFINE_STATIC_LOCAL(String, defaultPrefix, (ASCIILiteral("    ")));
 
     if (m_formatAcquired)
         return m_format;
index 8745346..0523b3a 100644 (file)
@@ -279,7 +279,7 @@ void ImageLoader::notifyFinished(CachedResource* resource)
         m_hasPendingErrorEvent = true;
         errorEventSender().dispatchEventSoon(this);
 
-        DEFINE_STATIC_LOCAL(String, consoleMessage, ("Cross-origin image load denied by Cross-Origin Resource Sharing policy."));
+        DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin image load denied by Cross-Origin Resource Sharing policy.")));
         document()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
 
         ASSERT(!m_hasPendingLoadEvent);
index 0836d8c..d6a6072 100644 (file)
@@ -371,7 +371,7 @@ void MainResourceLoader::didReceiveResponse(const ResourceResponse& r)
         String content = it->second;
         if (m_frame->loader()->shouldInterruptLoadForXFrameOptions(content, r.url())) {
             InspectorInstrumentation::continueAfterXFrameOptionsDenied(m_frame.get(), documentLoader(), identifier(), r);
-            DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to display document because display forbidden by X-Frame-Options.\n"));
+            DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to display document because display forbidden by X-Frame-Options.\n")));
             m_frame->document()->domWindow()->console()->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
 
             cancel();
index 8355a4a..202570d 100644 (file)
@@ -114,7 +114,7 @@ void TextTrackLoader::didReceiveData(CachedResource* resource)
 
 void TextTrackLoader::corsPolicyPreventedLoad()
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Cross-origin text track load denied by Cross-Origin Resource Sharing policy."));
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Cross-origin text track load denied by Cross-Origin Resource Sharing policy.")));
     Document* document = static_cast<Document*>(m_scriptExecutionContext);
     document->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, consoleMessage);
     m_state = Failed;
index 710648f..40a7755 100644 (file)
@@ -910,7 +910,7 @@ String IconDatabase::databasePath() const
 
 String IconDatabase::defaultDatabaseFilename()
 {
-    DEFINE_STATIC_LOCAL(String, defaultDatabaseFilename, ("WebpageIcons.db"));
+    DEFINE_STATIC_LOCAL(String, defaultDatabaseFilename, (ASCIILiteral("WebpageIcons.db")));
     return defaultDatabaseFilename.isolatedCopy();
 }
 
index c77170d..1bf907f 100644 (file)
@@ -899,7 +899,7 @@ bool CSPDirectiveList::checkSourceAndReportViolation(SourceListDirective* direct
 
 bool CSPDirectiveList::allowJavaScriptURLs(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute JavaScript URL because it violates the following Content Security Policy directive: "));
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to execute JavaScript URL because it violates the following Content Security Policy directive: ")));
     if (reportingStatus == ContentSecurityPolicy::SendReport) {
         return (checkInlineAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, contextURL, contextLine)
                 && checkNonceAndReportViolation(m_scriptNonce.get(), String(), consoleMessage, contextURL, contextLine));
@@ -911,7 +911,7 @@ bool CSPDirectiveList::allowJavaScriptURLs(const String& contextURL, const WTF::
 
 bool CSPDirectiveList::allowInlineEventHandlers(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute inline event handler because it violates the following Content Security Policy directive: "));
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to execute inline event handler because it violates the following Content Security Policy directive: ")));
     if (reportingStatus == ContentSecurityPolicy::SendReport) {
         return (checkInlineAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, contextURL, contextLine)
                 && checkNonceAndReportViolation(m_scriptNonce.get(), String(), consoleMessage, contextURL, contextLine));
@@ -923,7 +923,7 @@ bool CSPDirectiveList::allowInlineEventHandlers(const String& contextURL, const
 
 bool CSPDirectiveList::allowInlineScript(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute inline script because it violates the following Content Security Policy directive: "));
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to execute inline script because it violates the following Content Security Policy directive: ")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkInlineAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, contextURL, contextLine) :
         checkInline(operativeDirective(m_scriptSrc.get()));
@@ -931,7 +931,7 @@ bool CSPDirectiveList::allowInlineScript(const String& contextURL, const WTF::Or
 
 bool CSPDirectiveList::allowInlineStyle(const String& contextURL, const WTF::OrdinalNumber& contextLine, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to apply inline style because it violates the following Content Security Policy directive: "));
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to apply inline style because it violates the following Content Security Policy directive: ")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkInlineAndReportViolation(operativeDirective(m_styleSrc.get()), consoleMessage, contextURL, contextLine) :
         checkInline(operativeDirective(m_styleSrc.get()));
@@ -939,7 +939,7 @@ bool CSPDirectiveList::allowInlineStyle(const String& contextURL, const WTF::Ord
 
 bool CSPDirectiveList::allowEval(PassRefPtr<ScriptCallStack> callStack, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to evaluate script because it violates the following Content Security Policy directive: "));
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to evaluate script because it violates the following Content Security Policy directive: ")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkEvalAndReportViolation(operativeDirective(m_scriptSrc.get()), consoleMessage, String(), WTF::OrdinalNumber::beforeFirst(), callStack) :
         checkEval(operativeDirective(m_scriptSrc.get()));
@@ -947,7 +947,7 @@ bool CSPDirectiveList::allowEval(PassRefPtr<ScriptCallStack> callStack, ContentS
 
 bool CSPDirectiveList::allowScriptNonce(const String& nonce, const String& contextURL, const WTF::OrdinalNumber& contextLine, const KURL& url) const
 {
-    DEFINE_STATIC_LOCAL(String, consoleMessage, ("Refused to execute script because it violates the following Content Security Policy directive: "));
+    DEFINE_STATIC_LOCAL(String, consoleMessage, (ASCIILiteral("Refused to execute script because it violates the following Content Security Policy directive: ")));
     if (url.isEmpty())
         return checkNonceAndReportViolation(m_scriptNonce.get(), nonce, consoleMessage, contextURL, contextLine);
     return checkNonceAndReportViolation(m_scriptNonce.get(), nonce, "Refused to load '" + url.string() + "' because it violates the following Content Security Policy directive: ", contextURL, contextLine);
@@ -962,7 +962,7 @@ bool CSPDirectiveList::allowPluginType(const String& type, const String& typeAtt
 
 bool CSPDirectiveList::allowScriptFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("script"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("script")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkSourceAndReportViolation(operativeDirective(m_scriptSrc.get()), url, type) :
         checkSource(operativeDirective(m_scriptSrc.get()), url);
@@ -970,7 +970,7 @@ bool CSPDirectiveList::allowScriptFromSource(const KURL& url, ContentSecurityPol
 
 bool CSPDirectiveList::allowObjectFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("object"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("object")));
     if (url.isBlankURL())
         return true;
     return reportingStatus == ContentSecurityPolicy::SendReport ?
@@ -980,7 +980,7 @@ bool CSPDirectiveList::allowObjectFromSource(const KURL& url, ContentSecurityPol
 
 bool CSPDirectiveList::allowChildFrameFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("frame"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("frame")));
     if (url.isBlankURL())
         return true;
     return reportingStatus == ContentSecurityPolicy::SendReport ?
@@ -990,7 +990,7 @@ bool CSPDirectiveList::allowChildFrameFromSource(const KURL& url, ContentSecurit
 
 bool CSPDirectiveList::allowImageFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("image"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("image")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkSourceAndReportViolation(operativeDirective(m_imgSrc.get()), url, type) :
         checkSource(operativeDirective(m_imgSrc.get()), url);
@@ -998,7 +998,7 @@ bool CSPDirectiveList::allowImageFromSource(const KURL& url, ContentSecurityPoli
 
 bool CSPDirectiveList::allowStyleFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("style"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("style")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkSourceAndReportViolation(operativeDirective(m_styleSrc.get()), url, type) :
         checkSource(operativeDirective(m_styleSrc.get()), url);
@@ -1006,7 +1006,7 @@ bool CSPDirectiveList::allowStyleFromSource(const KURL& url, ContentSecurityPoli
 
 bool CSPDirectiveList::allowFontFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("font"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("font")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkSourceAndReportViolation(operativeDirective(m_fontSrc.get()), url, type) :
         checkSource(operativeDirective(m_fontSrc.get()), url);
@@ -1014,7 +1014,7 @@ bool CSPDirectiveList::allowFontFromSource(const KURL& url, ContentSecurityPolic
 
 bool CSPDirectiveList::allowMediaFromSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("media"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("media")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkSourceAndReportViolation(operativeDirective(m_mediaSrc.get()), url, type) :
         checkSource(operativeDirective(m_mediaSrc.get()), url);
@@ -1022,7 +1022,7 @@ bool CSPDirectiveList::allowMediaFromSource(const KURL& url, ContentSecurityPoli
 
 bool CSPDirectiveList::allowConnectToSource(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("connect"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("connect")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkSourceAndReportViolation(operativeDirective(m_connectSrc.get()), url, type) :
         checkSource(operativeDirective(m_connectSrc.get()), url);
@@ -1036,7 +1036,7 @@ void CSPDirectiveList::gatherReportURIs(DOMStringList& list) const
 
 bool CSPDirectiveList::allowFormAction(const KURL& url, ContentSecurityPolicy::ReportingStatus reportingStatus) const
 {
-    DEFINE_STATIC_LOCAL(String, type, ("form"));
+    DEFINE_STATIC_LOCAL(String, type, (ASCIILiteral("form")));
     return reportingStatus == ContentSecurityPolicy::SendReport ?
         checkSourceAndReportViolation(m_formAction.get(), url, type) :
         checkSource(m_formAction.get(), url);
@@ -1166,21 +1166,21 @@ void CSPDirectiveList::applySandboxPolicy(const String& name, const String& sand
 
 void CSPDirectiveList::addDirective(const String& name, const String& value)
 {
-    DEFINE_STATIC_LOCAL(String, defaultSrc, ("default-src"));
-    DEFINE_STATIC_LOCAL(String, scriptSrc, ("script-src"));
-    DEFINE_STATIC_LOCAL(String, objectSrc, ("object-src"));
-    DEFINE_STATIC_LOCAL(String, frameSrc, ("frame-src"));
-    DEFINE_STATIC_LOCAL(String, imgSrc, ("img-src"));
-    DEFINE_STATIC_LOCAL(String, styleSrc, ("style-src"));
-    DEFINE_STATIC_LOCAL(String, fontSrc, ("font-src"));
-    DEFINE_STATIC_LOCAL(String, mediaSrc, ("media-src"));
-    DEFINE_STATIC_LOCAL(String, connectSrc, ("connect-src"));
-    DEFINE_STATIC_LOCAL(String, sandbox, ("sandbox"));
-    DEFINE_STATIC_LOCAL(String, reportURI, ("report-uri"));
+    DEFINE_STATIC_LOCAL(String, defaultSrc, (ASCIILiteral("default-src")));
+    DEFINE_STATIC_LOCAL(String, scriptSrc, (ASCIILiteral("script-src")));
+    DEFINE_STATIC_LOCAL(String, objectSrc, (ASCIILiteral("object-src")));
+    DEFINE_STATIC_LOCAL(String, frameSrc, (ASCIILiteral("frame-src")));
+    DEFINE_STATIC_LOCAL(String, imgSrc, (ASCIILiteral("img-src")));
+    DEFINE_STATIC_LOCAL(String, styleSrc, (ASCIILiteral("style-src")));
+    DEFINE_STATIC_LOCAL(String, fontSrc, (ASCIILiteral("font-src")));
+    DEFINE_STATIC_LOCAL(String, mediaSrc, (ASCIILiteral("media-src")));
+    DEFINE_STATIC_LOCAL(String, connectSrc, (ASCIILiteral("connect-src")));
+    DEFINE_STATIC_LOCAL(String, sandbox, (ASCIILiteral("sandbox")));
+    DEFINE_STATIC_LOCAL(String, reportURI, (ASCIILiteral("report-uri")));
 #if ENABLE(CSP_NEXT)
-    DEFINE_STATIC_LOCAL(String, formAction, ("form-action"));
-    DEFINE_STATIC_LOCAL(String, pluginTypes, ("plugin-types"));
-    DEFINE_STATIC_LOCAL(String, scriptNonce, ("script-nonce"));
+    DEFINE_STATIC_LOCAL(String, formAction, (ASCIILiteral("form-action")));
+    DEFINE_STATIC_LOCAL(String, pluginTypes, (ASCIILiteral("plugin-types")));
+    DEFINE_STATIC_LOCAL(String, scriptNonce, (ASCIILiteral("script-nonce")));
 #endif
 
     ASSERT(!name.isEmpty());
index 8c70f78..b8b8356 100644 (file)
@@ -392,6 +392,7 @@ void Page::setGroupName(const String& name)
 const String& Page::groupName() const
 {
     DEFINE_STATIC_LOCAL(String, nullString, ());
+    // FIXME: Why not just return String()?
     return m_group ? m_group->name() : nullString;
 }
 
index d397ae2..333f1d8 100644 (file)
@@ -136,7 +136,7 @@ bool Animation::animationsMatch(const Animation* o, bool matchPlayStates) const
 
 const String& Animation::initialAnimationName()
 {
-    DEFINE_STATIC_LOCAL(String, initialValue, ("none"));
+    DEFINE_STATIC_LOCAL(String, initialValue, (ASCIILiteral("none")));
     return initialValue;
 }
 
index 7d38d99..8d71f0d 100644 (file)
@@ -116,8 +116,8 @@ void CookieDatabaseBackingStore::upgradeTableIfNeeded(const String& databaseFiel
         }
 
         while (statement.step() == SQLResultRow) {
-            DEFINE_STATIC_LOCAL(String, creationTime, ("creationTime"));
-            DEFINE_STATIC_LOCAL(String, protocol, ("protocol"));
+            DEFINE_STATIC_LOCAL(String, creationTime, (ASCIILiteral("creationTime")));
+            DEFINE_STATIC_LOCAL(String, protocol, (ASCIILiteral("protocol")));
             String name = statement.getColumnText(1);
             if (name == creationTime)
                 creationTimeExists = true;
index 3bbb231..0688da8 100644 (file)
@@ -123,7 +123,7 @@ float RenderThemeBlackBerry::defaultFontSize = 16;
 // sizes (e.g. 15px). So we just use Arial for now.
 const String& RenderThemeBlackBerry::defaultGUIFont()
 {
-    DEFINE_STATIC_LOCAL(String, fontFace, ("Arial"));
+    DEFINE_STATIC_LOCAL(String, fontFace, (ASCIILiteral("Arial")));
     return fontFace;
 }
 
index e2ec9f1..04940fb 100644 (file)
@@ -50,7 +50,7 @@ WebKit::WebClipboard::Buffer currentPasteboardBuffer()
 #if OS(WINDOWS)
 void replaceNewlinesWithWindowsStyleNewlines(String& str)
 {
-    DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n"));
+    DEFINE_STATIC_LOCAL(String, windowsNewline, (ASCIILiteral("\r\n")));
     StringBuilder result;
     for (unsigned index = 0; index < str.length(); ++index) {
         if (str[index] != '\n' || (index > 0 && str[index - 1] == '\r'))
index 35dd46e..98c81c2 100644 (file)
@@ -1047,7 +1047,7 @@ void RenderThemeEfl::systemFont(int propId, FontDescription& fontDescription) co
 {
     // It was called by RenderEmbeddedObject::paintReplaced to render alternative string.
     // To avoid cairo_error while rendering, fontDescription should be passed.
-    DEFINE_STATIC_LOCAL(String, fontFace, ("Sans"));
+    DEFINE_STATIC_LOCAL(String, fontFace, (ASCIILiteral("Sans")));
     float fontSize = defaultFontSize;
 
     fontDescription.firstFamily().setFamily(fontFace);
index 1eabd7e..106f34f 100644 (file)
@@ -38,7 +38,7 @@
 
 namespace WebCore {
 
-#define SHADER(Src) (#Src)
+#define SHADER(Src) (ASCIILiteral(#Src))
 
 String CustomFilterCompiledProgram::defaultVertexShaderString()
 {
index 61e3621..a168179 100644 (file)
@@ -299,7 +299,7 @@ void markupToCFHTML(const String& markup, const String& srcURL, Vector<char>& re
 
 void replaceNewlinesWithWindowsStyleNewlines(String& str)
 {
-    DEFINE_STATIC_LOCAL(String, windowsNewline, ("\r\n"));
+    DEFINE_STATIC_LOCAL(String, windowsNewline, (ASCIILiteral("\r\n")));
     StringBuilder result;
     for (unsigned index = 0; index < str.length(); ++index) {
         if (str[index] != '\n' || (index > 0 && str[index - 1] == '\r'))
index 0a58af6..c70bdfb 100644 (file)
@@ -81,7 +81,7 @@ static const float defaultSearchFieldResultsButtonWidth = 18;
 // sizes (e.g. 15px). So, for now we just use Arial.
 const String& RenderThemeChromiumSkia::defaultGUIFont()
 {
-    DEFINE_STATIC_LOCAL(String, fontFace, ("Arial"));
+    DEFINE_STATIC_LOCAL(String, fontFace, (ASCIILiteral("Arial")));
     return fontFace;
 }
 
index e272162..97874d8 100644 (file)
@@ -114,15 +114,15 @@ String SVGAngle::valueAsString() const
 {
     switch (m_unitType) {
     case SVG_ANGLETYPE_DEG: {
-        DEFINE_STATIC_LOCAL(String, degString, ("deg"));
+        DEFINE_STATIC_LOCAL(String, degString, (ASCIILiteral("deg")));
         return String::number(m_valueInSpecifiedUnits) + degString;
     }
     case SVG_ANGLETYPE_RAD: {
-        DEFINE_STATIC_LOCAL(String, radString, ("rad"));
+        DEFINE_STATIC_LOCAL(String, radString, (ASCIILiteral("rad")));
         return String::number(m_valueInSpecifiedUnits) + radString;
     }
     case SVG_ANGLETYPE_GRAD: {
-        DEFINE_STATIC_LOCAL(String, gradString, ("grad"));
+        DEFINE_STATIC_LOCAL(String, gradString, (ASCIILiteral("grad")));
         return String::number(m_valueInSpecifiedUnits) + gradString;
     }
     case SVG_ANGLETYPE_UNSPECIFIED:
index 739e48c..e136366 100644 (file)
@@ -137,27 +137,27 @@ const String& SVGTransform::transformTypePrefixForParsing(SVGTransformType type)
     case SVG_TRANSFORM_UNKNOWN:
         return emptyString();
     case SVG_TRANSFORM_MATRIX: {
-        DEFINE_STATIC_LOCAL(String, matrixString, ("matrix("));
+        DEFINE_STATIC_LOCAL(String, matrixString, (ASCIILiteral("matrix(")));
         return matrixString;
     }
     case SVG_TRANSFORM_TRANSLATE: {
-        DEFINE_STATIC_LOCAL(String, translateString, ("translate("));
+        DEFINE_STATIC_LOCAL(String, translateString, (ASCIILiteral("translate(")));
         return translateString;
     }
     case SVG_TRANSFORM_SCALE: {
-        DEFINE_STATIC_LOCAL(String, scaleString, ("scale("));
+        DEFINE_STATIC_LOCAL(String, scaleString, (ASCIILiteral("scale(")));
         return scaleString;
     }
     case SVG_TRANSFORM_ROTATE: {
-        DEFINE_STATIC_LOCAL(String, rotateString, ("rotate("));
+        DEFINE_STATIC_LOCAL(String, rotateString, (ASCIILiteral("rotate(")));
         return rotateString;
     }    
     case SVG_TRANSFORM_SKEWX: {
-        DEFINE_STATIC_LOCAL(String, skewXString, ("skewX("));
+        DEFINE_STATIC_LOCAL(String, skewXString, (ASCIILiteral("skewX(")));
         return skewXString;
     }
     case SVG_TRANSFORM_SKEWY: {
-        DEFINE_STATIC_LOCAL(String, skewYString, ("skewY("));
+        DEFINE_STATIC_LOCAL(String, skewYString, (ASCIILiteral("skewY(")));
         return skewYString;
     }
     }
index 9e62e74..bb3e68c 100644 (file)
@@ -482,7 +482,7 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     END_STATE()
 
     XML_BEGIN_STATE(ProcessingInstructionTargetStartState) {
-        DEFINE_STATIC_LOCAL(String, xmlString, ("xml"));
+        DEFINE_STATIC_LOCAL(String, xmlString, (ASCIILiteral("xml")));
         // FIXME: this probably shouldn't be case-insensitive, but I don't know if people try capitalizing it ever.
         if (cc == 'x' || cc == 'X') {
             SegmentedString::LookAheadResult result = source.lookAheadIgnoringCase(xmlString);
@@ -523,7 +523,7 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     END_STATE()
 
     XML_BEGIN_STATE(XMLDeclBeforeVersionNameState) {
-        DEFINE_STATIC_LOCAL(String, versionString, ("version"));
+        DEFINE_STATIC_LOCAL(String, versionString, (ASCIILiteral("version")));
         if (isTokenizerWhitespace(cc))
             XML_ADVANCE_TO(XMLDeclBeforeVersionNameState);
         else {
@@ -542,7 +542,7 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     EQ_BEFORE_VALUE_STATES(XMLDeclAfterVersionNameState, XMLDeclBeforeVersionValueState, XMLDeclBeforeVersionOnePointState)
 
     XML_BEGIN_STATE(XMLDeclBeforeVersionOnePointState) {
-        DEFINE_STATIC_LOCAL(String, onePointString, ("1."));
+        DEFINE_STATIC_LOCAL(String, onePointString, (ASCIILiteral("1.")));
         SegmentedString::LookAheadResult result = source.lookAhead(onePointString);
         if (result == SegmentedString::DidMatch) {
             source.advanceAndASSERT('1');
@@ -583,8 +583,8 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     END_STATE()
 
     XML_BEGIN_STATE(XMLDeclBeforeEncodingNameState) {
-        DEFINE_STATIC_LOCAL(String, encodingString, ("encoding"));
-        DEFINE_STATIC_LOCAL(String, standaloneString, ("standalone"));
+        DEFINE_STATIC_LOCAL(String, encodingString, (ASCIILiteral("encoding")));
+        DEFINE_STATIC_LOCAL(String, standaloneString, (ASCIILiteral("standalone")));
         if (isTokenizerWhitespace(cc))
             XML_ADVANCE_TO(XMLDeclBeforeEncodingNameState);
         else if (cc == 'e') {
@@ -646,7 +646,7 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     END_STATE()
 
     XML_BEGIN_STATE(XMLDeclBeforeStandaloneNameState) {
-        DEFINE_STATIC_LOCAL(String, standaloneString, ("standalone"));
+        DEFINE_STATIC_LOCAL(String, standaloneString, (ASCIILiteral("standalone")));
         if (isTokenizerWhitespace(cc))
             XML_ADVANCE_TO(XMLDeclBeforeStandaloneNameState);
         else if (cc == 's') {
@@ -666,8 +666,8 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     EQ_BEFORE_VALUE_STATES(XMLDeclAfterStandaloneNameState, XMLDeclBeforeStandaloneValueState, XMLDeclStandaloneValueQuotedState)
 
     XML_BEGIN_STATE(XMLDeclStandaloneValueQuotedState) {
-        DEFINE_STATIC_LOCAL(String, yesString, ("yes\""));
-        DEFINE_STATIC_LOCAL(String, noString, ("no\""));
+        DEFINE_STATIC_LOCAL(String, yesString, (ASCIILiteral("yes\"")));
+        DEFINE_STATIC_LOCAL(String, noString, (ASCIILiteral("no\"")));
         if (cc == 'y') {
             SegmentedString::LookAheadResult result = source.lookAhead(yesString);
             if (result == SegmentedString::DidMatch) {
@@ -765,9 +765,9 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     END_STATE()
 
     XML_BEGIN_STATE(MarkupDeclarationOpenState) {
-        DEFINE_STATIC_LOCAL(String, dashDashString, ("--"));
-        DEFINE_STATIC_LOCAL(String, doctypeString, ("doctype"));
-        DEFINE_STATIC_LOCAL(String, cdataString, ("[CDATA["));
+        DEFINE_STATIC_LOCAL(String, dashDashString, (ASCIILiteral("--")));
+        DEFINE_STATIC_LOCAL(String, doctypeString, (ASCIILiteral("doctype")));
+        DEFINE_STATIC_LOCAL(String, cdataString, (ASCIILiteral("[CDATA[")));
         if (cc == '-') {
             SegmentedString::LookAheadResult result = source.lookAhead(dashDashString);
             if (result == SegmentedString::DidMatch) {
@@ -874,8 +874,8 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
             parseError();
             return emitEndOfFile(source);
         }
-        DEFINE_STATIC_LOCAL(String, publicString, ("public"));
-        DEFINE_STATIC_LOCAL(String, systemString, ("system"));
+        DEFINE_STATIC_LOCAL(String, publicString, (ASCIILiteral("public")));
+        DEFINE_STATIC_LOCAL(String, systemString, (ASCIILiteral("system")));
         if (cc == 'P' || cc == 'p') {
             SegmentedString::LookAheadResult result = source.lookAheadIgnoringCase(publicString);
             if (result == SegmentedString::DidMatch) {
@@ -1021,7 +1021,7 @@ bool XMLTokenizer::nextToken(SegmentedString& source, XMLToken& token)
     END_STATE()
 
     XML_BEGIN_STATE(CDATASectionState) {
-        DEFINE_STATIC_LOCAL(String, closeString, ("]]>"));
+        DEFINE_STATIC_LOCAL(String, closeString, (ASCIILiteral("]]>")));
         if (cc == ']') {
             SegmentedString::LookAheadResult result = source.lookAhead(closeString);
             if (result == SegmentedString::DidMatch) {
index 4cd3ac9..7dd8901 100644 (file)
@@ -334,11 +334,11 @@ void XMLTreeBuilder::processXMLEntity(const AtomicXMLToken& token)
     DEFINE_STATIC_LOCAL(AtomicString, gt, ("gt"));
     DEFINE_STATIC_LOCAL(AtomicString, lt, ("lt"));
     DEFINE_STATIC_LOCAL(AtomicString, quot, ("quot"));
-    DEFINE_STATIC_LOCAL(String, ampS, ("&"));
-    DEFINE_STATIC_LOCAL(String, aposS, ("'"));
-    DEFINE_STATIC_LOCAL(String, gtS, (">"));
-    DEFINE_STATIC_LOCAL(String, ltS, ("<"));
-    DEFINE_STATIC_LOCAL(String, quotS, ("\""));
+    DEFINE_STATIC_LOCAL(String, ampS, (ASCIILiteral("&")));
+    DEFINE_STATIC_LOCAL(String, aposS, (ASCIILiteral("'")));
+    DEFINE_STATIC_LOCAL(String, gtS, (ASCIILiteral(">")));
+    DEFINE_STATIC_LOCAL(String, ltS, (ASCIILiteral("<")));
+    DEFINE_STATIC_LOCAL(String, quotS, (ASCIILiteral("\"")));
 
     if (token.name() == amp)
         appendToText(ampS.characters(), 1);