Convert more static Strings to use ASCIILiteral
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2012 23:04:26 +0000 (23:04 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Aug 2012 23:04:26 +0000 (23:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95313

Reviewed by Eric Seidel.

This patch converts another swath of static strings to use ASCIILiteral
as recommended by http://trac.webkit.org/wiki/EfficientStrings.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::openKeyword):
(WebCore):
(WebCore::MediaSource::closedKeyword):
(WebCore::MediaSource::endedKeyword):
* Modules/mediasource/MediaSource.h:
(MediaSource):
* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::customHandlersStateString):
* Modules/notifications/Notification.cpp:
(WebCore::Notification::permissionString):
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::controlTypeName):
(WebCore::AccessibilityMediaControl::title):
(WebCore::AccessibilityMediaControlsContainer::elementTypeName):
(WebCore::AccessibilityMediaTimeline::helpText):
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::JSInspectorFrontendHost::platform):
(WebCore::JSInspectorFrontendHost::port):
* bindings/js/ScriptEventListener.cpp:
(WebCore::eventParameterName):
* bindings/v8/ScriptEventListener.cpp:
(WebCore::eventParameterName):
* css/CSSWrapShapes.cpp:
(WebCore::CSSWrapShapeRectangle::cssText):
(WebCore::CSSWrapShapeCircle::cssText):
(WebCore::CSSWrapShapeEllipse::cssText):
(WebCore::CSSWrapShapePolygon::cssText):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
* dom/Document.cpp:
(WebCore::Document::readyState):
* editing/MarkupAccumulator.cpp:
(WebCore::appendCharactersReplacingEntities):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
(WebCore::StyledMarkupAccumulator::styleNodeCloseTag):
(WebCore::StyledMarkupAccumulator::appendElement):
(WebCore::createMarkup):
* html/track/TextTrackCue.cpp:
(WebCore::startKeyword):
(WebCore::middleKeyword):
(WebCore::endKeyword):
(WebCore::verticalGrowingLeftKeyword):
(WebCore::verticalGrowingRightKeyword):
(WebCore::TextTrackCue::updateDisplayTree):
(WebCore::TextTrackCue::settingName):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::mediaLoadedKey):
(WebCore::DiagnosticLoggingKeys::mediaLoadingFailedKey):
(WebCore::DiagnosticLoggingKeys::pluginLoadedKey):
(WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey):
(WebCore::DiagnosticLoggingKeys::pageContainsPluginKey):
(WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey):
(WebCore::DiagnosticLoggingKeys::passKey):
(WebCore::DiagnosticLoggingKeys::failKey):
(WebCore::DiagnosticLoggingKeys::noopKey):
* page/PageVisibilityState.cpp:
(WebCore::pageVisibilityStateString):
* page/UserContentURLPattern.cpp:
(WebCore::UserContentURLPattern::parse):
* platform/KURLWTFURL.cpp:
(WebCore::KURL::string):
* platform/MIMETypeRegistry.cpp:
(WebCore::defaultMIMEType):
(WebCore::mimeTypeAssociationMap):
* platform/network/ContentTypeParser.cpp:
(WebCore::ContentTypeParser::parse):
* platform/network/win/DownloadBundleWin.cpp:
(WebCore::DownloadBundle::fileExtension):
* storage/StorageTracker.cpp:
(WebCore::StorageTracker::syncFileSystemAndTrackerDatabase):
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::constructFromString):

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

24 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/MediaSource.h
Source/WebCore/Modules/navigatorcontentutils/NavigatorContentUtils.cpp
Source/WebCore/Modules/notifications/Notification.cpp
Source/WebCore/accessibility/AccessibilityMediaControls.cpp
Source/WebCore/bindings/js/JSInspectorFrontendHostCustom.cpp
Source/WebCore/bindings/js/ScriptEventListener.cpp
Source/WebCore/bindings/v8/ScriptEventListener.cpp
Source/WebCore/css/CSSWrapShapes.cpp
Source/WebCore/css/StyleSheetContents.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/editing/MarkupAccumulator.cpp
Source/WebCore/editing/markup.cpp
Source/WebCore/html/track/TextTrackCue.cpp
Source/WebCore/page/DiagnosticLoggingKeys.cpp
Source/WebCore/page/PageVisibilityState.cpp
Source/WebCore/page/UserContentURLPattern.cpp
Source/WebCore/platform/KURLWTFURL.cpp
Source/WebCore/platform/MIMETypeRegistry.cpp
Source/WebCore/platform/network/ContentTypeParser.cpp
Source/WebCore/platform/network/win/DownloadBundleWin.cpp
Source/WebCore/storage/StorageTracker.cpp
Source/WebCore/svg/SVGAnimatedBoolean.cpp

index a911188..5376c71 100644 (file)
@@ -1,3 +1,88 @@
+2012-08-29  Adam Barth  <abarth@webkit.org>
+
+        Convert more static Strings to use ASCIILiteral
+        https://bugs.webkit.org/show_bug.cgi?id=95313
+
+        Reviewed by Eric Seidel.
+
+        This patch converts another swath of static strings to use ASCIILiteral
+        as recommended by http://trac.webkit.org/wiki/EfficientStrings.
+
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::openKeyword):
+        (WebCore):
+        (WebCore::MediaSource::closedKeyword):
+        (WebCore::MediaSource::endedKeyword):
+        * Modules/mediasource/MediaSource.h:
+        (MediaSource):
+        * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
+        (WebCore::customHandlersStateString):
+        * Modules/notifications/Notification.cpp:
+        (WebCore::Notification::permissionString):
+        * accessibility/AccessibilityMediaControls.cpp:
+        (WebCore::AccessibilityMediaControl::controlTypeName):
+        (WebCore::AccessibilityMediaControl::title):
+        (WebCore::AccessibilityMediaControlsContainer::elementTypeName):
+        (WebCore::AccessibilityMediaTimeline::helpText):
+        * bindings/js/JSInspectorFrontendHostCustom.cpp:
+        (WebCore::JSInspectorFrontendHost::platform):
+        (WebCore::JSInspectorFrontendHost::port):
+        * bindings/js/ScriptEventListener.cpp:
+        (WebCore::eventParameterName):
+        * bindings/v8/ScriptEventListener.cpp:
+        (WebCore::eventParameterName):
+        * css/CSSWrapShapes.cpp:
+        (WebCore::CSSWrapShapeRectangle::cssText):
+        (WebCore::CSSWrapShapeCircle::cssText):
+        (WebCore::CSSWrapShapeEllipse::cssText):
+        (WebCore::CSSWrapShapePolygon::cssText):
+        * css/StyleSheetContents.cpp:
+        (WebCore::StyleSheetContents::parseAuthorStyleSheet):
+        * dom/Document.cpp:
+        (WebCore::Document::readyState):
+        * editing/MarkupAccumulator.cpp:
+        (WebCore::appendCharactersReplacingEntities):
+        * editing/markup.cpp:
+        (WebCore::StyledMarkupAccumulator::appendStyleNodeOpenTag):
+        (WebCore::StyledMarkupAccumulator::styleNodeCloseTag):
+        (WebCore::StyledMarkupAccumulator::appendElement):
+        (WebCore::createMarkup):
+        * html/track/TextTrackCue.cpp:
+        (WebCore::startKeyword):
+        (WebCore::middleKeyword):
+        (WebCore::endKeyword):
+        (WebCore::verticalGrowingLeftKeyword):
+        (WebCore::verticalGrowingRightKeyword):
+        (WebCore::TextTrackCue::updateDisplayTree):
+        (WebCore::TextTrackCue::settingName):
+        * page/DiagnosticLoggingKeys.cpp:
+        (WebCore::DiagnosticLoggingKeys::mediaLoadedKey):
+        (WebCore::DiagnosticLoggingKeys::mediaLoadingFailedKey):
+        (WebCore::DiagnosticLoggingKeys::pluginLoadedKey):
+        (WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey):
+        (WebCore::DiagnosticLoggingKeys::pageContainsPluginKey):
+        (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey):
+        (WebCore::DiagnosticLoggingKeys::passKey):
+        (WebCore::DiagnosticLoggingKeys::failKey):
+        (WebCore::DiagnosticLoggingKeys::noopKey):
+        * page/PageVisibilityState.cpp:
+        (WebCore::pageVisibilityStateString):
+        * page/UserContentURLPattern.cpp:
+        (WebCore::UserContentURLPattern::parse):
+        * platform/KURLWTFURL.cpp:
+        (WebCore::KURL::string):
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::defaultMIMEType):
+        (WebCore::mimeTypeAssociationMap):
+        * platform/network/ContentTypeParser.cpp:
+        (WebCore::ContentTypeParser::parse):
+        * platform/network/win/DownloadBundleWin.cpp:
+        (WebCore::DownloadBundle::fileExtension):
+        * storage/StorageTracker.cpp:
+        (WebCore::StorageTracker::syncFileSystemAndTrackerDatabase):
+        * svg/SVGAnimatedBoolean.cpp:
+        (WebCore::SVGAnimatedBooleanAnimator::constructFromString):
+
 2012-08-29  David Hyatt  <hyatt@apple.com>
 
         [New Multicolumn] Rename methods to prepare for proper pagination of columns
index dac5d86..34fa15c 100644 (file)
@@ -55,6 +55,24 @@ MediaSource::MediaSource(ScriptExecutionContext* context)
     m_activeSourceBuffers = SourceBufferList::create(scriptExecutionContext(), m_asyncEventQueue.get());
 }
 
+const String& MediaSource::openKeyword()
+{
+    DEFINE_STATIC_LOCAL(const String, open, (ASCIILiteral("open")));
+    return open;
+}
+
+const String& MediaSource::closedKeyword()
+{
+    DEFINE_STATIC_LOCAL(const String, closed, (ASCIILiteral("closed")));
+    return closed;
+}
+
+const String& MediaSource::endedKeyword()
+{
+    DEFINE_STATIC_LOCAL(const String, ended, (ASCIILiteral("ended")));
+    return ended;
+}
+
 SourceBufferList* MediaSource::sourceBuffers()
 {
     return m_sourceBuffers.get();
index f748246..8bede03 100644 (file)
@@ -44,23 +44,9 @@ namespace WebCore {
 
 class MediaSource : public RefCounted<MediaSource>, public EventTarget, public ContextDestructionObserver {
 public:
-    static const String& openKeyword()
-    {
-        DEFINE_STATIC_LOCAL(const String, open, ("open"));
-        return open;
-    }
-
-    static const String& closedKeyword()
-    {
-        DEFINE_STATIC_LOCAL(const String, closed, ("closed"));
-        return closed;
-    }
-
-    static const String& endedKeyword()
-    {
-        DEFINE_STATIC_LOCAL(const String, ended, ("ended"));
-        return ended;
-    }
+    static const String& openKeyword();
+    static const String& closedKeyword();
+    static const String& endedKeyword();
 
     static PassRefPtr<MediaSource> create(ScriptExecutionContext*);
     virtual ~MediaSource() { }
index b6879bf..0bc7f12 100644 (file)
@@ -147,9 +147,9 @@ void NavigatorContentUtils::registerProtocolHandler(Navigator* navigator, const
 #if ENABLE(CUSTOM_SCHEME_HANDLER)
 static String customHandlersStateString(const NavigatorContentUtilsClient::CustomHandlersState state)
 {
-    DEFINE_STATIC_LOCAL(const String, newHandler, ("new"));
-    DEFINE_STATIC_LOCAL(const String, registeredHandler, ("registered"));
-    DEFINE_STATIC_LOCAL(const String, declinedHandler, ("declined"));
+    DEFINE_STATIC_LOCAL(const String, newHandler, (ASCIILiteral("new")));
+    DEFINE_STATIC_LOCAL(const String, registeredHandler, (ASCIILiteral("registered")));
+    DEFINE_STATIC_LOCAL(const String, declinedHandler, (ASCIILiteral("declined")));
 
     switch (state) {
     case NavigatorContentUtilsClient::CustomHandlersNew:
index 9248e1b..36a1c8c 100644 (file)
@@ -263,9 +263,10 @@ const String& Notification::permission(ScriptExecutionContext* context)
 
 const String& Notification::permissionString(NotificationClient::Permission permission)
 {
-    DEFINE_STATIC_LOCAL(const String, allowedPermission, ("granted"));
-    DEFINE_STATIC_LOCAL(const String, deniedPermission, ("denied"));
-    DEFINE_STATIC_LOCAL(const String, defaultPermission, ("default"));
+    DEFINE_STATIC_LOCAL(const String, allowedPermission, (ASCIILiteral("granted")));
+    DEFINE_STATIC_LOCAL(const String, deniedPermission, (ASCIILiteral("denied")));
+    DEFINE_STATIC_LOCAL(const String, defaultPermission, (ASCIILiteral("default")));
+
     switch (permission) {
     case NotificationClient::PermissionAllowed:
         return allowedPermission;
index 9778301..3d380df 100644 (file)
@@ -85,21 +85,21 @@ MediaControlElementType AccessibilityMediaControl::controlType() const
 
 String AccessibilityMediaControl::controlTypeName() const
 {
-    DEFINE_STATIC_LOCAL(const String, mediaEnterFullscreenButtonName, ("EnterFullscreenButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaExitFullscreenButtonName, ("ExitFullscreenButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaMuteButtonName, ("MuteButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaPlayButtonName, ("PlayButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaSeekBackButtonName, ("SeekBackButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaSeekForwardButtonName, ("SeekForwardButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaRewindButtonName, ("RewindButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaReturnToRealtimeButtonName, ("ReturnToRealtimeButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaUnMuteButtonName, ("UnMuteButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaPauseButtonName, ("PauseButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaStatusDisplayName, ("StatusDisplay"));
-    DEFINE_STATIC_LOCAL(const String, mediaCurrentTimeDisplay, ("CurrentTimeDisplay"));
-    DEFINE_STATIC_LOCAL(const String, mediaTimeRemainingDisplay, ("TimeRemainingDisplay"));
-    DEFINE_STATIC_LOCAL(const String, mediaShowClosedCaptionsButtonName, ("ShowClosedCaptionsButton"));
-    DEFINE_STATIC_LOCAL(const String, mediaHideClosedCaptionsButtonName, ("HideClosedCaptionsButton"));
+    DEFINE_STATIC_LOCAL(const String, mediaEnterFullscreenButtonName, (ASCIILiteral("EnterFullscreenButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaExitFullscreenButtonName, (ASCIILiteral("ExitFullscreenButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaMuteButtonName, (ASCIILiteral("MuteButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaPlayButtonName, (ASCIILiteral("PlayButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaSeekBackButtonName, (ASCIILiteral("SeekBackButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaSeekForwardButtonName, (ASCIILiteral("SeekForwardButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaRewindButtonName, (ASCIILiteral("RewindButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaReturnToRealtimeButtonName, (ASCIILiteral("ReturnToRealtimeButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaUnMuteButtonName, (ASCIILiteral("UnMuteButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaPauseButtonName, (ASCIILiteral("PauseButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaStatusDisplayName, (ASCIILiteral("StatusDisplay")));
+    DEFINE_STATIC_LOCAL(const String, mediaCurrentTimeDisplay, (ASCIILiteral("CurrentTimeDisplay")));
+    DEFINE_STATIC_LOCAL(const String, mediaTimeRemainingDisplay, (ASCIILiteral("TimeRemainingDisplay")));
+    DEFINE_STATIC_LOCAL(const String, mediaShowClosedCaptionsButtonName, (ASCIILiteral("ShowClosedCaptionsButton")));
+    DEFINE_STATIC_LOCAL(const String, mediaHideClosedCaptionsButtonName, (ASCIILiteral("HideClosedCaptionsButton")));
 
     switch (controlType()) {
     case MediaEnterFullscreenButton:
@@ -142,7 +142,7 @@ String AccessibilityMediaControl::controlTypeName() const
 
 String AccessibilityMediaControl::title() const
 {
-    DEFINE_STATIC_LOCAL(const String, controlsPanel, ("ControlsPanel"));
+    DEFINE_STATIC_LOCAL(const String, controlsPanel, (ASCIILiteral("ControlsPanel")));
 
     if (controlType() == MediaControlsPanel)
         return localizedMediaControlElementString(controlsPanel);
@@ -237,8 +237,8 @@ bool AccessibilityMediaControlsContainer::controllingVideoElement() const
 
 const String AccessibilityMediaControlsContainer::elementTypeName() const
 {
-    DEFINE_STATIC_LOCAL(const String, videoElement, ("VideoElement"));
-    DEFINE_STATIC_LOCAL(const String, audioElement, ("AudioElement"));
+    DEFINE_STATIC_LOCAL(const String, videoElement, (ASCIILiteral("VideoElement")));
+    DEFINE_STATIC_LOCAL(const String, audioElement, (ASCIILiteral("AudioElement")));
 
     if (controllingVideoElement())
         return videoElement;
@@ -273,7 +273,7 @@ String AccessibilityMediaTimeline::valueDescription() const
 
 String AccessibilityMediaTimeline::helpText() const
 {
-    DEFINE_STATIC_LOCAL(const String, slider, ("Slider"));
+    DEFINE_STATIC_LOCAL(const String, slider, (ASCIILiteral("Slider")));
     return localizedMediaControlElementHelpText(slider);
 }
 
index 338f4c4..2978dea 100644 (file)
@@ -54,19 +54,19 @@ namespace WebCore {
 JSValue JSInspectorFrontendHost::platform(ExecState* execState)
 {
 #if PLATFORM(MAC)
-    DEFINE_STATIC_LOCAL(const String, platform, ("mac"));
+    DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("mac")));
 #elif OS(WINDOWS)
-    DEFINE_STATIC_LOCAL(const String, platform, ("windows"));
+    DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("windows")));
 #elif OS(LINUX)
-    DEFINE_STATIC_LOCAL(const String, platform, ("linux"));
+    DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("linux")));
 #elif OS(FREEBSD)
-    DEFINE_STATIC_LOCAL(const String, platform, ("freebsd"));
+    DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("freebsd")));
 #elif OS(OPENBSD)
-    DEFINE_STATIC_LOCAL(const String, platform, ("openbsd"));
+    DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("openbsd")));
 #elif OS(SOLARIS)
-    DEFINE_STATIC_LOCAL(const String, platform, ("solaris"));
+    DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("solaris")));
 #else
-    DEFINE_STATIC_LOCAL(const String, platform, ("unknown"));
+    DEFINE_STATIC_LOCAL(const String, platform, (ASCIILiteral("unknown")));
 #endif
     return jsString(execState, platform);
 }
@@ -74,13 +74,13 @@ JSValue JSInspectorFrontendHost::platform(ExecState* execState)
 JSValue JSInspectorFrontendHost::port(ExecState* execState)
 {
 #if PLATFORM(QT)
-    DEFINE_STATIC_LOCAL(const String, port, ("qt"));
+    DEFINE_STATIC_LOCAL(const String, port, (ASCIILiteral("qt")));
 #elif PLATFORM(GTK)
-    DEFINE_STATIC_LOCAL(const String, port, ("gtk"));
+    DEFINE_STATIC_LOCAL(const String, port, (ASCIILiteral("gtk")));
 #elif PLATFORM(WX)
-    DEFINE_STATIC_LOCAL(const String, port, ("wx"));
+    DEFINE_STATIC_LOCAL(const String, port, (ASCIILiteral("wx")));
 #else
-    DEFINE_STATIC_LOCAL(const String, port, ("unknown"));
+    DEFINE_STATIC_LOCAL(const String, port, (ASCIILiteral("unknown")));
 #endif
     return jsString(execState, port);
 }
index 7216b6f..a7665e1 100644 (file)
@@ -47,8 +47,8 @@ namespace WebCore {
 
 static const String& eventParameterName(bool isSVGEvent)
 {
-    DEFINE_STATIC_LOCAL(const String, eventString, ("event"));
-    DEFINE_STATIC_LOCAL(const String, evtString, ("evt"));
+    DEFINE_STATIC_LOCAL(const String, eventString, (ASCIILiteral("event")));
+    DEFINE_STATIC_LOCAL(const String, evtString, (ASCIILiteral("evt")));
     return isSVGEvent ? evtString : eventString;
 }
 
index 08fa0ea..f42e5fb 100644 (file)
@@ -44,8 +44,8 @@ namespace WebCore {
 
 static const String& eventParameterName(bool isSVGEvent)
 {
-    DEFINE_STATIC_LOCAL(const String, eventString, ("event"));
-    DEFINE_STATIC_LOCAL(const String, evtString, ("evt"));
+    DEFINE_STATIC_LOCAL(const String, eventString, (ASCIILiteral("event")));
+    DEFINE_STATIC_LOCAL(const String, evtString, (ASCIILiteral("evt")));
     return isSVGEvent ? evtString : eventString;
 }
 
index 16ecc80..7750f2e 100644 (file)
@@ -39,30 +39,28 @@ namespace WebCore {
 
 String CSSWrapShapeRectangle::cssText() const
 {
-    DEFINE_STATIC_LOCAL(const String, rectangleParen, ("rectangle("));
-    DEFINE_STATIC_LOCAL(const String, comma, (", "));
-
     StringBuilder result;
     result.reserveCapacity(32);
-    result.append(rectangleParen);
+
+    result.appendLiteral("rectangle(");
 
     result.append(m_x->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_y->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_width->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_height->cssText());
 
     if (m_radiusX.get()) {
-        result.append(comma);
+        result.appendLiteral(", ");
         result.append(m_radiusX->cssText());
 
         if (m_radiusY.get()) {
-            result.append(comma);
+            result.appendLiteral(", ");
             result.append(m_radiusY->cssText());
         }
     }
@@ -74,18 +72,16 @@ String CSSWrapShapeRectangle::cssText() const
 
 String CSSWrapShapeCircle::cssText() const
 {
-    DEFINE_STATIC_LOCAL(const String, circleParen, ("circle("));
-    DEFINE_STATIC_LOCAL(const String, comma, (", "));
-
     StringBuilder result;
     result.reserveCapacity(32);
-    result.append(circleParen);
+
+    result.appendLiteral("circle(");
 
     result.append(m_centerX->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_centerY->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_radius->cssText());
     result.append(')');
@@ -95,21 +91,18 @@ String CSSWrapShapeCircle::cssText() const
 
 String CSSWrapShapeEllipse::cssText() const
 {
-    DEFINE_STATIC_LOCAL(const String, ellipseParen, ("ellipse("));
-    DEFINE_STATIC_LOCAL(const String, comma, (", "));
-
     StringBuilder result;
     result.reserveCapacity(32);
-    result.append(ellipseParen);
+    result.appendLiteral("ellipse(");
 
     result.append(m_centerX->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_centerY->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_radiusX->cssText());
-    result.append(comma);
+    result.appendLiteral(", ");
 
     result.append(m_radiusY->cssText());
     result.append(')');
@@ -119,25 +112,21 @@ String CSSWrapShapeEllipse::cssText() const
 
 String CSSWrapShapePolygon::cssText() const
 {
-    DEFINE_STATIC_LOCAL(const String, polygonParenEvenOdd, ("polygon(evenodd, "));
-    DEFINE_STATIC_LOCAL(const String, polygonParenNonZero, ("polygon(nonzero, "));
-    DEFINE_STATIC_LOCAL(const String, comma, (", "));
-    DEFINE_STATIC_LOCAL(const String, space, (" "));
-
     StringBuilder result;
     result.reserveCapacity(32);
+
     if (m_windRule == RULE_EVENODD)
-        result.append(polygonParenEvenOdd);
+        result.appendLiteral("polygon(evenodd, ");
     else
-        result.append(polygonParenNonZero);
+        result.appendLiteral("polygon(nonzero, ");
 
     ASSERT(!(m_values.size() % 2));
 
     for (unsigned i = 0; i < m_values.size(); i += 2) {
         if (i)
-            result.append(comma);
+            result.appendLiteral(", ");
         result.append(m_values.at(i)->cssText());
-        result.append(space);
+        result.append(' ');
         result.append(m_values.at(i + 1)->cssText());
     }
 
index 3eaa0da..f8d6321 100644 (file)
@@ -288,11 +288,10 @@ void StyleSheetContents::parseAuthorStyleSheet(const CachedCSSStyleSheet* cached
     }
     if (m_parserContext.needsSiteSpecificQuirks && isStrictParserMode(m_parserContext.mode)) {
         // Work around <https://bugs.webkit.org/show_bug.cgi?id=28350>.
-        DEFINE_STATIC_LOCAL(const String, slashKHTMLFixesDotCss, ("/KHTMLFixes.css"));
-        DEFINE_STATIC_LOCAL(const String, mediaWikiKHTMLFixesStyleSheet, ("/* KHTML fix stylesheet */\n/* work around the horizontal scrollbars */\n#column-content { margin-left: 0; }\n\n"));
+        DEFINE_STATIC_LOCAL(const String, mediaWikiKHTMLFixesStyleSheet, (ASCIILiteral("/* KHTML fix stylesheet */\n/* work around the horizontal scrollbars */\n#column-content { margin-left: 0; }\n\n")));
         // There are two variants of KHTMLFixes.css. One is equal to mediaWikiKHTMLFixesStyleSheet,
         // while the other lacks the second trailing newline.
-        if (baseURL().string().endsWith(slashKHTMLFixesDotCss) && !sheetText.isNull() && mediaWikiKHTMLFixesStyleSheet.startsWith(sheetText)
+        if (baseURL().string().endsWith("/KHTMLFixes.css") && !sheetText.isNull() && mediaWikiKHTMLFixesStyleSheet.startsWith(sheetText)
             && sheetText.length() >= mediaWikiKHTMLFixesStyleSheet.length() - 1) {
             clearRules();
             return;
index beb6359..090fc74 100644 (file)
@@ -1196,9 +1196,9 @@ PassRefPtr<Element> Document::createElementNS(const String& namespaceURI, const
 
 String Document::readyState() const
 {
-    DEFINE_STATIC_LOCAL(const String, loading, ("loading"));
-    DEFINE_STATIC_LOCAL(const String, interactive, ("interactive"));
-    DEFINE_STATIC_LOCAL(const String, complete, ("complete"));
+    DEFINE_STATIC_LOCAL(const String, loading, (ASCIILiteral("loading")));
+    DEFINE_STATIC_LOCAL(const String, interactive, (ASCIILiteral("interactive")));
+    DEFINE_STATIC_LOCAL(const String, complete, (ASCIILiteral("complete")));
 
     switch (m_readyState) {
     case Loading:
index 2df114c..7df038a 100644 (file)
@@ -47,11 +47,11 @@ using namespace HTMLNames;
 
 void appendCharactersReplacingEntities(StringBuilder& result, const UChar* content, size_t length, EntityMask entityMask)
 {
-    DEFINE_STATIC_LOCAL(const String, ampReference, ("&amp;"));
-    DEFINE_STATIC_LOCAL(const String, ltReference, ("&lt;"));
-    DEFINE_STATIC_LOCAL(const String, gtReference, ("&gt;"));
-    DEFINE_STATIC_LOCAL(const String, quotReference, ("&quot;"));
-    DEFINE_STATIC_LOCAL(const String, nbspReference, ("&nbsp;"));
+    DEFINE_STATIC_LOCAL(const String, ampReference, (ASCIILiteral("&amp;")));
+    DEFINE_STATIC_LOCAL(const String, ltReference, (ASCIILiteral("&lt;")));
+    DEFINE_STATIC_LOCAL(const String, gtReference, (ASCIILiteral("&gt;")));
+    DEFINE_STATIC_LOCAL(const String, quotReference, (ASCIILiteral("&quot;")));
+    DEFINE_STATIC_LOCAL(const String, nbspReference, (ASCIILiteral("&nbsp;")));
 
     static const EntityDescription entityMaps[] = {
         { '&', ampReference, EntityAmp },
index 9af1883..10eea01 100644 (file)
@@ -135,7 +135,7 @@ public:
 
 private:
     void appendStyleNodeOpenTag(StringBuilder&, StylePropertySet*, Document*, bool isBlock = false);
-    const String styleNodeCloseTag(bool isBlock = false);
+    const String& styleNodeCloseTag(bool isBlock = false);
     virtual void appendText(StringBuilder& out, Text*);
     String renderedText(const Node*, const Range*);
     String stringValueForRange(const Node*, const Range*);
@@ -191,18 +191,19 @@ void StyledMarkupAccumulator::appendStyleNodeOpenTag(StringBuilder& out, StylePr
 {
     // wrappingStyleForSerialization should have removed -webkit-text-decorations-in-effect
     ASSERT(propertyMissingOrEqualToNone(style, CSSPropertyWebkitTextDecorationsInEffect));
-    DEFINE_STATIC_LOCAL(const String, divStyle, ("<div style=\""));
-    DEFINE_STATIC_LOCAL(const String, styleSpanOpen, ("<span style=\""));
-    out.append(isBlock ? divStyle : styleSpanOpen);
+    if (isBlock)
+        out.appendLiteral("<div style=\"");
+    else
+        out.appendLiteral("<span style=\"");
     appendAttributeValue(out, style->asText(), document->isHTMLDocument());
     out.append('\"');
     out.append('>');
 }
 
-const String StyledMarkupAccumulator::styleNodeCloseTag(bool isBlock)
+const String& StyledMarkupAccumulator::styleNodeCloseTag(bool isBlock)
 {
-    DEFINE_STATIC_LOCAL(const String, divClose, ("</div>"));
-    DEFINE_STATIC_LOCAL(const String, styleSpanClose, ("</span>"));
+    DEFINE_STATIC_LOCAL(const String, divClose, (ASCIILiteral("</div>")));
+    DEFINE_STATIC_LOCAL(const String, styleSpanClose, (ASCIILiteral("</span>")));
     return isBlock ? divClose : styleSpanClose;
 }
 
@@ -328,8 +329,7 @@ void StyledMarkupAccumulator::appendElement(StringBuilder& out, Element* element
         }
 
         if (!newInlineStyle->isEmpty()) {
-            DEFINE_STATIC_LOCAL(const String, stylePrefix, (" style=\""));
-            out.append(stylePrefix);
+            out.appendLiteral(" style=\"");
             appendAttributeValue(out, newInlineStyle->style()->asText(), documentIsHTML);
             out.append('\"');
         }
@@ -549,7 +549,7 @@ static Node* highestAncestorToWrapMarkup(const Range* range, EAnnotateForInterch
 // FIXME: At least, annotation and style info should probably not be included in range.markupString()
 String createMarkup(const Range* range, Vector<Node*>* nodes, EAnnotateForInterchange shouldAnnotate, bool convertBlocksToInlines, EAbsoluteURLs shouldResolveURLs)
 {
-    DEFINE_STATIC_LOCAL(const String, interchangeNewlineString, ("<br class=\"" AppleInterchangeNewline "\">"));
+    DEFINE_STATIC_LOCAL(const String, interchangeNewlineString, (ASCIILiteral("<br class=\"" AppleInterchangeNewline "\">")));
 
     if (!range)
         return "";
index e79cd1d..8fd1996 100644 (file)
@@ -56,19 +56,19 @@ static const int autoSize = 0;
 
 static const String& startKeyword()
 {
-    DEFINE_STATIC_LOCAL(const String, start, ("start"));
+    DEFINE_STATIC_LOCAL(const String, start, (ASCIILiteral("start")));
     return start;
 }
 
 static const String& middleKeyword()
 {
-    DEFINE_STATIC_LOCAL(const String, middle, ("middle"));
+    DEFINE_STATIC_LOCAL(const String, middle, (ASCIILiteral("middle")));
     return middle;
 }
 
 static const String& endKeyword()
 {
-    DEFINE_STATIC_LOCAL(const String, end, ("end"));
+    DEFINE_STATIC_LOCAL(const String, end, (ASCIILiteral("end")));
     return end;
 }
 
@@ -79,13 +79,13 @@ static const String& horizontalKeyword()
 
 static const String& verticalGrowingLeftKeyword()
 {
-    DEFINE_STATIC_LOCAL(const String, verticalrl, ("rl"));
+    DEFINE_STATIC_LOCAL(const String, verticalrl, (ASCIILiteral("rl")));
     return verticalrl;
 }
 
 static const String& verticalGrowingRightKeyword()
 {
-    DEFINE_STATIC_LOCAL(const String, verticallr, ("lr"));
+    DEFINE_STATIC_LOCAL(const String, verticallr, (ASCIILiteral("lr")));
     return verticallr;
 }
 
@@ -650,7 +650,7 @@ void TextTrackCue::updateDisplayTree(float movieTime)
 {
     // The display tree may contain WebVTT timestamp objects representing
     // timestamps (processing instructions), along with displayable nodes.
-    DEFINE_STATIC_LOCAL(const String, timestampTag, ("timestamp"));
+    DEFINE_STATIC_LOCAL(const String, timestampTag, (ASCIILiteral("timestamp")));
 
     DEFINE_STATIC_LOCAL(const AtomicString, trackPastNodesShadowPseudoId, ("-webkit-media-text-track-past-nodes"));
     DEFINE_STATIC_LOCAL(const AtomicString, trackFutureNodesShadowPseudoId, ("-webkit-media-text-track-future-nodes"));
@@ -786,11 +786,11 @@ std::pair<double, double> TextTrackCue::getPositionCoordinates() const
 
 TextTrackCue::CueSetting TextTrackCue::settingName(const String& name)
 {
-    DEFINE_STATIC_LOCAL(const String, verticalKeyword, ("vertical"));
-    DEFINE_STATIC_LOCAL(const String, lineKeyword, ("line"));
-    DEFINE_STATIC_LOCAL(const String, positionKeyword, ("position"));
-    DEFINE_STATIC_LOCAL(const String, sizeKeyword, ("size"));
-    DEFINE_STATIC_LOCAL(const String, alignKeyword, ("align"));
+    DEFINE_STATIC_LOCAL(const String, verticalKeyword, (ASCIILiteral("vertical")));
+    DEFINE_STATIC_LOCAL(const String, lineKeyword, (ASCIILiteral("line")));
+    DEFINE_STATIC_LOCAL(const String, positionKeyword, (ASCIILiteral("position")));
+    DEFINE_STATIC_LOCAL(const String, sizeKeyword, (ASCIILiteral("size")));
+    DEFINE_STATIC_LOCAL(const String, alignKeyword, (ASCIILiteral("align")));
 
     if (name == verticalKeyword)
         return Vertical;
index d71a605..ca54547 100644 (file)
@@ -30,55 +30,55 @@ namespace WebCore {
 
 const String& DiagnosticLoggingKeys::mediaLoadedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("mediaLoaded"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("mediaLoaded")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::mediaLoadingFailedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("mediaFailedLoading"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("mediaFailedLoading")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::pluginLoadedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("pluginLoaded"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pluginLoaded")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::pluginLoadingFailedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("pluginFailedLoading"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pluginFailedLoading")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::pageContainsPluginKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("pageContainsPlugin"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsPlugin")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("pageContainsAtLeastOnePlugin"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsAtLeastOnePlugin")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::passKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("pass"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pass")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::failKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("fail"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("fail")));
     return key;
 }
 
 const String& DiagnosticLoggingKeys::noopKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, ("noop"));
+    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("noop")));
     return key;
 }
 
index de1196e..d9f774e 100644 (file)
@@ -37,10 +37,10 @@ namespace WebCore {
 
 String pageVisibilityStateString(PageVisibilityState state)
 {
-    DEFINE_STATIC_LOCAL(const String, visible, ("visible"));
-    DEFINE_STATIC_LOCAL(const String, hidden, ("hidden"));
-    DEFINE_STATIC_LOCAL(const String, prerender, ("prerender"));
-    DEFINE_STATIC_LOCAL(const String, preview, ("preview"));
+    DEFINE_STATIC_LOCAL(const String, visible, (ASCIILiteral("visible")));
+    DEFINE_STATIC_LOCAL(const String, hidden, (ASCIILiteral("hidden")));
+    DEFINE_STATIC_LOCAL(const String, prerender, (ASCIILiteral("prerender")));
+    DEFINE_STATIC_LOCAL(const String, preview, (ASCIILiteral("preview")));
 
     switch (state) {
     case PageVisibilityStateVisible:
index 272284a..676b655 100644 (file)
@@ -61,7 +61,7 @@ bool UserContentURLPattern::matchesPatterns(const KURL& url, const Vector<String
 
 bool UserContentURLPattern::parse(const String& pattern)
 {
-    DEFINE_STATIC_LOCAL(const String, schemeSeparator, ("://"));
+    DEFINE_STATIC_LOCAL(const String, schemeSeparator, (ASCIILiteral("://")));
 
     size_t schemeEndPos = pattern.find(schemeSeparator);
     if (schemeEndPos == notFound)
index 6234419..ae2da1d 100644 (file)
@@ -110,12 +110,10 @@ bool KURL::isValid() const
     return isParsedURLValid;
 }
 
-const String &KURL::string() const
+const StringKURL::string() const
 {
-    if (isNull()) {
-        DEFINE_STATIC_LOCAL(const String, nullString, ());
-        return nullString;
-    }
+    if (isNull())
+        return nullAtom();
 
     if (isValid())
         return m_urlImpl->m_parsedURL.spec().string();
index 289c669..a198e85 100755 (executable)
@@ -623,7 +623,7 @@ HashSet<String>& MIMETypeRegistry::getUnsupportedTextMIMETypes()
 
 const String& defaultMIMEType()
 {
-    DEFINE_STATIC_LOCAL(const String, defaultMIMEType, ("application/octet-stream"));
+    DEFINE_STATIC_LOCAL(const String, defaultMIMEType, (ASCIILiteral("application/octet-stream")));
     return defaultMIMEType;
 }
 
@@ -637,50 +637,51 @@ static const MIMETypeAssociationMap& mimeTypeAssociationMap()
         return *mimeTypeMap;
 
     mimeTypeMap = new MIMETypeAssociationMap;
-    mimeTypeMap->add("image/x-ms-bmp", "image/bmp");
-    mimeTypeMap->add("image/x-windows-bmp", "image/bmp");
-    mimeTypeMap->add("image/x-bmp", "image/bmp");
-    mimeTypeMap->add("image/x-bitmap", "image/bmp");
-    mimeTypeMap->add("image/x-ms-bitmap", "image/bmp");
-    mimeTypeMap->add("image/jpg", "image/jpeg");
-    mimeTypeMap->add("image/pjpeg", "image/jpeg");
-    mimeTypeMap->add("image/x-png", "image/png");
-    mimeTypeMap->add("image/vnd.rim.png", "image/png");
-    mimeTypeMap->add("image/ico", "image/vnd.microsoft.icon");
-    mimeTypeMap->add("image/icon", "image/vnd.microsoft.icon");
-    mimeTypeMap->add("text/ico", "image/vnd.microsoft.icon");
-    mimeTypeMap->add("application/ico", "image/vnd.microsoft.icon");
-    mimeTypeMap->add("image/x-icon", "image/vnd.microsoft.icon");
-    mimeTypeMap->add("audio/vnd.qcelp", "audio/qcelp");
-    mimeTypeMap->add("audio/qcp", "audio/qcelp");
-    mimeTypeMap->add("audio/vnd.qcp", "audio/qcelp");
-    mimeTypeMap->add("audio/wav", "audio/x-wav");
-    mimeTypeMap->add("audio/mid", "audio/midi");
-    mimeTypeMap->add("audio/sp-midi", "audio/midi");
-    mimeTypeMap->add("audio/x-mid", "audio/midi");
-    mimeTypeMap->add("audio/x-midi", "audio/midi");
-    mimeTypeMap->add("audio/x-mpeg", "audio/mpeg");
-    mimeTypeMap->add("audio/mp3", "audio/mpeg");
-    mimeTypeMap->add("audio/x-mp3", "audio/mpeg");
-    mimeTypeMap->add("audio/mpeg3", "audio/mpeg");
-    mimeTypeMap->add("audio/x-mpeg3", "audio/mpeg");
-    mimeTypeMap->add("audio/mpg3", "audio/mpeg");
-    mimeTypeMap->add("audio/mpg", "audio/mpeg");
-    mimeTypeMap->add("audio/x-mpg", "audio/mpeg");
-    mimeTypeMap->add("audio/m4a", "audio/mp4");
-    mimeTypeMap->add("audio/x-m4a", "audio/mp4");
-    mimeTypeMap->add("audio/x-mp4", "audio/mp4");
-    mimeTypeMap->add("audio/x-aac", "audio/aac");
-    mimeTypeMap->add("audio/x-amr", "audio/amr");
-    mimeTypeMap->add("audio/mpegurl", "audio/x-mpegurl");
-    mimeTypeMap->add("audio/flac", "audio/x-flac");
-    mimeTypeMap->add("video/3gp", "video/3gpp");
-    mimeTypeMap->add("video/avi", "video/x-msvideo");
-    mimeTypeMap->add("video/x-m4v", "video/mp4");
-    mimeTypeMap->add("video/x-quicktime", "video/quicktime");
-    mimeTypeMap->add("application/java", "application/java-archive");
-    mimeTypeMap->add("application/x-java-archive", "application/java-archive");
-    mimeTypeMap->add("application/x-zip-compressed", "application/zip");
+
+    mimeTypeMap->add(ASCIILiteral("image/x-ms-bmp"), ASCIILiteral("image/bmp")));
+    mimeTypeMap->add(ASCIILiteral("image/x-windows-bmp"), ASCIILiteral("image/bmp"));
+    mimeTypeMap->add(ASCIILiteral("image/x-bmp"), ASCIILiteral("image/bmp"));
+    mimeTypeMap->add(ASCIILiteral("image/x-bitmap"), ASCIILiteral("image/bmp"));
+    mimeTypeMap->add(ASCIILiteral("image/x-ms-bitmap"), ASCIILiteral("image/bmp"));
+    mimeTypeMap->add(ASCIILiteral("image/jpg"), ASCIILiteral("image/jpeg"));
+    mimeTypeMap->add(ASCIILiteral("image/pjpeg"), ASCIILiteral("image/jpeg"));
+    mimeTypeMap->add(ASCIILiteral("image/x-png"), ASCIILiteral("image/png"));
+    mimeTypeMap->add(ASCIILiteral("image/vnd.rim.png"), ASCIILiteral("image/png"));
+    mimeTypeMap->add(ASCIILiteral("image/ico"), ASCIILiteral("image/vnd.microsoft.icon"));
+    mimeTypeMap->add(ASCIILiteral("image/icon"), ASCIILiteral("image/vnd.microsoft.icon"));
+    mimeTypeMap->add(ASCIILiteral("text/ico"), ASCIILiteral("image/vnd.microsoft.icon"));
+    mimeTypeMap->add(ASCIILiteral("application/ico"), ASCIILiteral("image/vnd.microsoft.icon"));
+    mimeTypeMap->add(ASCIILiteral("image/x-icon"), ASCIILiteral("image/vnd.microsoft.icon"));
+    mimeTypeMap->add(ASCIILiteral("audio/vnd.qcelp"), ASCIILiteral("audio/qcelp"));
+    mimeTypeMap->add(ASCIILiteral("audio/qcp"), ASCIILiteral("audio/qcelp"));
+    mimeTypeMap->add(ASCIILiteral("audio/vnd.qcp"), ASCIILiteral("audio/qcelp"));
+    mimeTypeMap->add(ASCIILiteral("audio/wav"), ASCIILiteral("audio/x-wav"));
+    mimeTypeMap->add(ASCIILiteral("audio/mid"), ASCIILiteral("audio/midi"));
+    mimeTypeMap->add(ASCIILiteral("audio/sp-midi"), ASCIILiteral("audio/midi"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-mid"), ASCIILiteral("audio/midi"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-midi"), ASCIILiteral("audio/midi"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-mpeg"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/mp3"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-mp3"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/mpeg3"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-mpeg3"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/mpg3"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/mpg"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-mpg"), ASCIILiteral("audio/mpeg"));
+    mimeTypeMap->add(ASCIILiteral("audio/m4a"), ASCIILiteral("audio/mp4"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-m4a"), ASCIILiteral("audio/mp4"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-mp4"), ASCIILiteral("audio/mp4"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-aac"), ASCIILiteral("audio/aac"));
+    mimeTypeMap->add(ASCIILiteral("audio/x-amr"), ASCIILiteral("audio/amr"));
+    mimeTypeMap->add(ASCIILiteral("audio/mpegurl"), ASCIILiteral("audio/x-mpegurl"));
+    mimeTypeMap->add(ASCIILiteral("audio/flac"), ASCIILiteral("audio/x-flac"));
+    mimeTypeMap->add(ASCIILiteral("video/3gp"), ASCIILiteral("video/3gpp"));
+    mimeTypeMap->add(ASCIILiteral("video/avi"), ASCIILiteral("video/x-msvideo"));
+    mimeTypeMap->add(ASCIILiteral("video/x-m4v"), ASCIILiteral("video/mp4"));
+    mimeTypeMap->add(ASCIILiteral("video/x-quicktime"), ASCIILiteral("video/quicktime"));
+    mimeTypeMap->add(ASCIILiteral("application/java"), ASCIILiteral("application/java-archive"));
+    mimeTypeMap->add(ASCIILiteral("application/x-java-archive"), ASCIILiteral("application/java-archive"));
+    mimeTypeMap->add(ASCIILiteral("application/x-zip-compressed"), ASCIILiteral("application/zip"));
 
     return *mimeTypeMap;
 }
index 6478d9b..dda4588 100644 (file)
@@ -157,7 +157,7 @@ size_t ContentTypeParser::parameterCount() const
 
 void ContentTypeParser::parse()
 {
-    DEFINE_STATIC_LOCAL(const String, contentTypeParameterName, ("Content-Type"));
+    DEFINE_STATIC_LOCAL(const String, contentTypeParameterName, (ASCIILiteral("Content-Type")));
 
     if (!m_contentType.startsWith(contentTypeParameterName)) {
         LOG_ERROR("Invalid Content-Type string '%s'", m_contentType.ascii().data());
index f0f3027..2b36195 100644 (file)
@@ -44,7 +44,7 @@ static UInt32 magicNumber()
 
 const String& fileExtension()
 {
-    DEFINE_STATIC_LOCAL(const String, extension, (".download"));
+    DEFINE_STATIC_LOCAL(const String, extension, (ASCIILiteral(".download")));
     return extension;
 }
 
index 0bb34b0..42a536f 100644 (file)
@@ -242,8 +242,8 @@ void StorageTracker::syncFileSystemAndTrackerDatabase()
     ASSERT(m_isActive);
 
     m_databaseGuard.lock();
-    DEFINE_STATIC_LOCAL(const String, fileMatchPattern, ("*.localstorage"));
-    DEFINE_STATIC_LOCAL(const String, fileExt, (".localstorage"));
+    DEFINE_STATIC_LOCAL(const String, fileMatchPattern, (ASCIILiteral("*.localstorage")));
+    DEFINE_STATIC_LOCAL(const String, fileExt, (ASCIILiteral(".localstorage")));
     static const unsigned fileExtLength = fileExt.length();
     m_databaseGuard.unlock();
 
index f9858be..73f72e6 100644 (file)
@@ -31,16 +31,10 @@ SVGAnimatedBooleanAnimator::SVGAnimatedBooleanAnimator(SVGAnimationElement* anim
 {
 }
 
-static inline bool isTrueString(const String& string)
-{
-    DEFINE_STATIC_LOCAL(const String, trueString, ("true"));
-    return string == trueString;
-}
-
 PassOwnPtr<SVGAnimatedType> SVGAnimatedBooleanAnimator::constructFromString(const String& string)
 {
     OwnPtr<SVGAnimatedType> animtedType = SVGAnimatedType::createBoolean(new bool);
-    animtedType->boolean() = isTrueString(string);
+    animtedType->boolean() = (string == "true"); // wat?
     return animtedType.release();
 }