<!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>[172180] trunk/Source/WebCore</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/172180">172180</a></dd>
<dt>Author</dt> <dd>burg@cs.washington.edu</dd>
<dt>Date</dt> <dd>2014-08-06 14:53:17 -0700 (Wed, 06 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Replay: dispatch timing information should be stored out-of-line in a replay segment
https://bugs.webkit.org/show_bug.cgi?id=135295

Reviewed by Timothy Hatcher.

We need to save a timestamp for each event loop input so that replay can
simulate the original user and network delays. Currently that timestamp
is stored on each EventLoopInput instance.

This patch stores timestamp data in a separate vector attached to the segment.
The event loop input class is now immutable, and new auxiliary data can be added
without adding members to the EventLoopInput class.

As part of the refactoring, InputCursors now keep a reference to the relevant
session segment instead of a reference to their input storage. InputCursors can
be created directly, instead of through ReplaySessionSegment.

No new tests. No behavior was changed.

* inspector/InspectorReplayAgent.cpp:
(WebCore::buildInspectorObjectForInput): Don't send the timestamp with the input.
(WebCore::buildInspectorObjectForSegment):
* inspector/protocol/Replay.json: Remove optional timestamp field for ReplayInput.
* replay/CapturingInputCursor.cpp:
(WebCore::CapturingInputCursor::CapturingInputCursor):
(WebCore::CapturingInputCursor::create):
(WebCore::CapturingInputCursor::storeInput): Save event loop input timings here.
* replay/CapturingInputCursor.h:
* replay/EventLoopInput.h:
(WebCore::EventLoopInputBase::EventLoopInputBase): Deleted.
(WebCore::EventLoopInputBase::timestamp): Deleted.
(WebCore::EventLoopInputBase::setTimestamp): Deleted.
* replay/EventLoopInputDispatcher.cpp: Use a struct for dispatch information.
(WebCore::EventLoopInputDispatcher::EventLoopInputDispatcher):
(WebCore::EventLoopInputDispatcher::dispatchInputSoon):
(WebCore::EventLoopInputDispatcher::dispatchInput):
* replay/EventLoopInputDispatcher.h:
* replay/FunctorInputCursor.h:
(WebCore::FunctorInputCursor::forEachInputInQueue):
(WebCore::FunctorInputCursor::FunctorInputCursor):
* replay/ReplayController.cpp:
(WebCore::ReplayController::createSegment):
(WebCore::ReplayController::loadSegmentAtIndex):
(WebCore::ReplayController::unloadSegment): Deleted.
(WebCore::ReplayController::startPlayback): Deleted.
* replay/ReplaySessionSegment.cpp:
(WebCore::ReplaySessionSegment::createCapturingCursor): Deleted.
(WebCore::ReplaySessionSegment::createReplayingCursor): Deleted.
(WebCore::ReplaySessionSegment::createFunctorCursor): Deleted.
* replay/ReplaySessionSegment.h:
(WebCore::ReplaySessionSegment::storage):
(WebCore::ReplaySessionSegment::eventLoopTimings):
* replay/ReplayingInputCursor.cpp:
(WebCore::ReplayingInputCursor::ReplayingInputCursor):
(WebCore::ReplayingInputCursor::create):
(WebCore::ReplayingInputCursor::uncheckedLoadInput):
(WebCore::ReplayingInputCursor::loadEventLoopInput): Added. This method collates
and returns the next event loop input with its associated dispatch information.
* replay/ReplayingInputCursor.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorReplayAgentcpp">trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorprotocolReplayjson">trunk/Source/WebCore/inspector/protocol/Replay.json</a></li>
<li><a href="#trunkSourceWebCorereplayCapturingInputCursorcpp">trunk/Source/WebCore/replay/CapturingInputCursor.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayCapturingInputCursorh">trunk/Source/WebCore/replay/CapturingInputCursor.h</a></li>
<li><a href="#trunkSourceWebCorereplayEventLoopInputh">trunk/Source/WebCore/replay/EventLoopInput.h</a></li>
<li><a href="#trunkSourceWebCorereplayEventLoopInputDispatchercpp">trunk/Source/WebCore/replay/EventLoopInputDispatcher.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayEventLoopInputDispatcherh">trunk/Source/WebCore/replay/EventLoopInputDispatcher.h</a></li>
<li><a href="#trunkSourceWebCorereplayFunctorInputCursorh">trunk/Source/WebCore/replay/FunctorInputCursor.h</a></li>
<li><a href="#trunkSourceWebCorereplayReplayControllercpp">trunk/Source/WebCore/replay/ReplayController.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayReplaySessionSegmentcpp">trunk/Source/WebCore/replay/ReplaySessionSegment.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayReplaySessionSegmenth">trunk/Source/WebCore/replay/ReplaySessionSegment.h</a></li>
<li><a href="#trunkSourceWebCorereplayReplayingInputCursorcpp">trunk/Source/WebCore/replay/ReplayingInputCursor.cpp</a></li>
<li><a href="#trunkSourceWebCorereplayReplayingInputCursorh">trunk/Source/WebCore/replay/ReplayingInputCursor.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/ChangeLog        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2014-08-06  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
+
+        Web Replay: dispatch timing information should be stored out-of-line in a replay segment
+        https://bugs.webkit.org/show_bug.cgi?id=135295
+
+        Reviewed by Timothy Hatcher.
+
+        We need to save a timestamp for each event loop input so that replay can
+        simulate the original user and network delays. Currently that timestamp
+        is stored on each EventLoopInput instance.
+
+        This patch stores timestamp data in a separate vector attached to the segment.
+        The event loop input class is now immutable, and new auxiliary data can be added
+        without adding members to the EventLoopInput class.
+
+        As part of the refactoring, InputCursors now keep a reference to the relevant
+        session segment instead of a reference to their input storage. InputCursors can
+        be created directly, instead of through ReplaySessionSegment.
+
+        No new tests. No behavior was changed.
+
+        * inspector/InspectorReplayAgent.cpp:
+        (WebCore::buildInspectorObjectForInput): Don't send the timestamp with the input.
+        (WebCore::buildInspectorObjectForSegment):
+        * inspector/protocol/Replay.json: Remove optional timestamp field for ReplayInput.
+        * replay/CapturingInputCursor.cpp:
+        (WebCore::CapturingInputCursor::CapturingInputCursor):
+        (WebCore::CapturingInputCursor::create):
+        (WebCore::CapturingInputCursor::storeInput): Save event loop input timings here.
+        * replay/CapturingInputCursor.h:
+        * replay/EventLoopInput.h:
+        (WebCore::EventLoopInputBase::EventLoopInputBase): Deleted.
+        (WebCore::EventLoopInputBase::timestamp): Deleted.
+        (WebCore::EventLoopInputBase::setTimestamp): Deleted.
+        * replay/EventLoopInputDispatcher.cpp: Use a struct for dispatch information.
+        (WebCore::EventLoopInputDispatcher::EventLoopInputDispatcher):
+        (WebCore::EventLoopInputDispatcher::dispatchInputSoon):
+        (WebCore::EventLoopInputDispatcher::dispatchInput):
+        * replay/EventLoopInputDispatcher.h:
+        * replay/FunctorInputCursor.h:
+        (WebCore::FunctorInputCursor::forEachInputInQueue):
+        (WebCore::FunctorInputCursor::FunctorInputCursor):
+        * replay/ReplayController.cpp:
+        (WebCore::ReplayController::createSegment):
+        (WebCore::ReplayController::loadSegmentAtIndex):
+        (WebCore::ReplayController::unloadSegment): Deleted.
+        (WebCore::ReplayController::startPlayback): Deleted.
+        * replay/ReplaySessionSegment.cpp:
+        (WebCore::ReplaySessionSegment::createCapturingCursor): Deleted.
+        (WebCore::ReplaySessionSegment::createReplayingCursor): Deleted.
+        (WebCore::ReplaySessionSegment::createFunctorCursor): Deleted.
+        * replay/ReplaySessionSegment.h:
+        (WebCore::ReplaySessionSegment::storage):
+        (WebCore::ReplaySessionSegment::eventLoopTimings):
+        * replay/ReplayingInputCursor.cpp:
+        (WebCore::ReplayingInputCursor::ReplayingInputCursor):
+        (WebCore::ReplayingInputCursor::create):
+        (WebCore::ReplayingInputCursor::uncheckedLoadInput):
+        (WebCore::ReplayingInputCursor::loadEventLoopInput): Added. This method collates
+        and returns the next event loop input with its associated dispatch information.
+        * replay/ReplayingInputCursor.h:
+
</ins><span class="cx"> 2014-08-06  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Document-relative overlays disappear after doing page-cache navigations
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorReplayAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/inspector/InspectorReplayAgent.cpp        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -71,9 +71,6 @@
</span><span class="cx">         .setOffset(offset)
</span><span class="cx">         .setData(encodedInput.asObject());
</span><span class="cx"> 
</span><del>-    if (input.queue() == InputQueue::EventLoopInput)
-        inputObject-&gt;setTimestamp(static_cast&lt;const EventLoopInputBase&amp;&gt;(input).timestamp());
-
</del><span class="cx">     return inputObject.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -141,7 +138,7 @@
</span><span class="cx">     for (size_t i = 0; i &lt; static_cast&lt;size_t&gt;(InputQueue::Count); i++) {
</span><span class="cx">         SerializeInputToJSONFunctor collector;
</span><span class="cx">         InputQueue queue = static_cast&lt;InputQueue&gt;(i);
</span><del>-        RefPtr&lt;FunctorInputCursor&gt; functorCursor = segment-&gt;createFunctorCursor();
</del><ins>+        RefPtr&lt;FunctorInputCursor&gt; functorCursor = FunctorInputCursor::create(segment);
</ins><span class="cx">         RefPtr&lt;TypeBuilder::Array&lt;TypeBuilder::Replay::ReplayInput&gt;&gt; queueInputs = functorCursor-&gt;forEachInputInQueue(queue, collector);
</span><span class="cx"> 
</span><span class="cx">         RefPtr&lt;TypeBuilder::Replay::ReplayInputQueue&gt; queueObject = TypeBuilder::Replay::ReplayInputQueue::create()
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorprotocolReplayjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/protocol/Replay.json (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/protocol/Replay.json        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/inspector/protocol/Replay.json        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -34,7 +34,6 @@
</span><span class="cx">             &quot;properties&quot;: [
</span><span class="cx">                 { &quot;name&quot;: &quot;type&quot;, &quot;type&quot;: &quot;string&quot;, &quot;description&quot;: &quot;Input type.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;offset&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Offset of this input in its respective queue.&quot;},
</span><del>-                { &quot;name&quot;: &quot;timestamp&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;The timestamp of this input.&quot; },
</del><span class="cx">                 { &quot;name&quot;: &quot;data&quot;, &quot;type&quot;: &quot;object&quot;, &quot;description&quot;: &quot;Per-input payload.&quot; }
</span><span class="cx">             ]
</span><span class="cx">         },
</span></span></pre></div>
<a id="trunkSourceWebCorereplayCapturingInputCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/CapturingInputCursor.cpp (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/CapturingInputCursor.cpp        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/CapturingInputCursor.cpp        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -30,13 +30,16 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> 
</span><ins>+#include &quot;EventLoopInput.h&quot;
</ins><span class="cx"> #include &quot;Logging.h&quot;
</span><ins>+#include &quot;ReplaySessionSegment.h&quot;
</ins><span class="cx"> #include &quot;SegmentedInputStorage.h&quot;
</span><ins>+#include &lt;wtf/CurrentTime.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-CapturingInputCursor::CapturingInputCursor(SegmentedInputStorage&amp; storage)
-    : m_storage(storage)
</del><ins>+CapturingInputCursor::CapturingInputCursor(PassRefPtr&lt;ReplaySessionSegment&gt; segment)
+    : m_segment(segment)
</ins><span class="cx">     , m_withinEventLoopInputExtent(false)
</span><span class="cx"> {
</span><span class="cx">     LOG(WebReplay, &quot;%-30sCreated capture cursor=%p.\n&quot;, &quot;[ReplayController]&quot;, this);
</span><span class="lines">@@ -47,15 +50,22 @@
</span><span class="cx">     LOG(WebReplay, &quot;%-30sDestroyed capture cursor=%p.\n&quot;, &quot;[ReplayController]&quot;, this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;CapturingInputCursor&gt; CapturingInputCursor::create(SegmentedInputStorage&amp; storage)
</del><ins>+PassRefPtr&lt;CapturingInputCursor&gt; CapturingInputCursor::create(PassRefPtr&lt;ReplaySessionSegment&gt; segment)
</ins><span class="cx"> {
</span><del>-    return adoptRef(new CapturingInputCursor(storage));
</del><ins>+    return adoptRef(new CapturingInputCursor(segment));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CapturingInputCursor::storeInput(std::unique_ptr&lt;NondeterministicInputBase&gt; input)
</span><span class="cx"> {
</span><del>-    ASSERT(input);
-    m_storage.store(WTF::move(input));
</del><ins>+    ASSERT_ARG(input, input);
+
+    if (input-&gt;queue() == InputQueue::EventLoopInput) {
+        // FIXME: rewrite this (and related dispatch code) to use std::chrono.
+        double now = monotonicallyIncreasingTime();
+        m_segment-&gt;eventLoopTimings().append(now);
+    }
+
+    m_segment-&gt;storage().store(WTF::move(input));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NondeterministicInputBase* CapturingInputCursor::loadInput(InputQueue, const AtomicString&amp;)
</span></span></pre></div>
<a id="trunkSourceWebCorereplayCapturingInputCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/CapturingInputCursor.h (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/CapturingInputCursor.h        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/CapturingInputCursor.h        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -36,12 +36,13 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class EventLoopInputExtent;
</span><del>-class SegmentedInputStorage;
</del><ins>+class Page;
+class ReplaySessionSegment;
</ins><span class="cx"> 
</span><span class="cx"> class CapturingInputCursor final : public InputCursor {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(CapturingInputCursor);
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;CapturingInputCursor&gt; create(SegmentedInputStorage&amp;);
</del><ins>+    static PassRefPtr&lt;CapturingInputCursor&gt; create(PassRefPtr&lt;ReplaySessionSegment&gt;);
</ins><span class="cx">     virtual ~CapturingInputCursor();
</span><span class="cx"> 
</span><span class="cx">     virtual bool isCapturing() const override { return true; }
</span><span class="lines">@@ -50,15 +51,16 @@
</span><span class="cx">     void setWithinEventLoopInputExtent(bool);
</span><span class="cx">     bool withinEventLoopInputExtent() const { return m_withinEventLoopInputExtent; }
</span><span class="cx"> 
</span><del>-    virtual NondeterministicInputBase* uncheckedLoadInput(InputQueue) override;
-    virtual void storeInput(std::unique_ptr&lt;NondeterministicInputBase&gt;) override;
</del><span class="cx"> protected:
</span><span class="cx">     virtual NondeterministicInputBase* loadInput(InputQueue, const AtomicString&amp; type) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit CapturingInputCursor(SegmentedInputStorage&amp;);
</del><ins>+    CapturingInputCursor(PassRefPtr&lt;ReplaySessionSegment&gt;);
</ins><span class="cx"> 
</span><del>-    SegmentedInputStorage&amp; m_storage;
</del><ins>+    virtual NondeterministicInputBase* uncheckedLoadInput(InputQueue) override;
+    virtual void storeInput(std::unique_ptr&lt;NondeterministicInputBase&gt;) override;
+
+    RefPtr&lt;ReplaySessionSegment&gt; m_segment;
</ins><span class="cx">     bool m_withinEventLoopInputExtent;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorereplayEventLoopInputh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/EventLoopInput.h (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/EventLoopInput.h        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/EventLoopInput.h        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -55,20 +55,10 @@
</span><span class="cx"> 
</span><span class="cx"> class EventLoopInputBase : public NondeterministicInputBase {
</span><span class="cx"> public:
</span><del>-    EventLoopInputBase()
-        : m_timestamp(monotonicallyIncreasingTime())
-    {
-    }
-
</del><span class="cx">     virtual ~EventLoopInputBase() { }
</span><span class="cx">     virtual InputQueue queue() const override final { return InputQueue::EventLoopInput; }
</span><span class="cx"> 
</span><span class="cx">     virtual void dispatch(ReplayController&amp;) = 0;
</span><del>-
-    double timestamp() const { return m_timestamp; }
-    void setTimestamp(double timestamp) { m_timestamp = timestamp; }
-protected:
-    double m_timestamp;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template &lt;typename InputType&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorereplayEventLoopInputDispatchercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/EventLoopInputDispatcher.cpp (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/EventLoopInputDispatcher.cpp        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/EventLoopInputDispatcher.cpp        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -49,13 +49,14 @@
</span><span class="cx">     , m_client(client)
</span><span class="cx">     , m_cursor(cursor)
</span><span class="cx">     , m_timer(this, &amp;EventLoopInputDispatcher::timerFired)
</span><del>-    , m_runningInput(nullptr)
</del><span class="cx">     , m_dispatching(false)
</span><span class="cx">     , m_running(false)
</span><span class="cx">     , m_speed(DispatchSpeed::FastForward)
</span><span class="cx">     , m_previousDispatchStartTime(0.0)
</span><span class="cx">     , m_previousInputTimestamp(0.0)
</span><span class="cx"> {
</span><ins>+    m_currentWork.input = nullptr;
+    m_currentWork.timestamp = 0.0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void EventLoopInputDispatcher::run()
</span><span class="lines">@@ -88,8 +89,8 @@
</span><span class="cx">     ASSERT(m_running);
</span><span class="cx"> 
</span><span class="cx">     // We may already have an input if replay was paused just before dispatching.
</span><del>-    if (!m_runningInput)
-        m_runningInput = static_cast&lt;EventLoopInputBase*&gt;(m_cursor.uncheckedLoadInput(InputQueue::EventLoopInput));
</del><ins>+    if (!m_currentWork.input)
+        m_currentWork = m_cursor.loadEventLoopInput();
</ins><span class="cx"> 
</span><span class="cx">     if (m_timer.isActive())
</span><span class="cx">         m_timer.stop();
</span><span class="lines">@@ -103,9 +104,9 @@
</span><span class="cx">         // observed delay between the previous and current input.
</span><span class="cx"> 
</span><span class="cx">         if (!m_previousInputTimestamp)
</span><del>-            m_previousInputTimestamp = m_runningInput-&gt;timestamp();
</del><ins>+            m_previousInputTimestamp = m_currentWork.timestamp;
</ins><span class="cx"> 
</span><del>-        double targetInterval = m_runningInput-&gt;timestamp() - m_previousInputTimestamp;
</del><ins>+        double targetInterval = m_currentWork.timestamp - m_previousInputTimestamp;
</ins><span class="cx">         double elapsed = monotonicallyIncreasingTime() - m_previousDispatchStartTime;
</span><span class="cx">         waitInterval = targetInterval - elapsed;
</span><span class="cx">     }
</span><span class="lines">@@ -126,34 +127,34 @@
</span><span class="cx"> 
</span><span class="cx"> void EventLoopInputDispatcher::dispatchInput()
</span><span class="cx"> {
</span><del>-    ASSERT(m_runningInput);
</del><ins>+    ASSERT(m_currentWork.input);
</ins><span class="cx">     ASSERT(!m_dispatching);
</span><span class="cx"> 
</span><span class="cx">     if (m_speed == DispatchSpeed::RealTime) {
</span><span class="cx">         m_previousDispatchStartTime = monotonicallyIncreasingTime();
</span><del>-        m_previousInputTimestamp = m_runningInput-&gt;timestamp();
</del><ins>+        m_previousInputTimestamp = m_currentWork.timestamp;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if !LOG_DISABLED
</span><del>-    EncodedValue encodedInput = EncodingTraits&lt;NondeterministicInputBase&gt;::encodeValue(*m_runningInput);
</del><ins>+    EncodedValue encodedInput = EncodingTraits&lt;NondeterministicInputBase&gt;::encodeValue(*m_currentWork.input);
</ins><span class="cx">     String jsonString = encodedInput.asObject()-&gt;toJSONString();
</span><span class="cx"> 
</span><span class="cx">     LOG(WebReplay, &quot;%-20s ----------------------------------------------&quot;, &quot;ReplayEvents&quot;);
</span><del>-    LOG(WebReplay, &quot;%-20s &gt;DISPATCH: %s %s\n&quot;, &quot;ReplayEvents&quot;, m_runningInput-&gt;type().string().utf8().data(), jsonString.utf8().data());
</del><ins>+    LOG(WebReplay, &quot;%-20s &gt;DISPATCH: %s %s\n&quot;, &quot;ReplayEvents&quot;, m_currentWork.input-&gt;type().string().utf8().data(), jsonString.utf8().data());
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    m_client-&gt;willDispatchInput(*m_runningInput);
</del><ins>+    m_client-&gt;willDispatchInput(*m_currentWork.input);
</ins><span class="cx">     // Client could stop replay in the previous callback, so check again.
</span><span class="cx">     if (!m_running)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     {
</span><span class="cx">         TemporaryChange&lt;bool&gt; change(m_dispatching, true);
</span><del>-        m_runningInput-&gt;dispatch(m_page.replayController());
</del><ins>+        m_currentWork.input-&gt;dispatch(m_page.replayController());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    EventLoopInputBase* dispatchedInput = m_runningInput;
-    m_runningInput = nullptr;
</del><ins>+    EventLoopInputBase* dispatchedInput = m_currentWork.input;
+    m_currentWork.input = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     // Notify clients that the event was dispatched.
</span><span class="cx">     m_client-&gt;didDispatchInput(*dispatchedInput);
</span></span></pre></div>
<a id="trunkSourceWebCorereplayEventLoopInputDispatcherh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/EventLoopInputDispatcher.h (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/EventLoopInputDispatcher.h        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/EventLoopInputDispatcher.h        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;EventLoopInput.h&quot;
</span><ins>+#include &quot;ReplayingInputCursor.h&quot;
</ins><span class="cx"> #include &quot;Timer.h&quot;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="lines">@@ -39,7 +40,6 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class Page;
</span><del>-class ReplayingInputCursor;
</del><span class="cx"> 
</span><span class="cx"> enum class DispatchSpeed {
</span><span class="cx">     RealTime,
</span><span class="lines">@@ -79,8 +79,8 @@
</span><span class="cx">     ReplayingInputCursor&amp; m_cursor;
</span><span class="cx">     Timer&lt;EventLoopInputDispatcher&gt; m_timer;
</span><span class="cx"> 
</span><del>-    // This pointer is valid when an event loop input is presently dispatching.
-    EventLoopInputBase* m_runningInput;
</del><ins>+    // This data is valid when an event loop input is presently dispatching.
+    EventLoopInputData m_currentWork;
</ins><span class="cx">     // Whether the dispatcher is currently calling out to an inputs' dispatch() method.
</span><span class="cx">     bool m_dispatching;
</span><span class="cx">     // Whether the dispatcher is waiting to dispatch or actively dispatching inputs.
</span></span></pre></div>
<a id="trunkSourceWebCorereplayFunctorInputCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/FunctorInputCursor.h (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/FunctorInputCursor.h        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/FunctorInputCursor.h        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> 
</span><ins>+#include &quot;ReplaySessionSegment.h&quot;
</ins><span class="cx"> #include &quot;SegmentedInputStorage.h&quot;
</span><span class="cx"> #include &lt;replay/InputCursor.h&gt;
</span><span class="cx"> #include &lt;replay/NondeterministicInput.h&gt;
</span><span class="lines">@@ -42,9 +43,9 @@
</span><span class="cx"> class FunctorInputCursor final : public InputCursor {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(FunctorInputCursor);
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;FunctorInputCursor&gt; create(SegmentedInputStorage&amp; storage)
</del><ins>+    static PassRefPtr&lt;FunctorInputCursor&gt; create(PassRefPtr&lt;ReplaySessionSegment&gt; segment)
</ins><span class="cx">     {
</span><del>-        return adoptRef(new FunctorInputCursor(storage));
</del><ins>+        return adoptRef(new FunctorInputCursor(segment));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // InputCursor
</span><span class="lines">@@ -59,22 +60,22 @@
</span><span class="cx"> protected:
</span><span class="cx">     virtual NondeterministicInputBase* loadInput(InputQueue, const AtomicString&amp;) override;
</span><span class="cx"> private:
</span><del>-    FunctorInputCursor(SegmentedInputStorage&amp;);
</del><ins>+    FunctorInputCursor(PassRefPtr&lt;ReplaySessionSegment&gt;);
</ins><span class="cx"> 
</span><del>-    SegmentedInputStorage&amp; m_storage;
</del><ins>+    RefPtr&lt;ReplaySessionSegment&gt; m_segment;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename Functor&gt; inline
</span><span class="cx"> typename Functor::ReturnType FunctorInputCursor::forEachInputInQueue(InputQueue queue, Functor&amp; functor)
</span><span class="cx"> {
</span><del>-    for (size_t i = 0; i &lt; m_storage.queueSize(queue); i++)
-        functor(i, m_storage.queue(queue).at(i).get());
</del><ins>+    for (size_t i = 0; i &lt; m_segment-&gt;storage().queueSize(queue); i++)
+        functor(i, m_segment-&gt;storage().queue(queue).at(i).get());
</ins><span class="cx"> 
</span><span class="cx">     return functor.returnValue();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline FunctorInputCursor::FunctorInputCursor(SegmentedInputStorage&amp; storage)
-    : m_storage(storage)
</del><ins>+inline FunctorInputCursor::FunctorInputCursor(PassRefPtr&lt;ReplaySessionSegment&gt; segment)
+    : m_segment(segment)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplayControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayController.cpp (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayController.cpp        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/ReplayController.cpp        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -225,7 +225,7 @@
</span><span class="cx">     LOG(WebReplay, &quot;%-20s Created segment: %p.\n&quot;, &quot;ReplayController&quot;, m_loadedSegment.get());
</span><span class="cx">     InspectorInstrumentation::segmentCreated(&amp;m_page, m_loadedSegment);
</span><span class="cx"> 
</span><del>-    m_activeCursor = m_loadedSegment-&gt;createCapturingCursor(m_page);
</del><ins>+    m_activeCursor = CapturingInputCursor::create(m_loadedSegment);
</ins><span class="cx">     m_activeCursor-&gt;appendInput&lt;BeginSegmentSentinel&gt;();
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;InitialNavigation&gt; navigationInput = InitialNavigation::createFromPage(m_page);
</span><span class="lines">@@ -269,7 +269,7 @@
</span><span class="cx">     m_currentPosition.segmentOffset = segmentIndex;
</span><span class="cx">     m_currentPosition.inputOffset = 0;
</span><span class="cx"> 
</span><del>-    m_activeCursor = m_loadedSegment-&gt;createReplayingCursor(m_page, this);
</del><ins>+    m_activeCursor = ReplayingInputCursor::create(m_loadedSegment, m_page, this);
</ins><span class="cx"> 
</span><span class="cx">     LOG(WebReplay, &quot;%-20sLoading segment: %p.\n&quot;, &quot;ReplayController&quot;, segment.get());
</span><span class="cx">     InspectorInstrumentation::segmentLoaded(&amp;m_page, segment);
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplaySessionSegmentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplaySessionSegment.cpp (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplaySessionSegment.cpp        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/ReplaySessionSegment.cpp        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -35,6 +35,8 @@
</span><span class="cx"> #include &quot;ReplayingInputCursor.h&quot;
</span><span class="cx"> #include &quot;SegmentedInputStorage.h&quot;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><ins>+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -57,23 +59,6 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;CapturingInputCursor&gt; ReplaySessionSegment::createCapturingCursor(Page&amp;)
-{
-    ASSERT(m_canCapture);
-    m_canCapture = false;
-    return CapturingInputCursor::create(*m_storage);
-}
-
-PassRefPtr&lt;ReplayingInputCursor&gt; ReplaySessionSegment::createReplayingCursor(Page&amp; page, EventLoopInputDispatcherClient* client)
-{
-    return ReplayingInputCursor::create(*m_storage, page, client);
-}
-
-PassRefPtr&lt;FunctorInputCursor&gt; ReplaySessionSegment::createFunctorCursor()
-{
-    return FunctorInputCursor::create(*m_storage);
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_REPLAY)
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplaySessionSegmenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplaySessionSegment.h (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplaySessionSegment.h        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/ReplaySessionSegment.h        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -30,8 +30,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> 
</span><del>-#include &lt;replay/NondeterministicInput.h&gt;
</del><ins>+#include &lt;wtf/Forward.h&gt;
</ins><span class="cx"> #include &lt;wtf/RefCounted.h&gt;
</span><ins>+#include &lt;wtf/Vector.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -43,20 +44,25 @@
</span><span class="cx"> class SegmentedInputStorage;
</span><span class="cx"> 
</span><span class="cx"> class ReplaySessionSegment : public RefCounted&lt;ReplaySessionSegment&gt; {
</span><ins>+friend class CapturingInputCursor;
+friend class FunctorInputCursor;
+friend class ReplayingInputCursor;
</ins><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;ReplaySessionSegment&gt; create();
</span><span class="cx">     ~ReplaySessionSegment();
</span><span class="cx"> 
</span><span class="cx">     unsigned identifier() const { return m_identifier; }
</span><span class="cx">     double timestamp() const { return m_timestamp; }
</span><ins>+protected:
+    SegmentedInputStorage&amp; storage() { return *m_storage; }
+    Vector&lt;double, 0&gt;&amp; eventLoopTimings() { return m_eventLoopTimings; }
</ins><span class="cx"> 
</span><del>-    PassRefPtr&lt;CapturingInputCursor&gt; createCapturingCursor(Page&amp;);
-    PassRefPtr&lt;ReplayingInputCursor&gt; createReplayingCursor(Page&amp;, EventLoopInputDispatcherClient*);
-    PassRefPtr&lt;FunctorInputCursor&gt; createFunctorCursor();
</del><span class="cx"> private:
</span><span class="cx">     ReplaySessionSegment();
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;SegmentedInputStorage&gt; m_storage;
</span><ins>+    Vector&lt;double, 0&gt; m_eventLoopTimings;
+
</ins><span class="cx">     unsigned m_identifier;
</span><span class="cx">     bool m_canCapture;
</span><span class="cx">     double m_timestamp;
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplayingInputCursorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayingInputCursor.cpp (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayingInputCursor.cpp        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/ReplayingInputCursor.cpp        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #if ENABLE(WEB_REPLAY)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;EventLoopInputDispatcher.h&quot;
</span><ins>+#include &quot;ReplaySessionSegment.h&quot;
</ins><span class="cx"> #include &quot;SegmentedInputStorage.h&quot;
</span><span class="cx"> #include &quot;SerializationMethods.h&quot;
</span><span class="cx"> #include &quot;WebReplayInputs.h&quot;
</span><span class="lines">@@ -38,8 +39,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-ReplayingInputCursor::ReplayingInputCursor(SegmentedInputStorage&amp; storage, Page&amp; page, EventLoopInputDispatcherClient* client)
-    : m_storage(storage)
</del><ins>+ReplayingInputCursor::ReplayingInputCursor(PassRefPtr&lt;ReplaySessionSegment&gt; segment, Page&amp; page, EventLoopInputDispatcherClient* client)
+    : m_segment(segment)
</ins><span class="cx">     , m_dispatcher(std::make_unique&lt;EventLoopInputDispatcher&gt;(page, *this, client))
</span><span class="cx"> {
</span><span class="cx">     for (size_t i = 0; i &lt; static_cast&lt;size_t&gt;(InputQueue::Count); i++)
</span><span class="lines">@@ -50,9 +51,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;ReplayingInputCursor&gt; ReplayingInputCursor::create(SegmentedInputStorage&amp; storage, Page&amp; page, EventLoopInputDispatcherClient* client)
</del><ins>+PassRefPtr&lt;ReplayingInputCursor&gt; ReplayingInputCursor::create(PassRefPtr&lt;ReplaySessionSegment&gt; segment, Page&amp; page, EventLoopInputDispatcherClient* client)
</ins><span class="cx"> {
</span><del>-    return adoptRef(new ReplayingInputCursor(storage, page, client));
</del><ins>+    return adoptRef(new ReplayingInputCursor(segment, page, client));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ReplayingInputCursor::storeInput(std::unique_ptr&lt;NondeterministicInputBase&gt;)
</span><span class="lines">@@ -75,15 +76,28 @@
</span><span class="cx"> 
</span><span class="cx"> NondeterministicInputBase* ReplayingInputCursor::uncheckedLoadInput(InputQueue queue)
</span><span class="cx"> {
</span><del>-    if (m_positions[static_cast&lt;size_t&gt;(queue)] &gt;= m_storage.queueSize(queue)) {
</del><ins>+    if (m_positions[static_cast&lt;size_t&gt;(queue)] &gt;= m_segment-&gt;storage().queueSize(queue)) {
</ins><span class="cx">         String queueString = EncodingTraits&lt;InputQueue&gt;::encodeValue(queue).convertTo&lt;String&gt;();
</span><span class="cx">         LOG_ERROR(&quot;%-30s ERROR No more inputs remain for determinism queue %s, but one was requested.&quot;, &quot;[ReplayingInputCursor]&quot;, queueString.ascii().data());
</span><span class="cx">         return nullptr;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return m_storage.load(queue, m_positions[static_cast&lt;size_t&gt;(queue)]++);
</del><ins>+    return m_segment-&gt;storage().load(queue, m_positions[static_cast&lt;size_t&gt;(queue)]++);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EventLoopInputData ReplayingInputCursor::loadEventLoopInput()
+{
+    ASSERT(m_segment);
+
+    size_t offset = m_positions.at(static_cast&lt;size_t&gt;(InputQueue::EventLoopInput));
+    ASSERT(offset &lt; m_segment-&gt;eventLoopTimings().size());
+
+    EventLoopInputData data;
+    data.timestamp = m_segment-&gt;eventLoopTimings().at(offset);
+    data.input = static_cast&lt;EventLoopInputBase*&gt;(uncheckedLoadInput(InputQueue::EventLoopInput));
+    return data;
+}
+
</ins><span class="cx"> }; // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(WEB_REPLAY)
</span></span></pre></div>
<a id="trunkSourceWebCorereplayReplayingInputCursorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/replay/ReplayingInputCursor.h (172179 => 172180)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/replay/ReplayingInputCursor.h        2014-08-06 21:51:50 UTC (rev 172179)
+++ trunk/Source/WebCore/replay/ReplayingInputCursor.h        2014-08-06 21:53:17 UTC (rev 172180)
</span><span class="lines">@@ -36,15 +36,21 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class EventLoopInputBase;
</ins><span class="cx"> class EventLoopInputDispatcher;
</span><span class="cx"> class EventLoopInputDispatcherClient;
</span><span class="cx"> class Page;
</span><del>-class SegmentedInputStorage;
</del><ins>+class ReplaySessionSegment;
</ins><span class="cx"> 
</span><ins>+struct EventLoopInputData {
+    EventLoopInputBase* input;
+    double timestamp;
+};
+
</ins><span class="cx"> class ReplayingInputCursor final : public InputCursor {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(ReplayingInputCursor);
</span><span class="cx"> public:
</span><del>-    static PassRefPtr&lt;ReplayingInputCursor&gt; create(SegmentedInputStorage&amp;, Page&amp;, EventLoopInputDispatcherClient*);
</del><ins>+    static PassRefPtr&lt;ReplayingInputCursor&gt; create(PassRefPtr&lt;ReplaySessionSegment&gt;, Page&amp;, EventLoopInputDispatcherClient*);
</ins><span class="cx">     virtual ~ReplayingInputCursor();
</span><span class="cx"> 
</span><span class="cx">     virtual bool isCapturing() const override { return false; }
</span><span class="lines">@@ -52,14 +58,16 @@
</span><span class="cx"> 
</span><span class="cx">     EventLoopInputDispatcher&amp; dispatcher() const { return *m_dispatcher; }
</span><span class="cx"> 
</span><del>-    virtual void storeInput(std::unique_ptr&lt;NondeterministicInputBase&gt;) override;
-    virtual NondeterministicInputBase* uncheckedLoadInput(InputQueue) override;
</del><ins>+    EventLoopInputData loadEventLoopInput();
</ins><span class="cx"> protected:
</span><span class="cx">     virtual NondeterministicInputBase* loadInput(InputQueue, const AtomicString&amp; type) override;
</span><span class="cx"> private:
</span><del>-    ReplayingInputCursor(SegmentedInputStorage&amp;, Page&amp;, EventLoopInputDispatcherClient*);
</del><ins>+    ReplayingInputCursor(PassRefPtr&lt;ReplaySessionSegment&gt;, Page&amp;, EventLoopInputDispatcherClient*);
</ins><span class="cx"> 
</span><del>-    SegmentedInputStorage&amp; m_storage;
</del><ins>+    virtual void storeInput(std::unique_ptr&lt;NondeterministicInputBase&gt;) override;
+    virtual NondeterministicInputBase* uncheckedLoadInput(InputQueue) override;
+
+    RefPtr&lt;ReplaySessionSegment&gt; m_segment;
</ins><span class="cx">     std::unique_ptr&lt;EventLoopInputDispatcher&gt; m_dispatcher;
</span><span class="cx">     Vector&lt;size_t&gt; m_positions;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>