Changeset 91307 in webkit
- Timestamp:
- Jul 19, 2011 3:07:11 PM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r91271 r91307 1 2011-07-19 Lukasz Slachciak <lukasz.slachciak@gmail.com> 2 3 [GTK] [WK2] Implement missing initializeLogChannel function. 4 https://bugs.webkit.org/show_bug.cgi?id=63381 5 6 Reviewed by Martin Robinson. 7 8 Implemented logging for GTK platform in WebKit2 - function initializeLogChannel is called for all ports, 9 so added missing implementation. Aslo helper function added for getting channels from names. 10 11 * GNUmakefile.am: Added reference to new file LoggingGtk.cpp. 12 * Platform/Logging.cpp: Logging implementation for GTK port enabled. 13 (WebKit::getChannelFromName): Helper to connect name with WTFLogChannel. 14 * Platform/Logging.h: New helper method added. 15 * Platform/gtk/LoggingGtk.cpp: Added. GTK logging implementation. 16 (WebKit::initializeLogChannel): Channel is initialized if its name is found in WEBKIT_DEBUG. 17 1 18 2011-07-19 Brian Weinstein <bweinstein@apple.com> 2 19 -
trunk/Source/WebKit2/GNUmakefile.am
r91078 r91307 169 169 Source/WebKit2/Platform/CoreIPC/unix/AttachmentUnix.cpp \ 170 170 Source/WebKit2/Platform/CoreIPC/unix/ConnectionUnix.cpp \ 171 Source/WebKit2/Platform/gtk/LoggingGtk.cpp \ 171 172 Source/WebKit2/Platform/gtk/ModuleGtk.cpp \ 172 173 Source/WebKit2/Platform/gtk/RunLoopGtk.cpp \ -
trunk/Source/WebKit2/Platform/Logging.cpp
r87509 r91307 1 1 /* 2 2 * Copyright (C) 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Samsung Electronics 3 4 * 4 5 * Redistribution and use in source and binary forms, with or without … … 38 39 WTFLogChannel LogKeyHandling = { 0x00000020, "WebKit2LogLevel", WTFLogChannelOff }; 39 40 40 #if !PLATFORM(MAC) 41 #if !PLATFORM(MAC) && !PLATFORM(GTK) 41 42 void initializeLogChannel(WTFLogChannel* channel) 42 43 { 43 44 // FIXME: Each platform will need to define their own initializeLogChannel(). 45 } 46 #endif 47 48 #if PLATFORM(GTK) 49 WTFLogChannel* getChannelFromName(const String& channelName) 50 { 51 if (!(channelName.length() >= 2)) 52 return 0; 53 54 if (equalIgnoringCase(channelName, String("SessionState"))) 55 return &LogSessionState; 56 57 if (equalIgnoringCase(channelName, String("ContextMenu"))) 58 return &LogContextMenu; 59 60 if (equalIgnoringCase(channelName, String("TextInput"))) 61 return &LogTextInput; 62 63 if (equalIgnoringCase(channelName, String("View"))) 64 return &LogView; 65 66 if (equalIgnoringCase(channelName, String("IconDatabase"))) 67 return &LogIconDatabase; 68 69 if (equalIgnoringCase(channelName, String("KeyHandling"))) 70 return &LogKeyHandling; 71 72 return 0; 44 73 } 45 74 #endif -
trunk/Source/WebKit2/Platform/Logging.h
r87509 r91307 27 27 #define WebKitLogging_h 28 28 29 #include "PlatformString.h" 29 30 #include <wtf/Assertions.h> 30 31 … … 46 47 void initializeLogChannel(WTFLogChannel*); 47 48 void initializeLogChannelsIfNecessary(void); 49 #if PLATFORM(GTK) 50 WTFLogChannel* getChannelFromName(const String& channelName); 51 #endif 48 52 49 53 } // namespace WebKit -
trunk/Source/WebKit2/Platform/gtk/LoggingGtk.cpp
r91306 r91307 1 1 /* 2 * Copyright (C) 201 0 Apple Inc. All rights reserved.2 * Copyright (C) 2011 Samsung Electronics 3 3 * 4 4 * Redistribution and use in source and binary forms, with or without … … 24 24 */ 25 25 26 #i fndef WebKitLogging_h27 # define WebKitLogging_h26 #include "config.h" 27 #include "Logging.h" 28 28 29 #include <wtf/Assertions.h> 29 #include <glib.h> 30 31 namespace WebKit { 30 32 31 33 #if !LOG_DISABLED 32 34 33 #ifndef LOG_CHANNEL_PREFIX 34 #define LOG_CHANNEL_PREFIX Log 35 #endif 35 void initializeLogChannel(WTFLogChannel* channel) 36 { 37 static Vector<WTFLogChannel*> activatedChannels; 38 const static String logValue(g_getenv("WEBKIT_DEBUG")); 36 39 37 namespace WebKit { 40 if (logValue.isEmpty()) 41 return; 38 42 39 extern WTFLogChannel LogContextMenu; 40 extern WTFLogChannel LogIconDatabase; 41 extern WTFLogChannel LogKeyHandling; 42 extern WTFLogChannel LogSessionState; 43 extern WTFLogChannel LogTextInput; 44 extern WTFLogChannel LogView; 43 // Fill activatedChannels vector only once based on names set in logValue. 44 if (activatedChannels.isEmpty()) { 45 static Vector<String> activatedNames; 46 logValue.split(" ", activatedNames); 47 for (unsigned int i = 0; i < activatedNames.size(); i++) { 48 WTFLogChannel* activeChannel = getChannelFromName(activatedNames[i]); 49 if (activeChannel) 50 activatedChannels.append(activeChannel); 51 } 52 } 45 53 46 void initializeLogChannel(WTFLogChannel*); 47 void initializeLogChannelsIfNecessary(void); 54 if (activatedChannels.contains(channel)) 55 channel->state = WTFLogChannelOn; 56 } 48 57 49 } // namespace WebKit 58 #endif // !LOG_DISABLED 50 59 51 #endif // LOG_DISABLED 52 53 #endif // Logging_h 60 }
Note: See TracChangeset
for help on using the changeset viewer.