Commit f7a278d1 authored by jeffm@apple.com's avatar jeffm@apple.com

2011-05-26 Jeff Miller <jeffm@apple.com>

        Reviewed by Alexey Proskuryakov.

        Add a key handling logging channel for WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=61588
        
        Added a new LogKeyHandling channel, and logged some key events in WebPageProxy.
        I also fixed a misspelling of coalescing in a comment in WebPageProxy.cpp.

        * Platform/Logging.cpp:
        (WebKit::initializeLogChannelsIfNecessary): Initialize LogKeyHandling channel.
        * Platform/Logging.h: Added LogKeyHandling channel.

        * UIProcess/WebPageProxy.cpp: Fixed misspelling of coalescing in a comment.
        (WebKit::webKeyboardEventTypeString): Added to support logging.
        (WebKit::WebPageProxy::handleKeyboardEvent): Log the keyboard event.
        (WebKit::WebPageProxy::didReceiveEvent): Log the keyboard event.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 84895b03
2011-05-26 Jeff Miller <jeffm@apple.com>
Reviewed by Alexey Proskuryakov.
Add a key handling logging channel for WebKit2
https://bugs.webkit.org/show_bug.cgi?id=61588
Added a new LogKeyHandling channel, and logged some key events in WebPageProxy.
I also fixed a misspelling of coalescing in a comment in WebPageProxy.cpp.
* Platform/Logging.cpp:
(WebKit::initializeLogChannelsIfNecessary): Initialize LogKeyHandling channel.
* Platform/Logging.h: Added LogKeyHandling channel.
* UIProcess/WebPageProxy.cpp: Fixed misspelling of coalescing in a comment.
(WebKit::webKeyboardEventTypeString): Added to support logging.
(WebKit::WebPageProxy::handleKeyboardEvent): Log the keyboard event.
(WebKit::WebPageProxy::didReceiveEvent): Log the keyboard event.
2011-05-26 Chris Fleizach <cfleizach@apple.com> 2011-05-26 Chris Fleizach <cfleizach@apple.com>
Reviewed by Darin Adler. Reviewed by Darin Adler.
......
...@@ -35,6 +35,7 @@ WTFLogChannel LogContextMenu = { 0x00000002, "WebKit2LogLevel", WTFLogChannelOf ...@@ -35,6 +35,7 @@ WTFLogChannel LogContextMenu = { 0x00000002, "WebKit2LogLevel", WTFLogChannelOf
WTFLogChannel LogTextInput = { 0x00000004, "WebKit2LogLevel", WTFLogChannelOff }; WTFLogChannel LogTextInput = { 0x00000004, "WebKit2LogLevel", WTFLogChannelOff };
WTFLogChannel LogView = { 0x00000008, "WebKit2LogLevel", WTFLogChannelOff }; WTFLogChannel LogView = { 0x00000008, "WebKit2LogLevel", WTFLogChannelOff };
WTFLogChannel LogIconDatabase = { 0x00000010, "WebKit2LogLevel", WTFLogChannelOff }; WTFLogChannel LogIconDatabase = { 0x00000010, "WebKit2LogLevel", WTFLogChannelOff };
WTFLogChannel LogKeyHandling = { 0x00000020, "WebKit2LogLevel", WTFLogChannelOff };
#if !PLATFORM(MAC) #if !PLATFORM(MAC)
void initializeLogChannel(WTFLogChannel* channel) void initializeLogChannel(WTFLogChannel* channel)
...@@ -52,6 +53,7 @@ void initializeLogChannelsIfNecessary() ...@@ -52,6 +53,7 @@ void initializeLogChannelsIfNecessary()
initializeLogChannel(&LogContextMenu); initializeLogChannel(&LogContextMenu);
initializeLogChannel(&LogIconDatabase); initializeLogChannel(&LogIconDatabase);
initializeLogChannel(&LogKeyHandling);
initializeLogChannel(&LogSessionState); initializeLogChannel(&LogSessionState);
initializeLogChannel(&LogTextInput); initializeLogChannel(&LogTextInput);
initializeLogChannel(&LogView); initializeLogChannel(&LogView);
......
...@@ -38,6 +38,7 @@ namespace WebKit { ...@@ -38,6 +38,7 @@ namespace WebKit {
extern WTFLogChannel LogContextMenu; extern WTFLogChannel LogContextMenu;
extern WTFLogChannel LogIconDatabase; extern WTFLogChannel LogIconDatabase;
extern WTFLogChannel LogKeyHandling;
extern WTFLogChannel LogSessionState; extern WTFLogChannel LogSessionState;
extern WTFLogChannel LogTextInput; extern WTFLogChannel LogTextInput;
extern WTFLogChannel LogView; extern WTFLogChannel LogView;
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "DownloadProxy.h" #include "DownloadProxy.h"
#include "DrawingAreaProxy.h" #include "DrawingAreaProxy.h"
#include "FindIndicator.h" #include "FindIndicator.h"
#include "Logging.h"
#include "MessageID.h" #include "MessageID.h"
#include "NativeWebKeyboardEvent.h" #include "NativeWebKeyboardEvent.h"
#include "NativeWebMouseEvent.h" #include "NativeWebMouseEvent.h"
...@@ -90,7 +91,7 @@ ...@@ -90,7 +91,7 @@
#include <wtf/RefCountedLeakCounter.h> #include <wtf/RefCountedLeakCounter.h>
#endif #endif
// This controls what strategy we use for mouse wheel coalesing. // This controls what strategy we use for mouse wheel coalescing.
#define MERGE_WHEEL_EVENTS 1 #define MERGE_WHEEL_EVENTS 1
#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process()->connection()) #define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process()->connection())
...@@ -105,6 +106,29 @@ WKPageDebugPaintFlags WebPageProxy::s_debugPaintFlags = 0; ...@@ -105,6 +106,29 @@ WKPageDebugPaintFlags WebPageProxy::s_debugPaintFlags = 0;
static WTF::RefCountedLeakCounter webPageProxyCounter("WebPageProxy"); static WTF::RefCountedLeakCounter webPageProxyCounter("WebPageProxy");
#endif #endif
#if !LOG_DISABLED
static const char* webKeyboardEventTypeString(WebEvent::Type type)
{
switch (type) {
case WebEvent::KeyDown:
return "KeyDown";
case WebEvent::KeyUp:
return "KeyUp";
case WebEvent::RawKeyDown:
return "RawKeyDown";
case WebEvent::Char:
return "Char";
default:
ASSERT_NOT_REACHED();
return "<unknown>";
}
}
#endif // !LOG_DISABLED
PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID) PassRefPtr<WebPageProxy> WebPageProxy::create(PageClient* pageClient, PassRefPtr<WebProcessProxy> process, WebPageGroup* pageGroup, uint64_t pageID)
{ {
return adoptRef(new WebPageProxy(pageClient, process, pageGroup, pageID)); return adoptRef(new WebPageProxy(pageClient, process, pageGroup, pageID));
...@@ -901,6 +925,8 @@ void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event) ...@@ -901,6 +925,8 @@ void WebPageProxy::handleKeyboardEvent(const NativeWebKeyboardEvent& event)
{ {
if (!isValid()) if (!isValid())
return; return;
LOG(KeyHandling, "WebPageProxy::handleKeyboardEvent: %s", webKeyboardEventTypeString(event.type()));
m_keyEventQueue.append(event); m_keyEventQueue.append(event);
...@@ -2709,6 +2735,8 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled) ...@@ -2709,6 +2735,8 @@ void WebPageProxy::didReceiveEvent(uint32_t opaqueType, bool handled)
case WebEvent::KeyUp: case WebEvent::KeyUp:
case WebEvent::RawKeyDown: case WebEvent::RawKeyDown:
case WebEvent::Char: { case WebEvent::Char: {
LOG(KeyHandling, "WebPageProxy::didReceiveEvent: %s", webKeyboardEventTypeString(type));
NativeWebKeyboardEvent event = m_keyEventQueue.first(); NativeWebKeyboardEvent event = m_keyEventQueue.first();
MESSAGE_CHECK(type == event.type()); MESSAGE_CHECK(type == event.type());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment