[chromium] Tweak WebCompositor API for input event handling to express three possible...
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Oct 2011 23:54:26 +0000 (23:54 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 3 Oct 2011 23:54:26 +0000 (23:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=69304

Reviewed by Darin Fisher.

* public/WebCompositorClient.h:
* src/WebCompositorImpl.cpp:
(WebKit::WebCompositorImpl::~WebCompositorImpl):
(WebKit::WebCompositorImpl::handleInputEvent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96557 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebCompositorClient.h
Source/WebKit/chromium/src/WebCompositorImpl.cpp

index 353dbe4..600b5e4 100644 (file)
@@ -1,3 +1,15 @@
+2011-10-03  James Robinson  <jamesr@chromium.org>
+
+        [chromium] Tweak WebCompositor API for input event handling to express three possible states
+        https://bugs.webkit.org/show_bug.cgi?id=69304
+
+        Reviewed by Darin Fisher.
+
+        * public/WebCompositorClient.h:
+        * src/WebCompositorImpl.cpp:
+        (WebKit::WebCompositorImpl::~WebCompositorImpl):
+        (WebKit::WebCompositorImpl::handleInputEvent):
+
 2011-10-03  Anders Carlsson  <andersca@apple.com>
 
         Remove custom scrollbar painting hooks
index a6e8048..2d0b428 100644 (file)
@@ -32,7 +32,15 @@ class WebCompositorClient {
 public:
     // Callbacks invoked from the compositor thread.
     virtual void willShutdown() = 0;
-    virtual void didHandleInputEvent(bool processed) = 0;
+
+    // Exactly one of the following two callbacks will be invoked after every call to WebCompositor::handleInputEvent():
+
+    // Called when the WebCompositor handled the input event and no further processing is required.
+    virtual void didHandleInputEvent() = 0;
+
+    // Called when the WebCompositor did not handle the input event. If sendToWidget is true, the input event
+    // should be forwarded to the WebWidget associated with this compositor for further processing.
+    virtual void didNotHandleInputEvent(bool sendToWidget) = 0;
 
 protected:
     virtual ~WebCompositorClient() { }
index f8935fc..5f94b59 100644 (file)
@@ -89,6 +89,9 @@ WebCompositorImpl::WebCompositorImpl()
 
 WebCompositorImpl::~WebCompositorImpl()
 {
+    if (m_client)
+        m_client->willShutdown();
+
     ASSERT(s_compositorsLock);
     MutexLocker lock(*s_compositorsLock);
     ASSERT(s_compositors);
@@ -110,7 +113,7 @@ void WebCompositorImpl::handleInputEvent(const WebInputEvent& event)
 {
     ASSERT(CCProxy::isImplThread());
     // FIXME: Do something interesting with the event here.
-    m_client->didHandleInputEvent(false);
+    m_client->didNotHandleInputEvent(true /* sendToWidget */);
 }
 
 }