summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk/LoggingGtk.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebCore/platform/gtk/LoggingGtk.cpp
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/platform/gtk/LoggingGtk.cpp')
-rw-r--r--WebCore/platform/gtk/LoggingGtk.cpp56
1 files changed, 3 insertions, 53 deletions
diff --git a/WebCore/platform/gtk/LoggingGtk.cpp b/WebCore/platform/gtk/LoggingGtk.cpp
index c46364c..6350036 100644
--- a/WebCore/platform/gtk/LoggingGtk.cpp
+++ b/WebCore/platform/gtk/LoggingGtk.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "Logging.h"
+#include "PlatformString.h"
#include <glib.h>
#include <string.h>
@@ -28,55 +29,6 @@ namespace WebCore {
// Inspired by the code used by the Qt port
-static WTFLogChannel* getChannelFromName(const char* channelName)
-{
- if (strlen(channelName) < 3)
- return 0;
-
- if (!g_ascii_strcasecmp(channelName, "BackForward"))
- return &LogBackForward;
- if (!g_ascii_strcasecmp(channelName, "Editing"))
- return &LogEditing;
- if (!g_ascii_strcasecmp(channelName, "Events"))
- return &LogEvents;
- if (!g_ascii_strcasecmp(channelName, "Frames"))
- return &LogFrames;
- if (!g_ascii_strcasecmp(channelName, "FTP"))
- return &LogFTP;
- if (!g_ascii_strcasecmp(channelName, "History"))
- return &LogHistory;
- if (!g_ascii_strcasecmp(channelName, "IconDatabase"))
- return &LogIconDatabase;
- if (!g_ascii_strcasecmp(channelName, "Loading"))
- return &LogLoading;
- if (!g_ascii_strcasecmp(channelName, "Media"))
- return &LogMedia;
- if (!g_ascii_strcasecmp(channelName, "Network"))
- return &LogNetwork;
- if (!g_ascii_strcasecmp(channelName, "NotYetImplemented"))
- return &LogNotYetImplemented;
- if (!g_ascii_strcasecmp(channelName, "PageCache"))
- return &LogPageCache;
- if (!g_ascii_strcasecmp(channelName, "PlatformLeaks"))
- return &LogPlatformLeaks;
- if (!g_ascii_strcasecmp(channelName, "Plugin"))
- return &LogPlugin;
- if (!g_ascii_strcasecmp(channelName, "PopupBlocking"))
- return &LogPopupBlocking;
- if (!g_ascii_strcasecmp(channelName, "SpellingAndGrammar"))
- return &LogSpellingAndGrammar;
- if (!g_ascii_strcasecmp(channelName, "SQLDatabase"))
- return &LogSQLDatabase;
- if (!g_ascii_strcasecmp(channelName, "StorageAPI"))
- return &LogStorageAPI;
- if (!g_ascii_strcasecmp(channelName, "TextConversion"))
- return &LogTextConversion;
- if (!g_ascii_strcasecmp(channelName, "Threading"))
- return &LogThreading;
-
- return 0;
-}
-
void InitializeLoggingChannelsIfNecessary()
{
static bool didInitializeLoggingChannels = false;
@@ -98,10 +50,8 @@ void InitializeLoggingChannelsIfNecessary()
char** logv = g_strsplit(logEnv, " ", -1);
for (int i = 0; logv[i]; i++) {
- WTFLogChannel* channel = getChannelFromName(logv[i]);
- if (!channel)
- continue;
- channel->state = WTFLogChannelOn;
+ if (WTFLogChannel* channel = getChannelFromName(logv[i]))
+ channel->state = WTFLogChannelOn;
}
g_strfreev(logv);