Title: [149057] trunk/Source/WebCore
Revision
149057
Author
[email protected]
Date
2013-04-24 12:46:44 -0700 (Wed, 24 Apr 2013)

Log Message

Do not use static string in DiagnosticLoggingKeys
https://bugs.webkit.org/show_bug.cgi?id=115093

Patch by Benjamin Poulain <[email protected]> on 2013-04-24
Reviewed by Andreas Kling.

The code is not hot enough to justify keeping the memory around.
This removes 3kb from the binary on x86_64.

* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::mediaLoadedKey):
(WebCore::DiagnosticLoggingKeys::mediaLoadingFailedKey):
(WebCore::DiagnosticLoggingKeys::pluginLoadedKey):
(WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey):
(WebCore::DiagnosticLoggingKeys::pageContainsPluginKey):
(WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey):
(WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey):
(WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey):
(WebCore::DiagnosticLoggingKeys::passKey):
(WebCore::DiagnosticLoggingKeys::failKey):
(WebCore::DiagnosticLoggingKeys::noopKey):
* page/DiagnosticLoggingKeys.h:
(DiagnosticLoggingKeys):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149056 => 149057)


--- trunk/Source/WebCore/ChangeLog	2013-04-24 19:38:08 UTC (rev 149056)
+++ trunk/Source/WebCore/ChangeLog	2013-04-24 19:46:44 UTC (rev 149057)
@@ -1,3 +1,28 @@
+2013-04-24  Benjamin Poulain  <[email protected]>
+
+        Do not use static string in DiagnosticLoggingKeys
+        https://bugs.webkit.org/show_bug.cgi?id=115093
+
+        Reviewed by Andreas Kling.
+
+        The code is not hot enough to justify keeping the memory around.
+        This removes 3kb from the binary on x86_64.
+
+        * page/DiagnosticLoggingKeys.cpp:
+        (WebCore::DiagnosticLoggingKeys::mediaLoadedKey):
+        (WebCore::DiagnosticLoggingKeys::mediaLoadingFailedKey):
+        (WebCore::DiagnosticLoggingKeys::pluginLoadedKey):
+        (WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey):
+        (WebCore::DiagnosticLoggingKeys::pageContainsPluginKey):
+        (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey):
+        (WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey):
+        (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey):
+        (WebCore::DiagnosticLoggingKeys::passKey):
+        (WebCore::DiagnosticLoggingKeys::failKey):
+        (WebCore::DiagnosticLoggingKeys::noopKey):
+        * page/DiagnosticLoggingKeys.h:
+        (DiagnosticLoggingKeys):
+
 2013-04-24  Benjamin Poulain  <[email protected]>
 
         Remove wxWebKit #ifdefs from WebCore/platform/graphics

Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp (149056 => 149057)


--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2013-04-24 19:38:08 UTC (rev 149056)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.cpp	2013-04-24 19:46:44 UTC (rev 149057)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -28,70 +28,59 @@
 
 namespace WebCore {
 
-const String& DiagnosticLoggingKeys::mediaLoadedKey()
+String DiagnosticLoggingKeys::mediaLoadedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("mediaLoaded")));
-    return key;
+    return ASCIILiteral("mediaLoaded");
 }
 
-const String& DiagnosticLoggingKeys::mediaLoadingFailedKey()
+String DiagnosticLoggingKeys::mediaLoadingFailedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("mediaFailedLoading")));
-    return key;
+    return ASCIILiteral("mediaFailedLoading");
 }
 
-const String& DiagnosticLoggingKeys::pluginLoadedKey()
+String DiagnosticLoggingKeys::pluginLoadedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pluginLoaded")));
-    return key;
+    return ASCIILiteral("pluginLoaded");
 }
 
-const String& DiagnosticLoggingKeys::pluginLoadingFailedKey()
+String DiagnosticLoggingKeys::pluginLoadingFailedKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pluginFailedLoading")));
-    return key;
+    return ASCIILiteral("pluginFailedLoading");
 }
 
-const String& DiagnosticLoggingKeys::pageContainsPluginKey()
+String DiagnosticLoggingKeys::pageContainsPluginKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsPlugin")));
-    return key;
+    return ASCIILiteral("pageContainsPlugin");
 }
 
-const String& DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey()
+String DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsAtLeastOnePlugin")));
-    return key;
+    return ASCIILiteral("pageContainsAtLeastOnePlugin");
 }
 
-const String& DiagnosticLoggingKeys::pageContainsMediaEngineKey()
+String DiagnosticLoggingKeys::pageContainsMediaEngineKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsMediaEngine")));
-    return key;
+    return ASCIILiteral("pageContainsMediaEngine");
 }
 
-const String& DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey()
+String DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pageContainsAtLeastOneMediaEngine")));
-    return key;
+    return ASCIILiteral("pageContainsAtLeastOneMediaEngine");
 }
 
-const String& DiagnosticLoggingKeys::passKey()
+String DiagnosticLoggingKeys::passKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("pass")));
-    return key;
+    return ASCIILiteral("pass");
 }
 
-const String& DiagnosticLoggingKeys::failKey()
+String DiagnosticLoggingKeys::failKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("fail")));
-    return key;
+    return ASCIILiteral("fail");
 }
 
-const String& DiagnosticLoggingKeys::noopKey()
+String DiagnosticLoggingKeys::noopKey()
 {
-    DEFINE_STATIC_LOCAL(const String, key, (ASCIILiteral("noop")));
-    return key;
+    return ASCIILiteral("noop");
 }
 
 }

Modified: trunk/Source/WebCore/page/DiagnosticLoggingKeys.h (149056 => 149057)


--- trunk/Source/WebCore/page/DiagnosticLoggingKeys.h	2013-04-24 19:38:08 UTC (rev 149056)
+++ trunk/Source/WebCore/page/DiagnosticLoggingKeys.h	2013-04-24 19:46:44 UTC (rev 149057)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2012, 2013 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -32,20 +32,20 @@
 
 class DiagnosticLoggingKeys {
 public:
-    // Message keys
-    static const String& mediaLoadedKey();
-    static const String& mediaLoadingFailedKey();
-    static const String& pluginLoadedKey();
-    static const String& pluginLoadingFailedKey();
-    static const String& pageContainsPluginKey();
-    static const String& pageContainsAtLeastOnePluginKey();
-    static const String& pageContainsMediaEngineKey();
-    static const String& pageContainsAtLeastOneMediaEngineKey();
+    // Message keys.
+    static String mediaLoadedKey();
+    static String mediaLoadingFailedKey();
+    static String pluginLoadedKey();
+    static String pluginLoadingFailedKey();
+    static String pageContainsPluginKey();
+    static String pageContainsAtLeastOnePluginKey();
+    static String pageContainsMediaEngineKey();
+    static String pageContainsAtLeastOneMediaEngineKey();
 
-    // Success keys
-    static const String& passKey();
-    static const String& failKey();
-    static const String& noopKey();
+    // Success keys.
+    static String passKey();
+    static String failKey();
+    static String noopKey();
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to