<!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>[127948] 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/127948">127948</a></dd>
<dt>Author</dt> <dd>jamesr@google.com</dd>
<dt>Date</dt> <dd>2012-09-07 18:22:54 -0700 (Fri, 07 Sep 2012)</dd>
</dl>

<h3>Log Message</h3>
<pre>[chromium] Implement WebCompositorInputHandlerImpl on top of exposed API instead of CC internals
https://bugs.webkit.org/show_bug.cgi?id=96151

Reviewed by Adrienne Walker.

Source/Platform:

This adds public input handling interfaces for the compositor.

* chromium/public/WebInputHandler.h:
(WebKit):
(WebInputHandler):
(WebKit::WebInputHandler::~WebInputHandler):
* chromium/public/WebInputHandlerClient.h:
(WebKit):
(WebInputHandlerClient):
(WebKit::WebInputHandlerClient::~WebInputHandlerClient):
* chromium/public/WebLayerTreeView.h:
(WebLayerTreeView):
* chromium/public/WebLayerTreeViewClient.h:
(WebKit):
(WebKit::WebLayerTreeViewClient::createInputHandler):
(WebLayerTreeViewClient):

Source/WebCore:

Reworks the CC hookup for input handling to be more similar to the OutputSurface handling. If on compositor
startup we want to initialize threaded input handling, we ask the embedder for a CCInputHandler implementation
via CCLayerTreeHostClient. If the client provides one, we later bind this to a CCInputHandlerClient (actually
CCLayerTreeHostImpl) from the compositor thread.

* platform/graphics/chromium/cc/CCInputHandler.h:
(WebCore):
(CCInputHandler):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::initialize):
(WebCore::CCLayerTreeHost::createInputHandler):
(WebCore):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCLayerTreeHostClient.h:
(WebCore):
(CCLayerTreeHostClient):
* platform/graphics/chromium/cc/CCProxy.h:
(CCProxy):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(CCSingleThreadProxy):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::start):
(WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
(WebCore::CCThreadProxy::initializeImplOnImplThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(CCThreadProxy):

Source/WebKit/chromium:

Moves input handler setup code up to the WebKit layer instead of reaching in to CC internals.
WebLayerTreeViewImpl implements createInputHandler() by asking its embedder for a WebInputHandler. If one is
provided, it wraps the WebInputHandler in a CCInputHandler implementation to pass down to CC.

WebViewImpl implements WebLayerTreeView::createInputHandler() by constructing a WebCompositorInputHandlerImpl
and storing its identifier for the didActivateCompositor call.  From this point on the setup is the same as
before.

WCIHI changes covered by unit tests, overall scrolling behavior manually tested.

* WebKit.gypi:
* src/WebCompositorInputHandlerImpl.cpp:
(WebKit::WebCompositorInputHandlerImpl::fromIdentifier):
(WebKit::WebCompositorInputHandlerImpl::WebCompositorInputHandlerImpl):
(WebKit::WebCompositorInputHandlerImpl::~WebCompositorInputHandlerImpl):
(WebKit::WebCompositorInputHandlerImpl::setClient):
(WebKit::WebCompositorInputHandlerImpl::handleInputEvent):
(WebKit::WebCompositorInputHandlerImpl::handleInputEventInternal):
(WebKit::WebCompositorInputHandlerImpl::handleGestureFling):
(WebKit::WebCompositorInputHandlerImpl::bindToClient):
* src/WebCompositorInputHandlerImpl.h:
(WebCompositorInputHandlerImpl):
(WebKit::WebCompositorInputHandlerImpl::identifier):
* src/WebLayerTreeViewImpl.cpp:
(WebKit::WebLayerTreeViewImpl::createInputHandler):
(WebKit):
* src/WebLayerTreeViewImpl.h:
(WebLayerTreeViewImpl):
* src/WebToCCInputHandlerAdapter.cpp: Added.
(WebKit):
(WebKit::WebToCCInputHandlerAdapter::create):
(WebKit::WebToCCInputHandlerAdapter::WebToCCInputHandlerAdapter):
(WebKit::WebToCCInputHandlerAdapter::~WebToCCInputHandlerAdapter):
(WebToCCInputHandlerAdapter::ClientAdapter):
(WebKit::WebToCCInputHandlerAdapter::ClientAdapter::ClientAdapter):
(WebKit::WebToCCInputHandlerAdapter::ClientAdapter::~ClientAdapter):
(WebKit::WebToCCInputHandlerAdapter::bindToClient):
(WebKit::WebToCCInputHandlerAdapter::animate):
* src/WebToCCInputHandlerAdapter.h: Copied from Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostClient.h.
(WebKit):
(WebToCCInputHandlerAdapter):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::WebViewImpl):
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
(WebKit):
(WebKit::WebViewImpl::createInputHandler):
* src/WebViewImpl.h:
(WebViewImpl):
* tests/CCThreadedTest.cpp:
* tests/FakeCCLayerTreeHostClient.h:
* tests/WebCompositorInputHandlerImplTest.cpp:
(MockWebInputHandlerClient):
(WebKit::MockWebInputHandlerClient::MockWebInputHandlerClient):
(WebKit::MockWebInputHandlerClient::~MockWebInputHandlerClient):
(WebKit::WebCompositorInputHandlerImplTest::WebCompositorInputHandlerImplTest):
(WebCompositorInputHandlerImplTest):
(WebKit::TEST_F):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourcePlatformChangeLog">trunk/Source/Platform/ChangeLog</a></li>
<li><a href="#trunkSourcePlatformchromiumpublicWebLayerTreeViewh">trunk/Source/Platform/chromium/public/WebLayerTreeView.h</a></li>
<li><a href="#trunkSourcePlatformchromiumpublicWebLayerTreeViewClienth">trunk/Source/Platform/chromium/public/WebLayerTreeViewClient.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCInputHandlerh">trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHostcpp">trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHosth">trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHostClienth">trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCProxyh">trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCSingleThreadProxycpp">trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCSingleThreadProxyh">trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCThreadProxycpp">trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicschromiumccCCThreadProxyh">trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h</a></li>
<li><a href="#trunkSourceWebKitchromiumChangeLog">trunk/Source/WebKit/chromium/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitchromiumWebKitgyp">trunk/Source/WebKit/chromium/WebKit.gyp</a></li>
<li><a href="#trunkSourceWebKitchromiumWebKitgypi">trunk/Source/WebKit/chromium/WebKit.gypi</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebCompositorInputHandlerImplcpp">trunk/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.cpp</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebCompositorInputHandlerImplh">trunk/Source/WebKit/chromium/src/WebCompositorInputHandlerImpl.h</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebLayerTreeViewImplcpp">trunk/Source/WebKit/chromium/src/WebLayerTreeViewImpl.cpp</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebLayerTreeViewImplh">trunk/Source/WebKit/chromium/src/WebLayerTreeViewImpl.h</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebViewImplcpp">trunk/Source/WebKit/chromium/src/WebViewImpl.cpp</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebViewImplh">trunk/Source/WebKit/chromium/src/WebViewImpl.h</a></li>
<li><a href="#trunkSourceWebKitchromiumtestsCCThreadedTestcpp">trunk/Source/WebKit/chromium/tests/CCThreadedTest.cpp</a></li>
<li><a href="#trunkSourceWebKitchromiumtestsFakeCCLayerTreeHostClienth">trunk/Source/WebKit/chromium/tests/FakeCCLayerTreeHostClient.h</a></li>
<li><a href="#trunkSourceWebKitchromiumtestsWebCompositorInputHandlerImplTestcpp">trunk/Source/WebKit/chromium/tests/WebCompositorInputHandlerImplTest.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourcePlatformchromiumpublicWebInputHandlerh">trunk/Source/Platform/chromium/public/WebInputHandler.h</a></li>
<li><a href="#trunkSourcePlatformchromiumpublicWebInputHandlerClienth">trunk/Source/Platform/chromium/public/WebInputHandlerClient.h</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebToCCInputHandlerAdaptercpp">trunk/Source/WebKit/chromium/src/WebToCCInputHandlerAdapter.cpp</a></li>
<li><a href="#trunkSourceWebKitchromiumsrcWebToCCInputHandlerAdapterh">trunk/Source/WebKit/chromium/src/WebToCCInputHandlerAdapter.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourcePlatformChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/Platform/ChangeLog (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/ChangeLog        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/Platform/ChangeLog        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2012-09-07  James Robinson  &lt;jamesr@chromium.org&gt;
+
+        [chromium] Implement WebCompositorInputHandlerImpl on top of exposed API instead of CC internals
+        https://bugs.webkit.org/show_bug.cgi?id=96151
+
+        Reviewed by Adrienne Walker.
+
+        This adds public input handling interfaces for the compositor.
+
+        * chromium/public/WebInputHandler.h:
+        (WebKit):
+        (WebInputHandler):
+        (WebKit::WebInputHandler::~WebInputHandler):
+        * chromium/public/WebInputHandlerClient.h:
+        (WebKit):
+        (WebInputHandlerClient):
+        (WebKit::WebInputHandlerClient::~WebInputHandlerClient):
+        * chromium/public/WebLayerTreeView.h:
+        (WebLayerTreeView):
+        * chromium/public/WebLayerTreeViewClient.h:
+        (WebKit):
+        (WebKit::WebLayerTreeViewClient::createInputHandler):
+        (WebLayerTreeViewClient):
+
</ins><span class="cx"> 2012-09-07  Tommy Widenflycht  &lt;tommyw@google.com&gt;
</span><span class="cx"> 
</span><span class="cx">         MediaStream API: add RTCPeerConnection::createAnswer
</span></span></pre></div>
<a id="trunkSourcePlatformchromiumpublicWebInputHandlerhfromrev127946trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHostClienth"></a>
<div class="copfile"><h4>Copied: trunk/Source/Platform/chromium/public/WebInputHandler.h (from rev 127946, trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostClient.h) (0 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/chromium/public/WebInputHandler.h                                (rev 0)
+++ trunk/Source/Platform/chromium/public/WebInputHandler.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+/* Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * 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 WebInputHandler_h
+#define WebInputHandler_h
+
+namespace WebKit {
+class WebInputHandlerClient;
+
+class WebInputHandler {
+public:
+    virtual ~WebInputHandler() { }
+
+    virtual void bindToClient(WebInputHandlerClient*) = 0;
+    virtual void animate(double monotonicTime) = 0;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourcePlatformchromiumpublicWebInputHandlerClienthfromrev127946trunkSourceWebCoreplatformgraphicschromiumccCCInputHandlerh"></a>
<div class="copfile"><h4>Copied: trunk/Source/Platform/chromium/public/WebInputHandlerClient.h (from rev 127946, trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h) (0 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/chromium/public/WebInputHandlerClient.h                                (rev 0)
+++ trunk/Source/Platform/chromium/public/WebInputHandlerClient.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -0,0 +1,81 @@
</span><ins>+/* Copyright (C) 2012 Google Inc. All rights reserved.
+ *
+ * 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 WebInputHandlerClient_h
+#define WebInputHandlerClient_h
+
+#include &quot;WebCommon.h&quot;
+#include &quot;WebPoint.h&quot;
+#include &quot;WebSize.h&quot;
+
+namespace WebKit {
+
+class WebInputHandlerClient {
+public:
+    enum ScrollStatus {
+        ScrollStatusOnMainThread,
+        ScrollStatusStarted,
+        ScrollStatusIgnored
+    };
+    enum ScrollInputType {
+        ScrollInputTypeGesture,
+        ScrollInputTypeWheel
+    };
+
+    // Selects a layer to be scrolled at a given point in window coordinates.
+    // Returns ScrollStarted if the layer at the coordinates can be scrolled,
+    // ScrollOnMainThread if the scroll event should instead be delegated to the
+    // main thread, or ScrollIgnored if there is nothing to be scrolled at the
+    // given coordinates.
+    virtual ScrollStatus scrollBegin(WebPoint, ScrollInputType) = 0;
+
+    // Scroll the selected layer starting at the given window coordinate. If
+    // there is no room to move the layer in the requested direction, its first
+    // ancestor layer that can be scrolled will be moved instead. Should only be
+    // called if scrollBegin() returned ScrollStarted.
+    virtual void scrollBy(WebPoint, WebSize) = 0;
+
+    // Stop scrolling the selected layer. Should only be called if scrollBegin()
+    // returned ScrollStarted.
+    virtual void scrollEnd() = 0;
+
+    virtual void pinchGestureBegin() = 0;
+    virtual void pinchGestureUpdate(float magnifyDelta, WebPoint anchor) = 0;
+    virtual void pinchGestureEnd() = 0;
+
+    virtual void startPageScaleAnimation(WebSize targetPosition,
+                                         bool anchorPoint,
+                                         float pageScale,
+                                         double startTime,
+                                         double duration) = 0;
+
+    // Request another callback to WebInputHandler::animate().
+    virtual void scheduleAnimation() = 0;
+
+protected:
+    virtual ~WebInputHandlerClient() { }
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourcePlatformchromiumpublicWebLayerTreeViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/Platform/chromium/public/WebLayerTreeView.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/chromium/public/WebLayerTreeView.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/Platform/chromium/public/WebLayerTreeView.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -84,11 +84,7 @@
</span><span class="cx">     virtual void setRootLayer(const WebLayer&amp;) = 0;
</span><span class="cx">     virtual void clearRootLayer() = 0;
</span><span class="cx"> 
</span><del>-    // Returns a unique identifier that can be used on the compositor thread to request a
-    // WebCompositorInputHandler instance.
-    virtual int compositorIdentifier() = 0;
</del><span class="cx"> 
</span><del>-
</del><span class="cx">     // View properties ---------------------------------------------------
</span><span class="cx"> 
</span><span class="cx">     virtual void setViewportSize(const WebSize&amp; layoutViewportSize, const WebSize&amp; deviceViewportSize = WebSize()) = 0;
</span></span></pre></div>
<a id="trunkSourcePlatformchromiumpublicWebLayerTreeViewClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/Platform/chromium/public/WebLayerTreeViewClient.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/Platform/chromium/public/WebLayerTreeViewClient.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/Platform/chromium/public/WebLayerTreeViewClient.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -28,8 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> class WebCompositorOutputSurface;
</span><ins>+class WebInputHandler;
+class WebThread;
</ins><span class="cx"> struct WebSize;
</span><del>-class WebThread;
</del><span class="cx"> 
</span><span class="cx"> class WebLayerTreeViewClient {
</span><span class="cx"> public:
</span><span class="lines">@@ -72,6 +73,8 @@
</span><span class="cx">     // 3D context event).
</span><span class="cx">     virtual void didRecreateOutputSurface(bool success) { }
</span><span class="cx"> 
</span><ins>+    virtual WebInputHandler* createInputHandler() { return 0; }
+
</ins><span class="cx">     // Indicates that a frame will be committed to the impl side of the compositor
</span><span class="cx">     // for rendering.
</span><span class="cx">     virtual void willCommit() { }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/ChangeLog        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2012-09-07  James Robinson  &lt;jamesr@chromium.org&gt;
+
+        [chromium] Implement WebCompositorInputHandlerImpl on top of exposed API instead of CC internals
+        https://bugs.webkit.org/show_bug.cgi?id=96151
+
+        Reviewed by Adrienne Walker.
+
+        Reworks the CC hookup for input handling to be more similar to the OutputSurface handling. If on compositor
+        startup we want to initialize threaded input handling, we ask the embedder for a CCInputHandler implementation
+        via CCLayerTreeHostClient. If the client provides one, we later bind this to a CCInputHandlerClient (actually
+        CCLayerTreeHostImpl) from the compositor thread.
+
+        * platform/graphics/chromium/cc/CCInputHandler.h:
+        (WebCore):
+        (CCInputHandler):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
+        (WebCore::CCLayerTreeHost::CCLayerTreeHost):
+        (WebCore::CCLayerTreeHost::initialize):
+        (WebCore::CCLayerTreeHost::createInputHandler):
+        (WebCore):
+        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
+        (CCLayerTreeHost):
+        * platform/graphics/chromium/cc/CCLayerTreeHostClient.h:
+        (WebCore):
+        (CCLayerTreeHostClient):
+        * platform/graphics/chromium/cc/CCProxy.h:
+        (CCProxy):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
+        (WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
+        * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
+        (CCSingleThreadProxy):
+        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
+        (WebCore::CCThreadProxy::CCThreadProxy):
+        (WebCore::CCThreadProxy::start):
+        (WebCore::CCThreadProxy::scheduledActionDrawAndSwapInternal):
+        (WebCore::CCThreadProxy::initializeImplOnImplThread):
+        * platform/graphics/chromium/cc/CCThreadProxy.h:
+        (CCThreadProxy):
+
</ins><span class="cx"> 2012-09-07  Adam Barth  &lt;abarth@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         [V8] Use a v8::Object rather than a v8::Context to represent the creationContext
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCInputHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -36,9 +36,9 @@
</span><span class="cx"> // the impl thread side of the compositor implementation.
</span><span class="cx"> //
</span><span class="cx"> // There is one CCInputHandler for every CCLayerTreeHost. It is
</span><del>-// created and used only on the impl thread.
</del><ins>+// created on the main thread and used only on the impl thread.
</ins><span class="cx"> //
</span><del>-// The CCInputHandler is constructed with an InputHandlerClient, which is the
</del><ins>+// The CCInputHandler is constructed with a CCInputHandlerClient, which is the
</ins><span class="cx"> // interface by which the handler can manipulate the LayerTree.
</span><span class="cx"> class CCInputHandlerClient {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(CCInputHandlerClient);
</span><span class="lines">@@ -84,10 +84,9 @@
</span><span class="cx"> class CCInputHandler {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(CCInputHandler);
</span><span class="cx"> public:
</span><del>-    static PassOwnPtr&lt;CCInputHandler&gt; create(CCInputHandlerClient*);
</del><span class="cx">     virtual ~CCInputHandler() { }
</span><span class="cx"> 
</span><del>-    virtual int identifier() const = 0;
</del><ins>+    virtual void bindToClient(CCInputHandlerClient*) = 0;
</ins><span class="cx">     virtual void animate(double monotonicTime) = 0;
</span><span class="cx"> 
</span><span class="cx"> protected:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHostcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -70,8 +70,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CCLayerTreeHost::CCLayerTreeHost(CCLayerTreeHostClient* client, const CCLayerTreeSettings&amp; settings)
</span><del>-    : m_compositorIdentifier(-1)
-    , m_animating(false)
</del><ins>+    : m_animating(false)
</ins><span class="cx">     , m_needsAnimateLayers(false)
</span><span class="cx">     , m_client(client)
</span><span class="cx">     , m_commitNumber(0)
</span><span class="lines">@@ -105,11 +104,7 @@
</span><span class="cx">         m_proxy = CCSingleThreadProxy::create(this);
</span><span class="cx">     m_proxy-&gt;start();
</span><span class="cx"> 
</span><del>-    if (!m_proxy-&gt;initializeContext())
-        return false;
-
-    m_compositorIdentifier = m_proxy-&gt;compositorIdentifier();
-    return true;
</del><ins>+    return m_proxy-&gt;initializeContext();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CCLayerTreeHost::~CCLayerTreeHost()
</span><span class="lines">@@ -292,6 +287,11 @@
</span><span class="cx">     return m_client-&gt;createOutputSurface();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassOwnPtr&lt;CCInputHandler&gt; CCLayerTreeHost::createInputHandler()
+{
+    return m_client-&gt;createInputHandler();
+}
+
</ins><span class="cx"> PassOwnPtr&lt;CCLayerTreeHostImpl&gt; CCLayerTreeHost::createLayerTreeHostImpl(CCLayerTreeHostImplClient* client)
</span><span class="cx"> {
</span><span class="cx">     return CCLayerTreeHostImpl::create(m_settings, client);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHosth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -144,6 +144,7 @@
</span><span class="cx">     void willCommit();
</span><span class="cx">     void commitComplete();
</span><span class="cx">     PassOwnPtr&lt;CCGraphicsContext&gt; createContext();
</span><ins>+    PassOwnPtr&lt;CCInputHandler&gt; createInputHandler();
</ins><span class="cx">     virtual PassOwnPtr&lt;CCLayerTreeHostImpl&gt; createLayerTreeHostImpl(CCLayerTreeHostImplClient*);
</span><span class="cx">     void didLoseContext();
</span><span class="cx">     enum RecreateResult {
</span><span class="lines">@@ -162,8 +163,6 @@
</span><span class="cx"> 
</span><span class="cx">     CCLayerTreeHostClient* client() { return m_client; }
</span><span class="cx"> 
</span><del>-    int compositorIdentifier() const { return m_compositorIdentifier; }
-
</del><span class="cx">     // Only used when compositing on the main thread.
</span><span class="cx">     void composite();
</span><span class="cx">     void scheduleComposite();
</span><span class="lines">@@ -267,8 +266,6 @@
</span><span class="cx">     bool animateLayersRecursive(LayerChromium* current, double monotonicTime);
</span><span class="cx">     void setAnimationEventsRecursive(const CCAnimationEventsVector&amp;, LayerChromium*, double wallClockTime);
</span><span class="cx"> 
</span><del>-    int m_compositorIdentifier;
-
</del><span class="cx">     bool m_animating;
</span><span class="cx">     bool m_needsAnimateLayers;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCLayerTreeHostClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostClient.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostClient.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostClient.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><ins>+class CCInputHandler;
</ins><span class="cx"> class IntSize;
</span><span class="cx"> 
</span><span class="cx"> class CCLayerTreeHostClient {
</span><span class="lines">@@ -44,6 +45,7 @@
</span><span class="cx">     virtual void applyScrollAndScale(const IntSize&amp; scrollDelta, float pageScale) = 0;
</span><span class="cx">     virtual PassOwnPtr&lt;WebKit::WebCompositorOutputSurface&gt; createOutputSurface() = 0;
</span><span class="cx">     virtual void didRecreateOutputSurface(bool success) = 0;
</span><ins>+    virtual PassOwnPtr&lt;CCInputHandler&gt; createInputHandler() = 0;
</ins><span class="cx">     virtual void willCommit() = 0;
</span><span class="cx">     virtual void didCommit() = 0;
</span><span class="cx">     virtual void didCommitAndDrawFrame() = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -79,8 +79,6 @@
</span><span class="cx">     // reinitialized.
</span><span class="cx">     virtual bool recreateContext() = 0;
</span><span class="cx"> 
</span><del>-    virtual int compositorIdentifier() const = 0;
-
</del><span class="cx">     virtual void implSideRenderingStats(CCRenderingStats&amp;) = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual const RendererCapabilities&amp; rendererCapabilities() const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCSingleThreadProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -46,7 +46,6 @@
</span><span class="cx"> CCSingleThreadProxy::CCSingleThreadProxy(CCLayerTreeHost* layerTreeHost)
</span><span class="cx">     : m_layerTreeHost(layerTreeHost)
</span><span class="cx">     , m_contextLost(false)
</span><del>-    , m_compositorIdentifier(-1)
</del><span class="cx">     , m_rendererInitialized(false)
</span><span class="cx">     , m_nextFrameIsNewlyCommittedFrame(false)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCSingleThreadProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -50,7 +50,6 @@
</span><span class="cx">     virtual void setVisible(bool) OVERRIDE;
</span><span class="cx">     virtual bool initializeRenderer() OVERRIDE;
</span><span class="cx">     virtual bool recreateContext() OVERRIDE;
</span><del>-    virtual int compositorIdentifier() const OVERRIDE { return m_compositorIdentifier; }
</del><span class="cx">     virtual void implSideRenderingStats(CCRenderingStats&amp;) OVERRIDE;
</span><span class="cx">     virtual const RendererCapabilities&amp; rendererCapabilities() const OVERRIDE;
</span><span class="cx">     virtual void loseContext() OVERRIDE;
</span><span class="lines">@@ -88,7 +87,6 @@
</span><span class="cx">     // Accessed on main thread only.
</span><span class="cx">     CCLayerTreeHost* m_layerTreeHost;
</span><span class="cx">     bool m_contextLost;
</span><del>-    int m_compositorIdentifier;
</del><span class="cx"> 
</span><span class="cx">     // Holds on to the context between initializeContext() and initializeRenderer() calls. Shouldn't
</span><span class="cx">     // be used for anything else.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCThreadProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -71,7 +71,6 @@
</span><span class="cx">     , m_commitRequestSentToImplThread(false)
</span><span class="cx">     , m_forcedCommitRequested(false)
</span><span class="cx">     , m_layerTreeHost(layerTreeHost)
</span><del>-    , m_compositorIdentifier(-1)
</del><span class="cx">     , m_rendererInitialized(false)
</span><span class="cx">     , m_started(false)
</span><span class="cx">     , m_texturesAcquired(true)
</span><span class="lines">@@ -271,12 +270,6 @@
</span><span class="cx">     return recreateSucceeded;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-int CCThreadProxy::compositorIdentifier() const
-{
-    ASSERT(isMainThread());
-    return m_compositorIdentifier;
-}
-
</del><span class="cx"> void CCThreadProxy::implSideRenderingStats(CCRenderingStats&amp; stats)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="lines">@@ -409,7 +402,8 @@
</span><span class="cx">     // Create LayerTreeHostImpl.
</span><span class="cx">     DebugScopedSetMainThreadBlocked mainThreadBlocked;
</span><span class="cx">     CCCompletionEvent completion;
</span><del>-    CCProxy::implThread()-&gt;postTask(createCCThreadTask(this, &amp;CCThreadProxy::initializeImplOnImplThread, &amp;completion));
</del><ins>+    OwnPtr&lt;CCInputHandler&gt; handler = m_layerTreeHost-&gt;createInputHandler();
+    CCProxy::implThread()-&gt;postTask(createCCThreadTask(this, &amp;CCThreadProxy::initializeImplOnImplThread, &amp;completion, handler.release()));
</ins><span class="cx">     completion.wait();
</span><span class="cx"> 
</span><span class="cx">     m_started = true;
</span><span class="lines">@@ -702,7 +696,8 @@
</span><span class="cx">     double monotonicTime = monotonicallyIncreasingTime();
</span><span class="cx">     double wallClockTime = currentTime();
</span><span class="cx"> 
</span><del>-    m_inputHandlerOnImplThread-&gt;animate(monotonicTime);
</del><ins>+    if (m_inputHandlerOnImplThread)
+        m_inputHandlerOnImplThread-&gt;animate(monotonicTime);
</ins><span class="cx">     m_layerTreeHostImpl-&gt;animate(monotonicTime, wallClockTime);
</span><span class="cx"> 
</span><span class="cx">     // This method is called on a forced draw, regardless of whether we are able to produce a frame,
</span><span class="lines">@@ -855,7 +850,7 @@
</span><span class="cx">         m_contextRecreationTimer.clear();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CCThreadProxy::initializeImplOnImplThread(CCCompletionEvent* completion)
</del><ins>+void CCThreadProxy::initializeImplOnImplThread(CCCompletionEvent* completion, PassOwnPtr&lt;CCInputHandler&gt; popHandler)
</ins><span class="cx"> {
</span><span class="cx">     TRACE_EVENT0(&quot;cc&quot;, &quot;CCThreadProxy::initializeImplOnImplThread&quot;);
</span><span class="cx">     ASSERT(isImplThread());
</span><span class="lines">@@ -869,8 +864,9 @@
</span><span class="cx">     m_schedulerOnImplThread = CCScheduler::create(this, frameRateController.release());
</span><span class="cx">     m_schedulerOnImplThread-&gt;setVisible(m_layerTreeHostImpl-&gt;visible());
</span><span class="cx"> 
</span><del>-    m_inputHandlerOnImplThread = CCInputHandler::create(m_layerTreeHostImpl.get());
-    m_compositorIdentifier = m_inputHandlerOnImplThread-&gt;identifier();
</del><ins>+    m_inputHandlerOnImplThread = popHandler;
+    if (m_inputHandlerOnImplThread)
+        m_inputHandlerOnImplThread-&gt;bindToClient(m_layerTreeHostImpl.get());
</ins><span class="cx"> 
</span><span class="cx">     completion-&gt;signal();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicschromiumccCCThreadProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -59,7 +59,6 @@
</span><span class="cx">     virtual void setVisible(bool) OVERRIDE;
</span><span class="cx">     virtual bool initializeRenderer() OVERRIDE;
</span><span class="cx">     virtual bool recreateContext() OVERRIDE;
</span><del>-    virtual int compositorIdentifier() const OVERRIDE;
</del><span class="cx">     virtual void implSideRenderingStats(CCRenderingStats&amp;) OVERRIDE;
</span><span class="cx">     virtual const RendererCapabilities&amp; rendererCapabilities() const OVERRIDE;
</span><span class="cx">     virtual void loseContext() OVERRIDE;
</span><span class="lines">@@ -133,7 +132,7 @@
</span><span class="cx">     void requestReadbackOnImplThread(ReadbackRequest*);
</span><span class="cx">     void requestStartPageScaleAnimationOnImplThread(IntSize targetPosition, bool useAnchor, float scale, double durationSec);
</span><span class="cx">     void finishAllRenderingOnImplThread(CCCompletionEvent*);
</span><del>-    void initializeImplOnImplThread(CCCompletionEvent*);
</del><ins>+    void initializeImplOnImplThread(CCCompletionEvent*, PassOwnPtr&lt;CCInputHandler&gt;);
</ins><span class="cx">     void setSurfaceReadyOnImplThread();
</span><span class="cx">     void setVisibleOnImplThread(CCCompletionEvent*, bool);
</span><span class="cx">     void initializeContextOnImplThread(CCGraphicsContext*);
</span><span class="lines">@@ -154,7 +153,6 @@
</span><span class="cx">     bool m_forcedCommitRequested;
</span><span class="cx">     OwnPtr&lt;CCThreadProxyContextRecreationTimer&gt; m_contextRecreationTimer;
</span><span class="cx">     CCLayerTreeHost* m_layerTreeHost;
</span><del>-    int m_compositorIdentifier;
</del><span class="cx">     bool m_rendererInitialized;
</span><span class="cx">     RendererCapabilities m_RendererCapabilitiesMainThreadCopy;
</span><span class="cx">     bool m_started;
</span></span></pre></div>
<a id="trunkSourceWebKitchromiumChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/chromium/ChangeLog (127947 => 127948)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/chromium/ChangeLog        2012-09-08 01:20:02 UTC (rev 127947)
+++ trunk/Source/WebKit/chromium/ChangeLog        2012-09-08 01:22:54 UTC (rev 127948)
</span><span class="lines">@@ -1,3 +1,68 @@
</span><ins>+2012-09-07  James Robinson  &lt;jamesr@chromium.org&gt;
+
+        [chromium] Implement WebCompositorInputHandlerImpl on top of exposed API instead of CC internals
+        https://bugs.webkit.org/show_bug.cgi?id=96151
+
+        Reviewed by Adrienne Walker.
+
+        Moves input handler setup code up to the WebKit layer instead of reaching in to CC internals.
+        WebLayerTreeViewImpl implements createInputHandler() by asking its embedder for a WebInputHandler. If one is
+        provided, it wraps the WebInputHandler in a CCInputHandler implementation to pass down to CC.
+
+        WebViewImpl implements WebLayerTreeView::createInputHandler() by constructing a WebCompositorInputHandlerImpl
+        and storing its identifier for the didActivateCompositor call.