[WK2] Use ASCIILiteral hotness for DEFINE_STATIC_LOCAL string
authorgyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2012 04:53:21 +0000 (04:53 +0000)
committergyuyoung.kim@samsung.com <gyuyoung.kim@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Aug 2012 04:53:21 +0000 (04:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95318

Reviewed by Benjamin Poulain.

As recommended by http://trac.webkit.org/wiki/EfficientStrings,
WebKit2 needs to use ASCIILiteral for the string of DEFINE_STATIC_LOCAL.

* Shared/WebError.cpp:
(WebKit::WebError::webKitErrorDomain):
* Shared/WebPreferencesStore.cpp:
(WebPreferencesKey):
* UIProcess/InspectorServer/WebInspectorServer.cpp:
(WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest):
* UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp:
(WebKit::remoteInspectorPagePath):
* UIProcess/WebDatabaseManagerProxy.cpp:
(WebKit::WebDatabaseManagerProxy::originKey):
(WebKit::WebDatabaseManagerProxy::originQuotaKey):
(WebKit::WebDatabaseManagerProxy::originUsageKey):
(WebKit::WebDatabaseManagerProxy::databaseDetailsKey):
(WebKit::WebDatabaseManagerProxy::databaseDetailsNameKey):
(WebKit::WebDatabaseManagerProxy::databaseDetailsDisplayNameKey):
(WebKit::WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey):
(WebKit::WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::executeEditCommand):
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::didBeginEditing):
(WebKit::WebEditorClient::respondToChangedContents):
(WebKit::WebEditorClient::respondToChangedSelection):
(WebKit::WebEditorClient::didEndEditing):
* WebProcess/WebProcess.cpp:
(WebKit::getWebCoreMemoryCacheStatistics):

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebError.cpp
Source/WebKit2/Shared/WebPreferencesStore.cpp
Source/WebKit2/UIProcess/InspectorServer/WebInspectorServer.cpp
Source/WebKit2/UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp
Source/WebKit2/UIProcess/WebDatabaseManagerProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
Source/WebKit2/WebProcess/WebProcess.cpp

index b3c9afa..483a284 100644 (file)
@@ -1,3 +1,40 @@
+2012-08-29  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
+
+        [WK2] Use ASCIILiteral hotness for DEFINE_STATIC_LOCAL string
+        https://bugs.webkit.org/show_bug.cgi?id=95318
+
+        Reviewed by Benjamin Poulain.
+
+        As recommended by http://trac.webkit.org/wiki/EfficientStrings,
+        WebKit2 needs to use ASCIILiteral for the string of DEFINE_STATIC_LOCAL.
+
+        * Shared/WebError.cpp:
+        (WebKit::WebError::webKitErrorDomain):
+        * Shared/WebPreferencesStore.cpp:
+        (WebPreferencesKey):
+        * UIProcess/InspectorServer/WebInspectorServer.cpp:
+        (WebKit::WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest):
+        * UIProcess/InspectorServer/qt/WebInspectorServerQt.cpp:
+        (WebKit::remoteInspectorPagePath):
+        * UIProcess/WebDatabaseManagerProxy.cpp:
+        (WebKit::WebDatabaseManagerProxy::originKey):
+        (WebKit::WebDatabaseManagerProxy::originQuotaKey):
+        (WebKit::WebDatabaseManagerProxy::originUsageKey):
+        (WebKit::WebDatabaseManagerProxy::databaseDetailsKey):
+        (WebKit::WebDatabaseManagerProxy::databaseDetailsNameKey):
+        (WebKit::WebDatabaseManagerProxy::databaseDetailsDisplayNameKey):
+        (WebKit::WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey):
+        (WebKit::WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::executeEditCommand):
+        * WebProcess/WebCoreSupport/WebEditorClient.cpp:
+        (WebKit::WebEditorClient::didBeginEditing):
+        (WebKit::WebEditorClient::respondToChangedContents):
+        (WebKit::WebEditorClient::respondToChangedSelection):
+        (WebKit::WebEditorClient::didEndEditing):
+        * WebProcess/WebProcess.cpp:
+        (WebKit::getWebCoreMemoryCacheStatistics):
+
 2012-08-29  Luciano Wolf  <luciano.wolf@openbossa.org>
 
         [Qt][WK2] ApplicationCache LayoutTests failed
index 88204dd..e25dc02 100644 (file)
@@ -32,7 +32,7 @@ namespace WebKit {
 
 const String& WebError::webKitErrorDomain()
 {
-    DEFINE_STATIC_LOCAL(String, webKitErrorDomainString, ("WebKitErrorDomain"));
+    DEFINE_STATIC_LOCAL(String, webKitErrorDomainString, (ASCIILiteral("WebKitErrorDomain")));
     return webKitErrorDomainString;
 }
 
index 89734bf..746df10 100644 (file)
@@ -37,7 +37,7 @@ namespace WebPreferencesKey {
 #define DEFINE_KEY_GETTERS(KeyUpper, KeyLower, TypeName, Type, DefaultValue) \
         const String& KeyLower##Key() \
         { \
-            DEFINE_STATIC_LOCAL(String, key, (#KeyUpper)); \
+            DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral(#KeyUpper))); \
             return key; \
         }
 
index ecb171b..66d6447 100644 (file)
@@ -142,7 +142,7 @@ bool WebInspectorServer::didReceiveWebSocketUpgradeHTTPRequest(WebSocketServerCo
     String path = request->url();
 
     // NOTE: Keep this in sync with WebCore/inspector/front-end/inspector.js.
-    DEFINE_STATIC_LOCAL(const String, inspectorWebSocketConnectionPathPrefix, ("/devtools/page/"));
+    DEFINE_STATIC_LOCAL(const String, inspectorWebSocketConnectionPathPrefix, (ASCIILiteral("/devtools/page/")));
 
     // Unknown path requested.
     if (!path.startsWith(inspectorWebSocketConnectionPathPrefix))
index 8de0f93..c13fa4c 100644 (file)
@@ -34,7 +34,7 @@ namespace WebKit {
 
 static String remoteInspectorPagePath()
 {
-    DEFINE_STATIC_LOCAL(String, pagePath, ("/webkit/inspector/inspector.html?page="));
+    DEFINE_STATIC_LOCAL(String, pagePath, (ASCIILiteral("/webkit/inspector/inspector.html?page=")));
     return pagePath;
 }
 
index 76db336..23177e6 100644 (file)
@@ -40,49 +40,49 @@ namespace WebKit {
 
 String WebDatabaseManagerProxy::originKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerOriginKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerOriginKey")));
     return key;
 }
 
 String WebDatabaseManagerProxy::originQuotaKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerOriginQuotaKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerOriginQuotaKey")));
     return key;
 }
 
 String WebDatabaseManagerProxy::originUsageKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerOriginUsageKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerOriginUsageKey")));
     return key;
 }
 
 String WebDatabaseManagerProxy::databaseDetailsKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerDatabaseDetailsKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsKey")));
     return key;
 }
 
 String WebDatabaseManagerProxy::databaseDetailsNameKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerDatabaseDetailsNameKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsNameKey")));
     return key;
 }
 
 String WebDatabaseManagerProxy::databaseDetailsDisplayNameKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerDatabaseDetailsDisplayNameKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsDisplayNameKey")));
     return key;
 }
 
 String WebDatabaseManagerProxy::databaseDetailsExpectedUsageKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerDatabaseDetailsExpectedUsageKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsExpectedUsageKey")));
     return key;
 }
 
 String WebDatabaseManagerProxy::databaseDetailsCurrentUsageKey()
 {
-    DEFINE_STATIC_LOCAL(String, key, ("WebDatabaseManagerDatabaseDetailsCurrentUsageKey"));
+    DEFINE_STATIC_LOCAL(String, key, (ASCIILiteral("WebDatabaseManagerDatabaseDetailsCurrentUsageKey")));
     return key;
 }
 
index c88c665..9881eb2 100644 (file)
@@ -897,7 +897,7 @@ void WebPageProxy::executeEditCommand(const String& commandName)
     if (!isValid())
         return;
 
-    DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, ("ignoreSpelling"));
+    DEFINE_STATIC_LOCAL(String, ignoreSpellingCommandName, (ASCIILiteral("ignoreSpelling")));
     if (commandName == ignoreSpellingCommandName)
         ++m_pendingLearnOrIgnoreWordMessageCount;
 
index 092ec68..e109c4e 100644 (file)
@@ -164,21 +164,21 @@ bool WebEditorClient::shouldMoveRangeAfterDelete(Range*, Range*)
 void WebEditorClient::didBeginEditing()
 {
     // FIXME: What good is a notification name, if it's always the same?
-    DEFINE_STATIC_LOCAL(String, WebViewDidBeginEditingNotification, ("WebViewDidBeginEditingNotification"));
+    DEFINE_STATIC_LOCAL(String, WebViewDidBeginEditingNotification, (ASCIILiteral("WebViewDidBeginEditingNotification")));
     m_page->injectedBundleEditorClient().didBeginEditing(m_page, WebViewDidBeginEditingNotification.impl());
     notImplemented();
 }
 
 void WebEditorClient::respondToChangedContents()
 {
-    DEFINE_STATIC_LOCAL(String, WebViewDidChangeNotification, ("WebViewDidChangeNotification"));
+    DEFINE_STATIC_LOCAL(String, WebViewDidChangeNotification, (ASCIILiteral("WebViewDidChangeNotification")));
     m_page->injectedBundleEditorClient().didChange(m_page, WebViewDidChangeNotification.impl());
     notImplemented();
 }
 
 void WebEditorClient::respondToChangedSelection(Frame* frame)
 {
-    DEFINE_STATIC_LOCAL(String, WebViewDidChangeSelectionNotification, ("WebViewDidChangeSelectionNotification"));
+    DEFINE_STATIC_LOCAL(String, WebViewDidChangeSelectionNotification, (ASCIILiteral("WebViewDidChangeSelectionNotification")));
     m_page->injectedBundleEditorClient().didChangeSelection(m_page, WebViewDidChangeSelectionNotification.impl());
     if (!frame)
         return;
@@ -202,7 +202,7 @@ void WebEditorClient::respondToChangedSelection(Frame* frame)
 
 void WebEditorClient::didEndEditing()
 {
-    DEFINE_STATIC_LOCAL(String, WebViewDidEndEditingNotification, ("WebViewDidEndEditingNotification"));
+    DEFINE_STATIC_LOCAL(String, WebViewDidEndEditingNotification, (ASCIILiteral("WebViewDidEndEditingNotification")));
     m_page->injectedBundleEditorClient().didEndEditing(m_page, WebViewDidEndEditingNotification.impl());
     notImplemented();
 }
index 1490ff3..705c39a 100644 (file)
@@ -917,10 +917,10 @@ static void fromCountedSetToHashMap(TypeCountSet* countedSet, HashMap<String, ui
 
 static void getWebCoreMemoryCacheStatistics(Vector<HashMap<String, uint64_t> >& result)
 {
-    DEFINE_STATIC_LOCAL(String, imagesString, ("Images"));
-    DEFINE_STATIC_LOCAL(String, cssString, ("CSS"));
-    DEFINE_STATIC_LOCAL(String, xslString, ("XSL"));
-    DEFINE_STATIC_LOCAL(String, javaScriptString, ("JavaScript"));
+    DEFINE_STATIC_LOCAL(String, imagesString, (ASCIILiteral("Images")));
+    DEFINE_STATIC_LOCAL(String, cssString, (ASCIILiteral("CSS")));
+    DEFINE_STATIC_LOCAL(String, xslString, (ASCIILiteral("XSL")));
+    DEFINE_STATIC_LOCAL(String, javaScriptString, (ASCIILiteral("JavaScript")));
     
     MemoryCache::Statistics memoryCacheStatistics = memoryCache()->getStatistics();