<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[174817] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/174817">174817</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-17 03:04:37 -0700 (Fri, 17 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] Move touch events handling from Platform to WebKit2
https://bugs.webkit.org/show_bug.cgi?id=137735

Reviewed by Sergio Villar Senin.

Source/WebCore:

Remove GtkTouchContextHelper.

* PlatformGTK.cmake:
* platform/gtk/GtkTouchContextHelper.cpp: Removed.
* platform/gtk/GtkTouchContextHelper.h: Removed.

Source/WebKit2:

GtkTouchContextHelper was only used by WebKitWebViewBase, since
it's the only one that can create touch events. The code has been
simplified by processing the events in the view, and the native
touch events are now created with the native event and touch points.

* Shared/NativeWebTouchEvent.h:
(WebKit::NativeWebTouchEvent::touchContext): Deleted.
* Shared/gtk/NativeWebTouchEventGtk.cpp:
(WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Pass touch
points instead of touch context to WebEventFactory::createWebTouchEvent().
* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebTouchEvent): Create the
WebTouchEvent for the given native event and points.
(WebKit::touchPhaseFromEvents): Deleted.
(WebKit::appendTouchEvent): Deleted.
* Shared/gtk/WebEventFactory.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(appendTouchEvent): Helper function to create a
WebPlatformTouchPoint for the given native event and add it to the
list of touch points.
(webkitWebViewBaseGetTouchPointForEvent): Build the touch point
list for the event.
(webkitWebViewBaseTouchEvent): Process the touch event.
(webkitWebViewBaseDragDataReceived): Deleted.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformGTKcmake">trunk/Source/WebCore/PlatformGTK.cmake</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedNativeWebTouchEventh">trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h</a></li>
<li><a href="#trunkSourceWebKit2SharedgtkNativeWebTouchEventGtkcpp">trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedgtkWebEventFactorycpp">trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedgtkWebEventFactoryh">trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp">trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreplatformgtkGtkTouchContextHelpercpp">trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkGtkTouchContextHelperh">trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebCore/ChangeLog        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-10-17  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Move touch events handling from Platform to WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=137735
+
+        Reviewed by Sergio Villar Senin.
+
+        Remove GtkTouchContextHelper.
+
+        * PlatformGTK.cmake:
+        * platform/gtk/GtkTouchContextHelper.cpp: Removed.
+        * platform/gtk/GtkTouchContextHelper.h: Removed.
+
</ins><span class="cx"> 2014-10-17  Gyuyoung Kim  &lt;gyuyoung.kim@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove unused function in WorkerThreadableLoader.h 
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformGTK.cmake (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformGTK.cmake        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebCore/PlatformGTK.cmake        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -225,7 +225,6 @@
</span><span class="cx">     platform/gtk/GtkClickCounter.cpp
</span><span class="cx">     platform/gtk/GtkDragAndDropHelper.cpp
</span><span class="cx">     platform/gtk/GtkInputMethodFilter.cpp
</span><del>-    platform/gtk/GtkTouchContextHelper.cpp
</del><span class="cx">     platform/gtk/GtkUtilities.cpp
</span><span class="cx">     platform/gtk/GtkVersioning.c
</span><span class="cx">     platform/gtk/KeyBindingTranslator.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkGtkTouchContextHelpercpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.cpp        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -1,65 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Carlos Garnacho &lt;carlosg@gnome.org&gt;
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include &quot;config.h&quot;
-#include &quot;GtkTouchContextHelper.h&quot;
-
-#include &lt;gtk/gtk.h&gt;
-
-namespace WebCore {
-
-bool GtkTouchContextHelper::handleEvent(GdkEvent* touchEvent)
-{
-#ifndef GTK_API_VERSION_2
-    uint32_t sequence = GPOINTER_TO_UINT(gdk_event_get_event_sequence(touchEvent));
-
-    switch (touchEvent-&gt;type) {
-    case GDK_TOUCH_BEGIN: {
-        ASSERT(!m_touchEvents.contains(sequence));
-        GUniquePtr&lt;GdkEvent&gt; event(gdk_event_copy(touchEvent));
-        m_touchEvents.add(sequence, WTF::move(event));
-        break;
-    }
-    case GDK_TOUCH_UPDATE: {
-        auto it = m_touchEvents.find(sequence);
-        ASSERT(it != m_touchEvents.end());
-        it-&gt;value.reset(gdk_event_copy(touchEvent));
-        break;
-    }
-    case GDK_TOUCH_END:
-        ASSERT(m_touchEvents.contains(sequence));
-        m_touchEvents.remove(sequence);
-        break;
-    default:
-        return false;
-    }
-#else
-    UNUSED_PARAM(touchEvent);
-#endif // GTK_API_VERSION_2
-
-    return true;
-}
-
-} // namespace WebCore
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkGtkTouchContextHelperh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebCore/platform/gtk/GtkTouchContextHelper.h        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 Carlos Garnacho &lt;carlosg@gnome.org&gt;
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GtkTouchContextHelper_h
-#define GtkTouchContextHelper_h
-
-#include &quot;GUniquePtrGtk.h&quot;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/Noncopyable.h&gt;
-
-namespace WebCore {
-
-typedef HashMap&lt;uint32_t, GUniquePtr&lt;GdkEvent&gt;&gt; TouchEventsMap;
-
-class GtkTouchContextHelper {
-    WTF_MAKE_NONCOPYABLE(GtkTouchContextHelper);
-public:
-    GtkTouchContextHelper() { };
-    bool handleEvent(GdkEvent*);
-    const TouchEventsMap&amp; touchEvents() const { return m_touchEvents; };
-
-private:
-    TouchEventsMap m_touchEvents;
-};
-
-} // namespace WebCore
-
-#endif
</del></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebKit2/ChangeLog        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2014-10-17  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        [GTK] Move touch events handling from Platform to WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=137735
+
+        Reviewed by Sergio Villar Senin.
+
+        GtkTouchContextHelper was only used by WebKitWebViewBase, since
+        it's the only one that can create touch events. The code has been
+        simplified by processing the events in the view, and the native
+        touch events are now created with the native event and touch points.
+
+        * Shared/NativeWebTouchEvent.h:
+        (WebKit::NativeWebTouchEvent::touchContext): Deleted.
+        * Shared/gtk/NativeWebTouchEventGtk.cpp:
+        (WebKit::NativeWebTouchEvent::NativeWebTouchEvent): Pass touch
+        points instead of touch context to WebEventFactory::createWebTouchEvent().
+        * Shared/gtk/WebEventFactory.cpp:
+        (WebKit::WebEventFactory::createWebTouchEvent): Create the
+        WebTouchEvent for the given native event and points.
+        (WebKit::touchPhaseFromEvents): Deleted.
+        (WebKit::appendTouchEvent): Deleted.
+        * Shared/gtk/WebEventFactory.h:
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (appendTouchEvent): Helper function to create a
+        WebPlatformTouchPoint for the given native event and add it to the
+        list of touch points.
+        (webkitWebViewBaseGetTouchPointForEvent): Build the touch point
+        list for the event.
+        (webkitWebViewBaseTouchEvent): Process the touch event.
+        (webkitWebViewBaseDragDataReceived): Deleted.
+
</ins><span class="cx"> 2014-10-16  Pascal Jacquemart  &lt;p.jacquemart@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Removing CUSTOM_PROTOCOLS guard
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedNativeWebTouchEventh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebKit2/Shared/NativeWebTouchEvent.h        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx"> struct _UIWebTouchEvent;
</span><span class="cx"> #elif PLATFORM(GTK)
</span><span class="cx"> #include &lt;WebCore/GUniquePtrGtk.h&gt;
</span><del>-#include &lt;WebCore/GtkTouchContextHelper.h&gt;
</del><span class="cx"> #elif PLATFORM(EFL)
</span><span class="cx"> #include &quot;EwkTouchEvent.h&quot;
</span><span class="cx"> #include &lt;WebCore/AffineTransform.h&gt;
</span><span class="lines">@@ -49,9 +48,8 @@
</span><span class="cx">     explicit NativeWebTouchEvent(const _UIWebTouchEvent*);
</span><span class="cx"> #elif PLATFORM(GTK)
</span><span class="cx">     NativeWebTouchEvent(const NativeWebTouchEvent&amp;);
</span><del>-    NativeWebTouchEvent(GdkEvent*, WebCore::GtkTouchContextHelper&amp;);
</del><ins>+    NativeWebTouchEvent(GdkEvent*, const Vector&lt;WebPlatformTouchPoint&gt;&amp;);
</ins><span class="cx">     const GdkEvent* nativeEvent() const { return m_nativeEvent.get(); }
</span><del>-    const WebCore::GtkTouchContextHelper&amp; touchContext() const { return m_touchContext; }
</del><span class="cx"> #elif PLATFORM(EFL)
</span><span class="cx">     NativeWebTouchEvent(EwkTouchEvent*, const WebCore::AffineTransform&amp;);
</span><span class="cx">     const EwkTouchEvent* nativeEvent() const { return m_nativeEvent.get(); }
</span><span class="lines">@@ -60,7 +58,6 @@
</span><span class="cx"> private:
</span><span class="cx"> #if PLATFORM(GTK)
</span><span class="cx">     GUniquePtr&lt;GdkEvent&gt; m_nativeEvent;
</span><del>-    const WebCore::GtkTouchContextHelper&amp; m_touchContext;
</del><span class="cx"> #elif PLATFORM(EFL)
</span><span class="cx">     RefPtr&lt;EwkTouchEvent&gt; m_nativeEvent;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkNativeWebTouchEventGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebKit2/Shared/gtk/NativeWebTouchEventGtk.cpp        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -31,17 +31,15 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><del>-NativeWebTouchEvent::NativeWebTouchEvent(GdkEvent* event, WebCore::GtkTouchContextHelper&amp; context)
-    : WebTouchEvent(WebEventFactory::createWebTouchEvent(event, context))
</del><ins>+NativeWebTouchEvent::NativeWebTouchEvent(GdkEvent* event, const Vector&lt;WebPlatformTouchPoint&gt;&amp; touchPoints)
+    : WebTouchEvent(WebEventFactory::createWebTouchEvent(event, touchPoints))
</ins><span class="cx">     , m_nativeEvent(gdk_event_copy(event))
</span><del>-    , m_touchContext(context)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NativeWebTouchEvent::NativeWebTouchEvent(const NativeWebTouchEvent&amp; event)
</span><del>-    : WebTouchEvent(WebEventFactory::createWebTouchEvent(event.nativeEvent(), event.touchContext()))
</del><ins>+    : WebTouchEvent(WebEventFactory::createWebTouchEvent(event.nativeEvent(), event.touchPoints()))
</ins><span class="cx">     , m_nativeEvent(gdk_event_copy(event.nativeEvent()))
</span><del>-    , m_touchContext(event.touchContext())
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkWebEventFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebKit2/Shared/gtk/WebEventFactory.cpp        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -204,46 +204,10 @@
</span><span class="cx">                             gdk_event_get_time(event));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#ifndef GTK_API_VERSION_2
-static WebPlatformTouchPoint::TouchPointState touchPhaseFromEvents(const GdkEvent* current, const GdkEvent* event)
</del><ins>+WebTouchEvent WebEventFactory::createWebTouchEvent(const GdkEvent* event, const Vector&lt;WebPlatformTouchPoint&gt;&amp; touchPoints)
</ins><span class="cx"> {
</span><del>-    if (gdk_event_get_event_sequence(current) != gdk_event_get_event_sequence(event))
-        return WebPlatformTouchPoint::TouchStationary;
-
-    switch (current-&gt;type) {
-    case GDK_TOUCH_UPDATE:
-        return WebPlatformTouchPoint::TouchMoved;
-    case GDK_TOUCH_BEGIN:
-        return WebPlatformTouchPoint::TouchPressed;
-    case GDK_TOUCH_END:
-        return WebPlatformTouchPoint::TouchReleased;
-    default:
-        return WebPlatformTouchPoint::TouchStationary;
-    }
-}
-
-static void appendTouchEvent(Vector&lt;WebPlatformTouchPoint&gt;&amp; touchPointList, const GdkEvent* event, WebPlatformTouchPoint::TouchPointState state)
-{
-    uint32_t identifier = GPOINTER_TO_UINT(gdk_event_get_event_sequence(event));
-
-    gdouble x, y;
-    gdk_event_get_coords(event, &amp;x, &amp;y);
-
-    gdouble xRoot, yRoot;
-    gdk_event_get_root_coords(event, &amp;xRoot, &amp;yRoot);
-
-    WebPlatformTouchPoint touchPoint(identifier, state, IntPoint(xRoot, yRoot), IntPoint(x, y));
-    touchPointList.uncheckedAppend(touchPoint);
-}
-#endif // GTK_API_VERSION_2
-
-WebTouchEvent WebEventFactory::createWebTouchEvent(const GdkEvent* event, const WebCore::GtkTouchContextHelper&amp; touchContext)
-{
</del><span class="cx"> #ifndef GTK_API_VERSION_2
</span><span class="cx">     WebEvent::Type type = WebEvent::NoType;
</span><del>-    const auto&amp; touchEvents = touchContext.touchEvents();
-    int numEvents = touchEvents.size();
-
</del><span class="cx">     switch (event-&gt;type) {
</span><span class="cx">     case GDK_TOUCH_BEGIN:
</span><span class="cx">         type = WebEvent::TouchStart;
</span><span class="lines">@@ -253,23 +217,12 @@
</span><span class="cx">         break;
</span><span class="cx">     case GDK_TOUCH_END:
</span><span class="cx">         type = WebEvent::TouchEnd;
</span><del>-        ++numEvents;
</del><span class="cx">         break;
</span><span class="cx">     default:
</span><span class="cx">         ASSERT_NOT_REACHED();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    Vector&lt;WebPlatformTouchPoint&gt; touchPointList;
-    touchPointList.reserveInitialCapacity(numEvents);
-
-    for (auto it = touchEvents.begin(); it != touchEvents.end(); ++it)
-        appendTouchEvent(touchPointList, it-&gt;value.get(), touchPhaseFromEvents(it-&gt;value.get(), event));
-
-    // Touch was already removed from the GtkTouchContextHelper, add it here.
-    if (event-&gt;type == GDK_TOUCH_END)
-        appendTouchEvent(touchPointList, event, WebPlatformTouchPoint::TouchReleased);
-
-    return WebTouchEvent(type, touchPointList, modifiersForEvent(event), gdk_event_get_time(event));
</del><ins>+    return WebTouchEvent(type, touchPoints, modifiersForEvent(event), gdk_event_get_time(event));
</ins><span class="cx"> #else
</span><span class="cx">     return WebTouchEvent();
</span><span class="cx"> #endif // GTK_API_VERSION_2
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedgtkWebEventFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebKit2/Shared/gtk/WebEventFactory.h        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;WebEvent.h&quot;
</span><span class="cx"> #include &lt;WebCore/CompositionResults.h&gt;
</span><del>-#include &lt;WebCore/GtkTouchContextHelper.h&gt;
</del><span class="cx"> 
</span><span class="cx"> typedef union _GdkEvent GdkEvent;
</span><span class="cx"> 
</span><span class="lines">@@ -40,7 +39,7 @@
</span><span class="cx">     static WebMouseEvent createWebMouseEvent(const GdkEvent*, int);
</span><span class="cx">     static WebWheelEvent createWebWheelEvent(const GdkEvent*);
</span><span class="cx">     static WebKeyboardEvent createWebKeyboardEvent(const GdkEvent*, const WebCore::CompositionResults&amp;);
</span><del>-    static WebTouchEvent createWebTouchEvent(const GdkEvent*, const WebCore::GtkTouchContextHelper&amp;);
</del><ins>+    static WebTouchEvent createWebTouchEvent(const GdkEvent*, const Vector&lt;WebPlatformTouchPoint&gt;&amp;);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIgtkWebKitWebViewBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (174816 => 174817)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2014-10-17 10:00:09 UTC (rev 174816)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp        2014-10-17 10:04:37 UTC (rev 174817)
</span><span class="lines">@@ -55,7 +55,6 @@
</span><span class="cx"> #include &lt;WebCore/GUniquePtrGtk.h&gt;
</span><span class="cx"> #include &lt;WebCore/GtkClickCounter.h&gt;
</span><span class="cx"> #include &lt;WebCore/GtkDragAndDropHelper.h&gt;
</span><del>-#include &lt;WebCore/GtkTouchContextHelper.h&gt;
</del><span class="cx"> #include &lt;WebCore/GtkUtilities.h&gt;
</span><span class="cx"> #include &lt;WebCore/GtkVersioning.h&gt;
</span><span class="cx"> #include &lt;WebCore/NotImplemented.h&gt;
</span><span class="lines">@@ -88,6 +87,7 @@
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> typedef HashMap&lt;GtkWidget*, IntRect&gt; WebKitWebViewChildrenMap;
</span><ins>+typedef HashMap&lt;uint32_t, GUniquePtr&lt;GdkEvent&gt;&gt; TouchEventsMap;
</ins><span class="cx"> 
</span><span class="cx"> #if USE(TEXTURE_MAPPER_GL) &amp;&amp; PLATFORM(X11)
</span><span class="cx"> void redirectedWindowDamagedCallback(void* data);
</span><span class="lines">@@ -117,7 +117,7 @@
</span><span class="cx">     GUniquePtr&lt;GdkEvent&gt; contextMenuEvent;
</span><span class="cx">     WebContextMenuProxyGtk* activeContextMenuProxy;
</span><span class="cx">     WebViewBaseInputMethodFilter inputMethodFilter;
</span><del>-    GtkTouchContextHelper touchContext;
</del><ins>+    TouchEventsMap touchEvents;
</ins><span class="cx"> 
</span><span class="cx">     GtkWindow* toplevelOnScreenWindow;
</span><span class="cx"> #if !GTK_CHECK_VERSION(3, 13, 4)
</span><span class="lines">@@ -741,6 +741,48 @@
</span><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static void appendTouchEvent(Vector&lt;WebPlatformTouchPoint&gt;&amp; touchPoints, const GdkEvent* event, WebPlatformTouchPoint::TouchPointState state)
+{
+    gdouble x, y;
+    gdk_event_get_coords(event, &amp;x, &amp;y);
+
+    gdouble xRoot, yRoot;
+    gdk_event_get_root_coords(event, &amp;xRoot, &amp;yRoot);
+
+    uint32_t identifier = GPOINTER_TO_UINT(gdk_event_get_event_sequence(event));
+    touchPoints.uncheckedAppend(WebPlatformTouchPoint(identifier, state, IntPoint(xRoot, yRoot), IntPoint(x, y)));
+}
+
+static inline WebPlatformTouchPoint::TouchPointState touchPointStateForEvents(const GdkEvent* current, const GdkEvent* event)
+{
+    if (gdk_event_get_event_sequence(current) != gdk_event_get_event_sequence(event))
+        return WebPlatformTouchPoint::TouchStationary;
+
+    switch (current-&gt;type) {
+    case GDK_TOUCH_UPDATE:
+        return WebPlatformTouchPoint::TouchMoved;
+    case GDK_TOUCH_BEGIN:
+        return WebPlatformTouchPoint::TouchPressed;
+    case GDK_TOUCH_END:
+        return WebPlatformTouchPoint::TouchReleased;
+    default:
+        return WebPlatformTouchPoint::TouchStationary;
+    }
+}
+
+static void webkitWebViewBaseGetTouchPointsForEvent(WebKitWebViewBase* webViewBase, GdkEvent* event, Vector&lt;WebPlatformTouchPoint&gt;&amp; touchPoints)
+{
+    WebKitWebViewBasePrivate* priv = webViewBase-&gt;priv;
+    touchPoints.reserveInitialCapacity(event-&gt;type == GDK_TOUCH_END ? priv-&gt;touchEvents.size() + 1 : priv-&gt;touchEvents.size());
+
+    for (const auto&amp; it : priv-&gt;touchEvents)
+        appendTouchEvent(touchPoints, it.value.get(), touchPointStateForEvents(it.value.get(), event));
+
+    // Touch was already removed from the TouchEventsMap, add it here.
+    if (event-&gt;type == GDK_TOUCH_END)
+        appendTouchEvent(touchPoints, event, WebPlatformTouchPoint::TouchReleased);
+}
+
</ins><span class="cx"> static gboolean webkitWebViewBaseTouchEvent(GtkWidget* widget, GdkEventTouch* event)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)-&gt;priv;
</span><span class="lines">@@ -748,9 +790,34 @@
</span><span class="cx">     if (priv-&gt;authenticationDialog)
</span><span class="cx">         return TRUE;
</span><span class="cx"> 
</span><del>-    priv-&gt;touchContext.handleEvent(reinterpret_cast&lt;GdkEvent*&gt;(event));
-    priv-&gt;pageProxy-&gt;handleTouchEvent(NativeWebTouchEvent(reinterpret_cast&lt;GdkEvent*&gt;(event), priv-&gt;touchContext));
</del><ins>+    GdkEvent* touchEvent = reinterpret_cast&lt;GdkEvent*&gt;(event);
+    uint32_t sequence = GPOINTER_TO_UINT(gdk_event_get_event_sequence(touchEvent));
</ins><span class="cx"> 
</span><ins>+    switch (touchEvent-&gt;type) {
+    case GDK_TOUCH_BEGIN: {
+        ASSERT(!priv-&gt;touchEvents.contains(sequence));
+        GUniquePtr&lt;GdkEvent&gt; event(gdk_event_copy(touchEvent));
+        priv-&gt;touchEvents.add(sequence, WTF::move(event));
+        break;
+    }
+    case GDK_TOUCH_UPDATE: {
+        auto it = priv-&gt;touchEvents.find(sequence);
+        ASSERT(it != priv-&gt;touchEvents.end());
+        it-&gt;value.reset(gdk_event_copy(touchEvent));
+        break;
+    }
+    case GDK_TOUCH_END:
+        ASSERT(priv-&gt;touchEvents.contains(sequence));
+        priv-&gt;touchEvents.remove(sequence);
+        break;
+    default:
+        break;
+    }
+
+    Vector&lt;WebPlatformTouchPoint&gt; touchPoints;
+    webkitWebViewBaseGetTouchPointsForEvent(WEBKIT_WEB_VIEW_BASE(widget), touchEvent, touchPoints);
+    priv-&gt;pageProxy-&gt;handleTouchEvent(NativeWebTouchEvent(reinterpret_cast&lt;GdkEvent*&gt;(event), touchPoints));
+
</ins><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>