Changeset 90629 in webkit
- Timestamp:
- Jul 8, 2011 7:42:27 AM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r90602 r90629 1 2011-07-08 Benjamin Poulain <benjamin@webkit.org> 2 3 [WK2] Do not forward touch events to the web process when it does not need them 4 https://bugs.webkit.org/show_bug.cgi?id=64164 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 Add a convenience function to obtain a reference to the last element of a Deque. 9 10 * wtf/Deque.h: 11 (WTF::Deque::last): 12 1 13 2011-07-07 Filip Pizlo <fpizlo@apple.com> 2 14 -
trunk/Source/JavaScriptCore/wtf/Deque.h
r86383 r90629 79 79 PassType takeFirst(); 80 80 81 T& last() { ASSERT(m_start != m_end); return *(--end()); } 82 const T& last() const { ASSERT(m_start != m_end); return *(--end()); } 83 81 84 template<typename U> void append(const U&); 82 85 template<typename U> void prepend(const U&); -
trunk/Source/WebKit2/ChangeLog
r90618 r90629 1 2011-07-08 Benjamin Poulain <benjamin@webkit.org> 2 3 [WK2] Do not forward touch events to the web process when it does not need them 4 https://bugs.webkit.org/show_bug.cgi?id=64164 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 The call to ChromeClient::needTouchEvent() is now forwarded to the WebPageProxy 9 to change the way events are delivered. 10 11 When the WebPage does not need touch events, and there is no queued touch events, 12 the incoming events just bounce back through PageClient::doneWithTouchEvent(). 13 14 In the case when new events come to WebPageProxy and there are still touch events 15 incoming from the WebProcess, the new events are deferred with the corresponding 16 pending touch events. 17 Deferring the new events iafter the corresponding forwarded event ensure 18 the delivery is always done in order when PageClient::doneWithTouchEvent() 19 is called. 20 21 * UIProcess/WebPageProxy.cpp: 22 (WebKit::WebPageProxy::WebPageProxy): 23 (WebKit::WebPageProxy::handleTouchEvent): 24 (WebKit::WebPageProxy::needTouchEvents): 25 (WebKit::WebPageProxy::didReceiveEvent): 26 (WebKit::WebPageProxy::processDidCrash): 27 * UIProcess/WebPageProxy.h: 28 (WebKit::QueuedTouchEvents:::forwardedEvent): 29 * UIProcess/WebPageProxy.messages.in: 30 * WebProcess/WebCoreSupport/WebChromeClient.cpp: 31 (WebKit::WebChromeClient::needTouchEvents): 32 1 33 2011-07-08 Benjamin Poulain <benjamin@webkit.org> 2 34 -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r90550 r90629 171 171 , m_syncNavigationActionPolicyDownloadID(0) 172 172 , m_processingMouseMoveEvent(false) 173 #if ENABLE(TOUCH_EVENTS) 174 , m_needTouchEvents(false) 175 #endif 173 176 , m_pageID(pageID) 174 177 #if PLATFORM(MAC) … … 978 981 return; 979 982 980 m_touchEventQueue.append(event); 981 process()->responsivenessTimer()->start(); 982 process()->send(Messages::WebPage::TouchEvent(event), m_pageID); 983 if (m_needTouchEvents) { 984 m_touchEventQueue.append(event); 985 process()->responsivenessTimer()->start(); 986 process()->send(Messages::WebPage::TouchEvent(event), m_pageID); 987 } else { 988 if (m_touchEventQueue.isEmpty()) { 989 bool isEventHandled = false; 990 m_pageClient->doneWithTouchEvent(event, isEventHandled); 991 } else { 992 // We attach the incoming events to the newest queued event so that all 993 // the events are delivered in the correct order when the event is dequed. 994 QueuedTouchEvents& lastEvent = m_touchEventQueue.last(); 995 lastEvent.deferredTouchEvents.append(event); 996 } 997 } 983 998 } 984 999 #endif … … 2188 2203 2189 2204 process()->send(Messages::WebPage::FindZoomableAreaForPoint(point), m_pageID); 2205 } 2206 #endif 2207 2208 #if ENABLE(TOUCH_EVENTS) 2209 void WebPageProxy::needTouchEvents(bool needTouchEvents) 2210 { 2211 m_needTouchEvents = needTouchEvents; 2190 2212 } 2191 2213 #endif … … 2794 2816 case WebEvent::TouchEnd: 2795 2817 case WebEvent::TouchCancel: { 2796 NativeWebTouchEvent event= m_touchEventQueue.first();2797 MESSAGE_CHECK(type == event.type());2818 QueuedTouchEvents queuedEvents = m_touchEventQueue.first(); 2819 MESSAGE_CHECK(type == queuedEvents.forwardedEvent.type()); 2798 2820 m_touchEventQueue.removeFirst(); 2799 2821 2800 m_pageClient->doneWithTouchEvent(event, handled); 2822 m_pageClient->doneWithTouchEvent(queuedEvents.forwardedEvent, handled); 2823 for (size_t i = 0; i < queuedEvents.deferredTouchEvents.size(); ++i) { 2824 bool isEventHandled = false; 2825 m_pageClient->doneWithTouchEvent(queuedEvents.deferredTouchEvents.at(i), isEventHandled); 2826 } 2801 2827 break; 2802 2828 } … … 3003 3029 3004 3030 m_processingMouseMoveEvent = false; 3031 3032 #if ENABLE(TOUCH_EVENTS) 3033 m_needTouchEvents = false; 3034 m_touchEventQueue.clear(); 3035 #endif 3005 3036 3006 3037 #if PLATFORM(MAC) && !defined(BUILDING_ON_SNOW_LEOPARD) -
trunk/Source/WebKit2/UIProcess/WebPageProxy.h
r90550 r90629 62 62 #include <wtf/PassRefPtr.h> 63 63 #include <wtf/RefPtr.h> 64 #include <wtf/Vector.h> 64 65 #include <wtf/text/WTFString.h> 65 66 #if PLATFORM(EFL) … … 132 133 typedef GenericCallback<WKStringRef, StringImpl*> StringCallback; 133 134 typedef GenericCallback<WKSerializedScriptValueRef, WebSerializedScriptValue*> ScriptValueCallback; 135 136 #if ENABLE(TOUCH_EVENTS) 137 struct QueuedTouchEvents { 138 QueuedTouchEvents(const NativeWebTouchEvent& event) 139 : forwardedEvent(event) 140 { 141 } 142 NativeWebTouchEvent forwardedEvent; 143 Vector<NativeWebTouchEvent> deferredTouchEvents; 144 }; 145 #endif 134 146 135 147 // FIXME: Make a version of CallbackBase with three arguments, and define ValidateCommandCallback as a specialization. … … 652 664 void didFindZoomableArea(const WebCore::IntRect&); 653 665 #endif 666 #if ENABLE(TOUCH_EVENTS) 667 void needTouchEvents(bool); 668 #endif 654 669 655 670 void editorStateChanged(const EditorState&); … … 870 885 871 886 Deque<NativeWebKeyboardEvent> m_keyEventQueue; 872 #if ENABLE(TOUCH_EVENTS)873 Deque<NativeWebTouchEvent> m_touchEventQueue;874 #endif875 887 Deque<NativeWebWheelEvent> m_wheelEventQueue; 876 888 Vector<NativeWebWheelEvent> m_currentlyProcessedWheelEvents; … … 879 891 OwnPtr<NativeWebMouseEvent> m_nextMouseMoveEvent; 880 892 OwnPtr<NativeWebMouseEvent> m_currentlyProcessedMouseDownEvent; 893 894 #if ENABLE(TOUCH_EVENTS) 895 bool m_needTouchEvents; 896 Deque<QueuedTouchEvents> m_touchEventQueue; 897 #endif 881 898 882 899 uint64_t m_pageID; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in
r89582 r90629 74 74 DidFindZoomableArea(WebCore::IntRect area) 75 75 #endif 76 #if ENABLE(TOUCH_EVENTS) 77 NeedTouchEvents(bool needTouchEvents) 78 #endif 76 79 77 80 # Policy messages -
trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
r89430 r90629 730 730 731 731 #if ENABLE(TOUCH_EVENTS) 732 void WebChromeClient::needTouchEvents(bool) 733 { 732 void WebChromeClient::needTouchEvents(bool needTouchEvents) 733 { 734 m_page->send(Messages::WebPageProxy::NeedTouchEvents(needTouchEvents)); 734 735 } 735 736 #endif
Note: See TracChangeset
for help on using the changeset viewer.