Title: [121895] trunk/Source/WebCore
Revision
121895
Author
[email protected]
Date
2012-07-05 02:34:46 -0700 (Thu, 05 Jul 2012)

Log Message

Add Gamepad logging channel
https://bugs.webkit.org/show_bug.cgi?id=90570

Reviewed by Carlos Garcia Campos.

Add a new logging channel for logging significant
events that are related to Gamepad API implementation.

No new tests - no new testable functionality.

* platform/Logging.cpp:
(WebCore):
(WebCore::getChannelFromName):
* platform/Logging.h:
(WebCore):
* platform/gtk/GamepadsGtk.cpp: Log when a device is
registered or unregistered.
(WebCore::GamepadsGtk::registerDevice):
(WebCore::GamepadsGtk::unregisterDevice):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (121894 => 121895)


--- trunk/Source/WebCore/ChangeLog	2012-07-05 09:22:58 UTC (rev 121894)
+++ trunk/Source/WebCore/ChangeLog	2012-07-05 09:34:46 UTC (rev 121895)
@@ -1,3 +1,25 @@
+2012-07-05  Zan Dobersek  <[email protected]>
+
+        Add Gamepad logging channel
+        https://bugs.webkit.org/show_bug.cgi?id=90570
+
+        Reviewed by Carlos Garcia Campos.
+
+        Add a new logging channel for logging significant
+        events that are related to Gamepad API implementation.
+
+        No new tests - no new testable functionality.
+
+        * platform/Logging.cpp:
+        (WebCore):
+        (WebCore::getChannelFromName):
+        * platform/Logging.h:
+        (WebCore):
+        * platform/gtk/GamepadsGtk.cpp: Log when a device is
+        registered or unregistered.
+        (WebCore::GamepadsGtk::registerDevice):
+        (WebCore::GamepadsGtk::unregisterDevice):
+
 2012-07-05  Peter Wang  <[email protected]>
 
         Web Inspector: [JSC] support JS execution in the context of an isolated world

Modified: trunk/Source/WebCore/platform/Logging.cpp (121894 => 121895)


--- trunk/Source/WebCore/platform/Logging.cpp	2012-07-05 09:22:58 UTC (rev 121894)
+++ trunk/Source/WebCore/platform/Logging.cpp	2012-07-05 09:34:46 UTC (rev 121895)
@@ -65,6 +65,7 @@
 
 WTFLogChannel LogWebAudio =          { 0x20000000, "WebCoreLogLevel", WTFLogChannelOff };
 WTFLogChannel LogCompositing =       { 0x40000000, "WebCoreLogLevel", WTFLogChannelOff };
+WTFLogChannel LogGamepad =           { 0x80000000, "WebCoreLogLevel", WTFLogChannelOff };
 
 
 WTFLogChannel* getChannelFromName(const String& channelName)
@@ -147,6 +148,9 @@
     if (equalIgnoringCase(channelName, String("Compositing")))
         return &LogCompositing;
 
+    if (equalIgnoringCase(channelName, String("Gamepad")))
+        return &LogGamepad;
+
     return 0;
 }
 

Modified: trunk/Source/WebCore/platform/Logging.h (121894 => 121895)


--- trunk/Source/WebCore/platform/Logging.h	2012-07-05 09:22:58 UTC (rev 121894)
+++ trunk/Source/WebCore/platform/Logging.h	2012-07-05 09:34:46 UTC (rev 121895)
@@ -63,6 +63,7 @@
     extern WTFLogChannel LogFileAPI;
     extern WTFLogChannel LogWebAudio;
     extern WTFLogChannel LogCompositing;
+    extern WTFLogChannel LogGamepad;
 
     void initializeLoggingChannelsIfNecessary();
     WTFLogChannel* getChannelFromName(const String& channelName);

Modified: trunk/Source/WebCore/platform/gtk/GamepadsGtk.cpp (121894 => 121895)


--- trunk/Source/WebCore/platform/gtk/GamepadsGtk.cpp	2012-07-05 09:22:58 UTC (rev 121894)
+++ trunk/Source/WebCore/platform/gtk/GamepadsGtk.cpp	2012-07-05 09:34:46 UTC (rev 121895)
@@ -30,12 +30,14 @@
 
 #include "GamepadDeviceLinux.h"
 #include "GamepadList.h"
+#include "Logging.h"
 #include <gio/gunixinputstream.h>
 #include <gudev/gudev.h>
 #include <wtf/HashMap.h>
 #include <wtf/PassOwnPtr.h>
 #include <wtf/gobject/GOwnPtr.h>
 #include <wtf/gobject/GRefPtr.h>
+#include <wtf/text/CString.h>
 #include <wtf/text/StringHash.h>
 
 namespace WebCore {
@@ -138,6 +140,7 @@
 
 void GamepadsGtk::registerDevice(String deviceFile)
 {
+    LOG(Gamepad, "GamepadsGtk::registerDevice %s", deviceFile.ascii().data());
     ASSERT(!m_deviceMap.contains(deviceFile));
 
     for (unsigned index = 0; index < m_slots.size(); index++) {
@@ -151,6 +154,7 @@
 
 void GamepadsGtk::unregisterDevice(String deviceFile)
 {
+    LOG(Gamepad, "GamepadsGtk::unregisterDevice %s", deviceFile.ascii().data());
     ASSERT(m_deviceMap.contains(deviceFile));
 
     GamepadDeviceGtk* gamepadDevice = m_deviceMap.take(deviceFile);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to