Bug 132033

Summary: [iOS][WK2] Split iOS touch event dispatch for the regular touch event dispatch
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: New BugsAssignee: Benjamin Poulain <benjamin>
Status: RESOLVED FIXED    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Benjamin Poulain 2014-04-22 17:46:08 PDT
[iOS][WK2] Split iOS touch event dispatch for the regular touch event dispatch
Comment 1 Benjamin Poulain 2014-04-22 18:12:38 PDT
Created attachment 229936 [details]
Patch
Comment 2 Simon Fraser (smfr) 2014-04-22 18:27:38 PDT
Comment on attachment 229936 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=229936&action=review

> Source/WebKit2/UIProcess/WebPageProxy.cpp:1515
> +    m_process->responsivenessTimer()->start();
> +    bool handled = false;
> +    m_process->sendSync(Messages::WebPage::TouchEventSync(event), Messages::WebPage::TouchEventSync::Reply(handled), m_pageID);
> +    didReceiveEvent(event.type(), handled);
> +    m_pageClient.doneWithTouchEvent(event, handled);
> +    m_process->responsivenessTimer()->stop();

Would be nice to have a RAII class for start/stop.

> Source/WebKit2/UIProcess/WebPageProxy.cpp:1531
> +    m_process->send(Messages::EventDispatcher::TouchEvent(m_pageID, event), 0);

What is the last param?

> Source/WebKit2/UIProcess/WebPageProxy.h:698
> +    void handleSynchronousTouchEvent(const NativeWebTouchEvent&);

handleTouchEventSynchronously?

> Source/WebKit2/UIProcess/WebPageProxy.h:699
> +    void sendAsynchronousTouchEvent(const NativeWebTouchEvent&);

handleTouchEventAsynchronously?

> Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp:177
> +            TouchEventQueue& queuedEvents = addResult.iterator->value;
> +            ASSERT(!queuedEvents.isEmpty());
> +            const WebTouchEvent& lastTouchEvent = queuedEvents.last();
> +            WebEvent::Type type = lastTouchEvent.type();
> +            if (type == WebEvent::TouchMove)
> +                queuedEvents.last() = touchEvent;

Not quite sure what you are doing here. Coalescing move events? Can you add a comment or name the variables to clarify?

> Source/WebKit2/WebProcess/WebPage/EventDispatcher.h:77
> +    void touchEvent(uint64_t pageID, const WebTouchEvent&);

I wish we had a typedef for pageID

> Source/WebKit2/WebProcess/WebPage/EventDispatcher.h:100
> +    // FIXME: verify what is the right value for the inline capacity.

Do this?

> Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm:2062
> +void WebPage::dispatchAsynchronousTouchEventsQueue(const Vector<WebTouchEvent, 5>& queue)

You don't dispatch a queue, so dispatchAsynchronousTouchEventsInQueue or dispatchAsynchronousTouchEvents.
Comment 3 Benjamin Poulain 2014-04-22 20:58:58 PDT
Created attachment 229950 [details]
Patch
Comment 4 Benjamin Poulain 2014-04-22 22:51:09 PDT
Thanks for the review!

> > Source/WebKit2/UIProcess/WebPageProxy.cpp:1531
> > +    m_process->send(Messages::EventDispatcher::TouchEvent(m_pageID, event), 0);
> 
> What is the last param?

The target, but in this case it is on a different queue.

> > Source/WebKit2/WebProcess/WebPage/EventDispatcher.h:100
> > +    // FIXME: verify what is the right value for the inline capacity.
> 
> Do this?

Oops :)
Comment 5 Benjamin Poulain 2014-04-22 22:53:27 PDT
Comment on attachment 229950 [details]
Patch

Clearing flags on attachment: 229950

Committed r167698: <http://trac.webkit.org/changeset/167698>
Comment 6 Benjamin Poulain 2014-04-22 22:53:31 PDT
All reviewed patches have been landed.  Closing bug.