WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP
bug-140445-20150114105329.patch (text/plain), 42.67 KB, created by
Brian Burg
on 2015-01-14 10:53:56 PST
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Brian Burg
Created:
2015-01-14 10:53:56 PST
Size:
42.67 KB
patch
obsolete
>Subversion Revision: 178424 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 729e153fd21eb34cfa9b0f8c56b837fb0b5a0703..4895dc9b87687f6cedec51948e4ab8ba24cdb9b9 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,41 @@ >+2015-01-09 Brian J. Burg <burg@cs.washington.edu> >+ >+ Web Replay: create a ReplayClient for Page and dispatch inputs through it >+ https://bugs.webkit.org/show_bug.cgi?id=140445 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Right now all dispatchable inputs are dispatched from WebCore using Page&, but >+ we want to be able to dispatch some WK2-only inputs from WebKit2 using WebPage&. >+ As a first step, this patch creates a ReplayClient interface that delegates >+ dispatching inputs to a WebPage's WebReplayClient. >+ >+ Followup patches will introduce the notion of dispatching from different contexts. >+ >+ No new tests, no behavior changed. >+ >+ * WebCore.xcodeproj/project.pbxproj: >+ * loader/EmptyClients.cpp: >+ (WebCore::fillWithEmptyClients): >+ * loader/EmptyClients.h: >+ (WebCore::EmptyReplayClient::EmptyReplayClient): Added. >+ (WebCore::EmptyReplayClient::~EmptyReplayClient): Added. >+ * page/Page.cpp: >+ (WebCore::Page::Page): >+ * page/PageConfiguration.h: >+ * replay/EventLoopInput.h: >+ * replay/EventLoopInputDispatcher.cpp: >+ (WebCore::EventLoopInputDispatcher::dispatchInput): delegate to ReplayClient when >+ dispatching inputs during playback. >+ * replay/EventLoopInputDispatcher.h: >+ * replay/ReplayClient.h: Added. >+ (WebCore::ReplayClient::~ReplayClient): Added. >+ * replay/ReplayController.cpp: >+ (WebCore::ReplayController::ReplayController): >+ (WebCore::ReplayController::createSegment): dispatch synthetic inputs through ReplayClient. >+ * replay/ReplayController.h: >+ * replay/ReplayingInputCursor.h: Move EventLoopInputData to EventLoopInput.h >+ > 2014-07-16 Brian J. Burg <burg@cs.washington.edu> > > [WIP] Web Replay: DOM Timers should be created and fired deterministically >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index efd5cafbbb8dbb793a9d2583d131471ad4ee062b..beb26efa6c40e7982e882034ecb727328037082f 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,22 @@ >+2015-01-09 Brian J. Burg <burg@cs.washington.edu> >+ >+ Web Replay: create a ReplayClient for Page and dispatch inputs through it >+ https://bugs.webkit.org/show_bug.cgi?id=140445 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a WebReplayClient implementation and provide it to WebPage. For now, it >+ dispatches all inputs the same way as before (with WebCore context). >+ >+ * CMakeLists.txt: >+ * WebKit2.xcodeproj/project.pbxproj: >+ * WebProcess/WebCoreSupport/WebReplayClient.cpp: Added. >+ (WebKit::WebReplayClient::dispatchInput): Added. >+ * WebProcess/WebCoreSupport/WebReplayClient.h: Added. >+ (WebKit::WebReplayClient::WebReplayClient): Added. >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::WebPage::WebPage): >+ > 2014-07-15 Brian J. Burg <burg@cs.washington.edu> > > Web Replay: save and restore page history state at main frame navigations >diff --git a/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py b/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py >index 65f549aeb377f2eceaabd959377102ffb15b63a5..7d1b4082fd1c28fd2f83dbd5f7d56f2b3248daa1 100644 >--- a/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py >+++ b/Source/JavaScriptCore/replay/scripts/CodeGeneratorReplayInputs.py >@@ -698,7 +698,7 @@ class Generator: > extra_declarations.extend([ > "", > " // EventLoopInput API", >- " virtual void dispatch(ReplayController&) override final;", >+ " virtual void dispatch(Page&) override final;", > ]) > > if _input.setting('CREATE_FROM_PAGE'): >diff --git a/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h b/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h >index 37129c4b53942d65a3e75af24cfa40e501a52e75..634b19721012c4debe055a10be2e481aea6a9244 100644 >--- a/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h >+++ b/Source/JavaScriptCore/replay/scripts/tests/expected/generate-enum-with-guard.json-TestReplayInputs.h >@@ -69,7 +69,7 @@ public: > virtual ~HandleWheelEvent(); > > // EventLoopInput API >- virtual void dispatch(ReplayController&) override final; >+ virtual void dispatch(Page&) override final; > const PlatformWheelEvent& platformEvent() const { return *m_platformEvent; } > private: > std::unique_ptr<PlatformWheelEvent> m_platformEvent; >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 7e285ee1b522a44d4003754365361417e6296c90..d76a30e47f1c258c4701962eb7b427bf9fd0f470 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -3650,10 +3650,10 @@ > 99CC0B4E18BE9849006CEBCC /* CapturingInputCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99CC0B3918BE9849006CEBCC /* CapturingInputCursor.cpp */; }; > 99CC0B4F18BE9849006CEBCC /* CapturingInputCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3A18BE9849006CEBCC /* CapturingInputCursor.h */; }; > 99CC0B5018BE9849006CEBCC /* EventLoopInputDispatcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99CC0B3B18BE9849006CEBCC /* EventLoopInputDispatcher.cpp */; }; >- 99CC0B5118BE9849006CEBCC /* EventLoopInputDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3C18BE9849006CEBCC /* EventLoopInputDispatcher.h */; }; >+ 99CC0B5118BE9849006CEBCC /* EventLoopInputDispatcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3C18BE9849006CEBCC /* EventLoopInputDispatcher.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 99CC0B5218BE9849006CEBCC /* FunctorInputCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3D18BE9849006CEBCC /* FunctorInputCursor.h */; }; > 99CC0B5318BE9849006CEBCC /* ReplayController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99CC0B3E18BE9849006CEBCC /* ReplayController.cpp */; }; >- 99CC0B5418BE9849006CEBCC /* ReplayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3F18BE9849006CEBCC /* ReplayController.h */; }; >+ 99CC0B5418BE9849006CEBCC /* ReplayController.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B3F18BE9849006CEBCC /* ReplayController.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 99CC0B5518BE9849006CEBCC /* ReplayingInputCursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99CC0B4018BE9849006CEBCC /* ReplayingInputCursor.cpp */; }; > 99CC0B5618BE984A006CEBCC /* ReplayingInputCursor.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B4118BE9849006CEBCC /* ReplayingInputCursor.h */; }; > 99CC0B5718BE984A006CEBCC /* ReplayInputCreationMethods.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99CC0B4218BE9849006CEBCC /* ReplayInputCreationMethods.cpp */; }; >@@ -3670,7 +3670,7 @@ > 99CC0B6718BE9F15006CEBCC /* InspectorReplayAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B6518BE9F15006CEBCC /* InspectorReplayAgent.h */; }; > 99CC0B6A18BEA1FF006CEBCC /* WebReplayInputs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 99CC0B6818BEA1FF006CEBCC /* WebReplayInputs.cpp */; }; > 99CC0B6B18BEA1FF006CEBCC /* WebReplayInputs.h in Headers */ = {isa = PBXBuildFile; fileRef = 99CC0B6918BEA1FF006CEBCC /* WebReplayInputs.h */; }; >- 99E45A1718A063BE0026D88F /* EventLoopInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A1618A063BE0026D88F /* EventLoopInput.h */; }; >+ 99E45A1718A063BE0026D88F /* EventLoopInput.h in Headers */ = {isa = PBXBuildFile; fileRef = 99E45A1618A063BE0026D88F /* EventLoopInput.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 9A1142041832D135000BB8AD /* ValueToString.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1142031832D134000BB8AD /* ValueToString.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 9A1B6F97158869C80011A8C4 /* JSDOMStringListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1B6F96158869C80011A8C4 /* JSDOMStringListCustom.cpp */; }; > 9A528E8317D7F52F00AA9518 /* FloatingObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A528E8117D7F52F00AA9518 /* FloatingObjects.cpp */; }; >@@ -5543,6 +5543,7 @@ > C49474A119A2847C009B3DE8 /* SharedEventSenders.h in Headers */ = {isa = PBXBuildFile; fileRef = C49474A019A2847C009B3DE8 /* SharedEventSenders.h */; }; > C49474A819A2D612009B3DE8 /* EventSender.h in Headers */ = {isa = PBXBuildFile; fileRef = CE5CB1B314EDAB6F00BB2795 /* EventSender.h */; }; > C49474AA19A2E2E5009B3DE8 /* SharedEventSenders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C49474A919A2E2E5009B3DE8 /* SharedEventSenders.cpp */; }; >+ C49474AC19A3F7A2009B3DE8 /* ReplayClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C49474AB19A3F7A2009B3DE8 /* ReplayClient.h */; settings = {ATTRIBUTES = (Private, ); }; }; > C4CD629A18383766007EBAF1 /* FrameSnapshotting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4CD629818383766007EBAF1 /* FrameSnapshotting.cpp */; }; > C4CD629B18383766007EBAF1 /* FrameSnapshotting.h in Headers */ = {isa = PBXBuildFile; fileRef = C4CD629918383766007EBAF1 /* FrameSnapshotting.h */; settings = {ATTRIBUTES = (Private, ); }; }; > C4D4F52B1975C88B003EF5BC /* ReplayableTimer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C4D4F5271975C88B003EF5BC /* ReplayableTimer.cpp */; }; >@@ -12968,6 +12969,7 @@ > C400D10818F1C8F60090D863 /* EventLoopInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EventLoopInput.cpp; sourceTree = "<group>"; }; > C49474A019A2847C009B3DE8 /* SharedEventSenders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedEventSenders.h; sourceTree = "<group>"; }; > C49474A919A2E2E5009B3DE8 /* SharedEventSenders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedEventSenders.cpp; sourceTree = "<group>"; }; >+ C49474AB19A3F7A2009B3DE8 /* ReplayClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ReplayClient.h; sourceTree = "<group>"; }; > C4CD629818383766007EBAF1 /* FrameSnapshotting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FrameSnapshotting.cpp; sourceTree = "<group>"; }; > C4CD629918383766007EBAF1 /* FrameSnapshotting.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FrameSnapshotting.h; sourceTree = "<group>"; }; > C4D4F5271975C88B003EF5BC /* ReplayableTimer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ReplayableTimer.cpp; sourceTree = "<group>"; }; >@@ -18417,6 +18419,9 @@ > 99CC0B4118BE9849006CEBCC /* ReplayingInputCursor.h */, > 99CC0B4218BE9849006CEBCC /* ReplayInputCreationMethods.cpp */, > 99CC0B4318BE9849006CEBCC /* ReplayInputDispatchMethods.cpp */, >+ 990A19F418ADA48400183FD1 /* ReplayInputTypes.cpp */, >+ 990A19F518ADA48400183FD1 /* ReplayInputTypes.h */, >+ C49474AB19A3F7A2009B3DE8 /* ReplayClient.h */, > 99CC0B4418BE9849006CEBCC /* ReplaySession.cpp */, > 99CC0B4518BE9849006CEBCC /* ReplaySession.h */, > 99CC0B4618BE9849006CEBCC /* ReplaySessionSegment.cpp */, >@@ -24924,6 +24929,7 @@ > A77979290D6B9E64003851B9 /* JSImageData.h in Headers */, > 7A0E771F10C00DB100A0276E /* JSInspectorFrontendHost.h in Headers */, > A86629D309DA2B48009633A5 /* JSKeyboardEvent.h in Headers */, >+ C49474AC19A3F7A2009B3DE8 /* ReplayClient.h in Headers */, > 935F45430F7C3B5F00D7C1FB /* JSLazyEventListener.h in Headers */, > BCE1C43C0D9830D3003B02F2 /* JSLocation.h in Headers */, > CDAB6D2E17C814EE00C60B34 /* JSMediaControlsHost.h in Headers */, >diff --git a/Source/WebCore/loader/EmptyClients.cpp b/Source/WebCore/loader/EmptyClients.cpp >index 89d548683c2d298ed89e93b43d49538537adfa0d..f2af3f70477276b8be9d4855dc1004297d297dfd 100644 >--- a/Source/WebCore/loader/EmptyClients.cpp >+++ b/Source/WebCore/loader/EmptyClients.cpp >@@ -113,6 +113,11 @@ void fillWithEmptyClients(PageConfiguration& pageConfiguration) > static NeverDestroyed<EmptyInspectorClient> dummyInspectorClient; > pageConfiguration.inspectorClient = &dummyInspectorClient.get(); > >+#if ENABLE(WEB_REPLAY) >+ static NeverDestroyed<EmptyReplayClient> dummyReplayClient; >+ pageConfiguration.replayClient = &dummyReplayClient.get(); >+#endif >+ > static NeverDestroyed<EmptyFrameLoaderClient> dummyFrameLoaderClient; > pageConfiguration.loaderClientForMainFrame = &dummyFrameLoaderClient.get(); > >diff --git a/Source/WebCore/loader/EmptyClients.h b/Source/WebCore/loader/EmptyClients.h >index 57971c59c420afb0b9eab9a25a800ba8c3ae46e1..13b437ef486fc171dccf99afd6e86020366752b3 100644 >--- a/Source/WebCore/loader/EmptyClients.h >+++ b/Source/WebCore/loader/EmptyClients.h >@@ -43,6 +43,7 @@ > #include "InspectorClient.h" > #include "Page.h" > #include "ProgressTrackerClient.h" >+#include "ReplayClient.h" > #include "ResourceError.h" > #include "VisitedLinkStore.h" > #include <wtf/text/StringView.h> >@@ -604,6 +605,16 @@ public: > virtual void hideHighlight() override { } > }; > >+#if ENABLE(WEB_REPLAY) >+class EmptyReplayClient : public ReplayClient { >+public: >+ EmptyReplayClient() { } >+ virtual ~EmptyReplayClient() { } >+ >+ virtual void dispatchInput(EventLoopInputBase&) override { } >+}; >+#endif // ENABLE(WEB_REPLAY) >+ > class EmptyDeviceClient : public DeviceClient { > public: > virtual void startUpdating() override { } >diff --git a/Source/WebCore/page/Page.cpp b/Source/WebCore/page/Page.cpp >index 886d53a6ac91ba47b8166dca27d2a1af67ae0dce..3f5b6002f0d620a536088dd40f3ff488930ed850 100644 >--- a/Source/WebCore/page/Page.cpp >+++ b/Source/WebCore/page/Page.cpp >@@ -99,6 +99,7 @@ > #include <wtf/text/StringHash.h> > > #if ENABLE(WEB_REPLAY) >+#include "ReplayClient.h" > #include "ReplayController.h" > #include <replay/InputCursor.h> > #endif >@@ -139,7 +140,7 @@ Page::Page(PageConfiguration& pageConfiguration) > #endif > , m_userInputBridge(std::make_unique<UserInputBridge>(*this)) > #if ENABLE(WEB_REPLAY) >- , m_replayController(std::make_unique<ReplayController>(*this)) >+ , m_replayController(std::make_unique<ReplayController>(*this, *pageConfiguration.replayClient)) > #endif > #if ENABLE(INSPECTOR) > , m_inspectorController(std::make_unique<InspectorController>(*this, pageConfiguration.inspectorClient)) >diff --git a/Source/WebCore/page/PageConfiguration.h b/Source/WebCore/page/PageConfiguration.h >index eb543210c2bee5236392a49057a9db00a9e68287..a2041afd49a8bde03a4f674ca8edfa178c0aafa3 100644 >--- a/Source/WebCore/page/PageConfiguration.h >+++ b/Source/WebCore/page/PageConfiguration.h >@@ -45,6 +45,9 @@ class FrameLoaderClient; > class InspectorClient; > class PlugInClient; > class ProgressTrackerClient; >+#if ENABLE(WEB_REPLAY) >+class ReplayClient; >+#endif > class StorageNamespaceProvider; > class UserContentController; > class ValidationMessageClient; >@@ -64,6 +67,9 @@ public: > EditorClient* editorClient; > DragClient* dragClient; > InspectorClient* inspectorClient; >+#if ENABLE(WEB_REPLAY) >+ ReplayClient* replayClient = {nullptr}; >+#endif > PlugInClient* plugInClient; > ProgressTrackerClient* progressTrackerClient; > RefPtr<BackForwardClient> backForwardClient; >diff --git a/Source/WebCore/replay/EventLoopInput.h b/Source/WebCore/replay/EventLoopInput.h >index cb375e7df606256328d3eceeb7d1cef26f4eab5c..228055b9aeb5bec06e6f48ed312e1a9db3233f8c 100644 >--- a/Source/WebCore/replay/EventLoopInput.h >+++ b/Source/WebCore/replay/EventLoopInput.h >@@ -39,6 +39,8 @@ class InputCursor; > > namespace WebCore { > >+class EventLoopInputBase; >+class Page; > class ReplayController; > > // This is an RAII helper used during capturing which sets a flag on the input cursor >@@ -54,12 +56,17 @@ private: > JSC::InputCursor* m_cursor; > }; > >+struct EventLoopInputData { >+ EventLoopInputBase* input; >+ double timestamp; >+}; >+ > class EventLoopInputBase : public NondeterministicInputBase { > public: > virtual ~EventLoopInputBase() { } > virtual InputQueue queue() const override final { return InputQueue::EventLoopInput; } > >- virtual void dispatch(ReplayController&) = 0; >+ virtual void dispatch(Page&) = 0; > }; > > template <typename InputType> >diff --git a/Source/WebCore/replay/EventLoopInputDispatcher.cpp b/Source/WebCore/replay/EventLoopInputDispatcher.cpp >index 8f43618a1fddd12be05b27e9fb634e581613782f..74b1b2c72a06c782c1b43754a752b4624c93c21b 100644 >--- a/Source/WebCore/replay/EventLoopInputDispatcher.cpp >+++ b/Source/WebCore/replay/EventLoopInputDispatcher.cpp >@@ -31,6 +31,8 @@ > #if ENABLE(WEB_REPLAY) > > #include "Page.h" >+#include "ReplayClient.h" >+#include "ReplayController.h" > #include "ReplayingInputCursor.h" > #include "WebReplayInputs.h" > #include <wtf/TemporaryChange.h> >@@ -150,7 +152,7 @@ void EventLoopInputDispatcher::dispatchInput() > > { > TemporaryChange<bool> change(m_dispatching, true); >- m_currentWork.input->dispatch(m_page.replayController()); >+ m_page.replayController().client().dispatchInput(*m_currentWork.input); > } > > EventLoopInputBase* dispatchedInput = m_currentWork.input; >diff --git a/Source/WebCore/replay/EventLoopInputDispatcher.h b/Source/WebCore/replay/EventLoopInputDispatcher.h >index 5934c40a900f725f89a4f76a39c2f1e2583ee628..dc93c3a5f60fa9cd4ac54394c08509ba86f89247 100644 >--- a/Source/WebCore/replay/EventLoopInputDispatcher.h >+++ b/Source/WebCore/replay/EventLoopInputDispatcher.h >@@ -31,7 +31,6 @@ > #if ENABLE(WEB_REPLAY) > > #include "EventLoopInput.h" >-#include "ReplayingInputCursor.h" > #include "Timer.h" > #include <wtf/Noncopyable.h> > #include <wtf/Vector.h> >@@ -40,7 +39,8 @@ > namespace WebCore { > > class Page; >- >+class ReplayingInputCursor; >+ > enum class DispatchSpeed { > RealTime, > FastForward, >diff --git a/Source/WebCore/replay/ReplayClient.h b/Source/WebCore/replay/ReplayClient.h >new file mode 100644 >index 0000000000000000000000000000000000000000..56bb2c07edf8001aec83b9a007e74e72c045dfe0 >--- /dev/null >+++ b/Source/WebCore/replay/ReplayClient.h >@@ -0,0 +1,46 @@ >+/* >+ * Copyright (C) 2015 University of Washington. 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 ReplayClient_h >+#define ReplayClient_h >+ >+#if ENABLE(WEB_REPLAY) >+ >+namespace WebCore { >+ >+class EventLoopInputBase; >+ >+class ReplayClient { >+public: >+ virtual ~ReplayClient() { } >+ >+ virtual void dispatchInput(EventLoopInputBase&) = 0; >+}; >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEB_REPLAY) >+ >+#endif // !defined(ReplayClient_h) >diff --git a/Source/WebCore/replay/ReplayController.cpp b/Source/WebCore/replay/ReplayController.cpp >index d6e45ec0942d898897c6e6b46f1a9e49ea56775f..b11ce335c9df0c2daf550f45bc2032de1d7bc8c9 100644 >--- a/Source/WebCore/replay/ReplayController.cpp >+++ b/Source/WebCore/replay/ReplayController.cpp >@@ -41,6 +41,7 @@ > #include "Logging.h" > #include "MainFrame.h" > #include "Page.h" >+#include "ReplayClient.h" > #include "ReplaySession.h" > #include "ReplaySessionSegment.h" > #include "ReplayingInputCursor.h" >@@ -111,8 +112,9 @@ static const char* segmentStateToString(SegmentState state) > > #endif // !LOG_DISABLED > >-ReplayController::ReplayController(Page& page) >+ReplayController::ReplayController(Page& page, ReplayClient& client) > : m_page(page) >+ , m_client(client) > , m_loadedSegment(nullptr) > , m_loadedSession(ReplaySession::create()) > , m_emptyCursor(EmptyInputCursor::create()) >@@ -234,12 +236,12 @@ void ReplayController::createSegment() > // Dispatching this input saves history, clears all but the current item, appends saved > // history item to the back/forward list, then moves the current item cursor to the last entry. > std::unique_ptr<InitializeHistory> historyInput = InitializeHistory::createFromPage(m_page); >- historyInput->dispatch(*this); >- m_activeCursor->storeInput(std::move(historyInput)); >+ m_client.dispatchInput(*historyInput); >+ m_activeCursor->storeInput(WTF::move(historyInput)); > > // Dispatching this input schedules navigation of the main frame, causing a refresh. > std::unique_ptr<InitialNavigation> navigationInput = InitialNavigation::createFromPage(m_page); >- navigationInput->dispatch(*this); >+ m_client.dispatchInput(*navigationInput); > m_activeCursor->storeInput(WTF::move(navigationInput)); > } > >diff --git a/Source/WebCore/replay/ReplayController.h b/Source/WebCore/replay/ReplayController.h >index 9b67ab000014857275a2059605c41b6e5c25189a..559766006b99e3060e4ed69c7e5ef8510a2356e5 100644 >--- a/Source/WebCore/replay/ReplayController.h >+++ b/Source/WebCore/replay/ReplayController.h >@@ -53,6 +53,7 @@ class EventLoopInputBase; > class Frame; > class Node; > class Page; >+class ReplayClient; > class ReplaySession; > class ReplaySessionSegment; > >@@ -112,7 +113,7 @@ struct ReplayPosition { > class ReplayController final : public EventLoopInputDispatcherClient { > WTF_MAKE_NONCOPYABLE(ReplayController); > public: >- ReplayController(Page&); >+ ReplayController(Page&, ReplayClient&); > > void startCapturing(); > void stopCapturing(); >@@ -136,6 +137,7 @@ public: > void willDispatchEvent(const Event&, Frame*); > > Page& page() const { return m_page; } >+ ReplayClient& client() const { return m_client; } > > SessionState sessionState() const { return m_sessionState; } > SegmentState segmentState() const { return m_segmentState; } >@@ -175,6 +177,7 @@ private: > }; > > Page& m_page; >+ ReplayClient& m_client; > > RefPtr<ReplaySessionSegment> m_loadedSegment; > RefPtr<ReplaySession> m_loadedSession; >diff --git a/Source/WebCore/replay/ReplayInputDispatchMethods.cpp b/Source/WebCore/replay/ReplayInputDispatchMethods.cpp >index 4c8d8ae2f33093f1888f1178f1ed00e422a6b8a7..29508c841802d67b49f3af138457a1681144efce 100644 >--- a/Source/WebCore/replay/ReplayInputDispatchMethods.cpp >+++ b/Source/WebCore/replay/ReplayInputDispatchMethods.cpp >@@ -64,146 +64,146 @@ static ResourceLoader* resourceLoaderForOrdinal(Page& page, unsigned long ordina > } > > // Sentinel inputs. >-void BeginSegmentSentinel::dispatch(ReplayController&) >+void BeginSegmentSentinel::dispatch(Page&) > { > } > >-void EndSegmentSentinel::dispatch(ReplayController&) >+void EndSegmentSentinel::dispatch(Page&) > { > } > > // Navigation inputs. >-void InitialNavigation::dispatch(ReplayController& controller) >+void InitialNavigation::dispatch(Page& page) > { >- controller.page().mainFrame().navigationScheduler().scheduleLocationChange(m_securityOrigin.get(), m_url, m_referrer); >+ page.mainFrame().navigationScheduler().scheduleLocationChange(m_securityOrigin.get(), m_url, m_referrer); > } > >-void LoadURLRequest::dispatch(ReplayController& controller) >+void LoadURLRequest::dispatch(Page& page) > { >- controller.page().userInputBridge().loadRequest(*m_loadRequest); >+ page.userInputBridge().loadRequest(*m_loadRequest); > } > >-void ReloadFrame::dispatch(ReplayController& controller) >+void ReloadFrame::dispatch(Page& page) > { >- Frame* frame = frameFromFrameIndex(&controller.page(), m_frameIndex); >+ Frame* frame = frameFromFrameIndex(&page, m_frameIndex); > ASSERT(frame); > >- controller.page().userInputBridge().reloadFrame(frame, m_endToEndReload, InputSource::Synthetic); >+ page.userInputBridge().reloadFrame(frame, m_endToEndReload, InputSource::Synthetic); > } > >-void StopLoadingFrame::dispatch(ReplayController& controller) >+void StopLoadingFrame::dispatch(Page& page) > { >- Frame* frame = frameFromFrameIndex(&controller.page(), m_frameIndex); >+ Frame* frame = frameFromFrameIndex(&page, m_frameIndex); > ASSERT(frame); > >- controller.page().userInputBridge().stopLoadingFrame(frame, InputSource::Synthetic); >+ page.userInputBridge().stopLoadingFrame(frame, InputSource::Synthetic); > } > >-void TryClosePage::dispatch(ReplayController& controller) >+void TryClosePage::dispatch(Page& page) > { >- controller.page().userInputBridge().tryClosePage(InputSource::Synthetic); >+ page.userInputBridge().tryClosePage(InputSource::Synthetic); > } > >-void InitializeHistory::dispatch(ReplayController& controller) >+void InitializeHistory::dispatch(Page& page) > { > return; // HACK > > // FIXME: Load the empty document, so that when we prune the back-forward list it > // is the single remaining entry. <https://webkit.org/b/131989> >- controller.page().backForward().clear(); >+ page.backForward().clear(); > > for (RefPtr<HistoryItem> historyEntry : m_entries) >- controller.page().backForward().addItem(historyEntry->copy()); >+ page.backForward().addItem(historyEntry->copy()); > >- controller.page().mainFrame().loader().history().setCurrentItem(controller.page().backForward().currentItem()); >+ page.mainFrame().loader().history().setCurrentItem(page.backForward().currentItem()); > } > >-void HandleKeyPress::dispatch(ReplayController& controller) >+void HandleKeyPress::dispatch(Page& page) > { >- controller.page().userInputBridge().handleKeyEvent(platformEvent(), InputSource::Synthetic); >+ page.userInputBridge().handleKeyEvent(platformEvent(), InputSource::Synthetic); > } > > // User interaction inputs. >-void HandleMouseMove::dispatch(ReplayController& controller) >+void HandleMouseMove::dispatch(Page& page) > { > if (m_scrollbarTargeted) >- controller.page().userInputBridge().handleMouseMoveOnScrollbarEvent(platformEvent(), InputSource::Synthetic); >+ page.userInputBridge().handleMouseMoveOnScrollbarEvent(platformEvent(), InputSource::Synthetic); > else >- controller.page().userInputBridge().handleMouseMoveEvent(platformEvent(), InputSource::Synthetic); >+ page.userInputBridge().handleMouseMoveEvent(platformEvent(), InputSource::Synthetic); > } > >-void HandleMousePress::dispatch(ReplayController& controller) >+void HandleMousePress::dispatch(Page& page) > { >- controller.page().userInputBridge().handleMousePressEvent(platformEvent(), InputSource::Synthetic); >+ page.userInputBridge().handleMousePressEvent(platformEvent(), InputSource::Synthetic); > } > >-void HandleMouseRelease::dispatch(ReplayController& controller) >+void HandleMouseRelease::dispatch(Page& page) > { >- controller.page().userInputBridge().handleMouseReleaseEvent(platformEvent(), InputSource::Synthetic); >+ page.userInputBridge().handleMouseReleaseEvent(platformEvent(), InputSource::Synthetic); > } > >-void HandleWheelEvent::dispatch(ReplayController& controller) >+void HandleWheelEvent::dispatch(Page& page) > { >- controller.page().userInputBridge().handleWheelEvent(platformEvent(), InputSource::Synthetic); >+ page.userInputBridge().handleWheelEvent(platformEvent(), InputSource::Synthetic); > } > >-void LogicalScrollPage::dispatch(ReplayController& controller) >+void LogicalScrollPage::dispatch(Page& page) > { >- controller.page().userInputBridge().logicalScrollRecursively(direction(), granularity(), InputSource::Synthetic); >+ page.userInputBridge().logicalScrollRecursively(direction(), granularity(), InputSource::Synthetic); > } > >-void ScrollPage::dispatch(ReplayController& controller) >+void ScrollPage::dispatch(Page& page) > { >- controller.page().userInputBridge().scrollRecursively(direction(), granularity(), InputSource::Synthetic); >+ page.userInputBridge().scrollRecursively(direction(), granularity(), InputSource::Synthetic); > } > > // Network inputs. >-void ResourceLoaderDidFail::dispatch(ReplayController& controller) >+void ResourceLoaderDidFail::dispatch(Page& page) > { >- if (ResourceLoader* loader = resourceLoaderForOrdinal(controller.page(), ordinal(), frameIndex())) >+ if (ResourceLoader* loader = resourceLoaderForOrdinal(page, ordinal(), frameIndex())) > loader->didFail(m_error->copy()); > // FIXME: signal error if the callback couldn't be fired. > } > >-void ResourceLoaderDidFinishLoading::dispatch(ReplayController& controller) >+void ResourceLoaderDidFinishLoading::dispatch(Page& page) > { >- if (ResourceLoader* loader = resourceLoaderForOrdinal(controller.page(), ordinal(), frameIndex())) >+ if (ResourceLoader* loader = resourceLoaderForOrdinal(page, ordinal(), frameIndex())) > loader->didFinishLoading(m_finishTime); > // FIXME: signal error if the callback couldn't be fired. > } > >-void ResourceLoaderDidReceiveData::dispatch(ReplayController& controller) >+void ResourceLoaderDidReceiveData::dispatch(Page& page) > { >- if (ResourceLoader* loader = resourceLoaderForOrdinal(controller.page(), ordinal(), frameIndex())) >+ if (ResourceLoader* loader = resourceLoaderForOrdinal(page, ordinal(), frameIndex())) > loader->didReceiveData(buffer()->data(), buffer()->size(), encodedLength(), DataPayloadBytes); > // FIXME: signal error if the callback couldn't be fired. > } > >-void ResourceLoaderDidReceiveResponse::dispatch(ReplayController& controller) >+void ResourceLoaderDidReceiveResponse::dispatch(Page& page) > { >- if (ResourceLoader* loader = resourceLoaderForOrdinal(controller.page(), ordinal(), frameIndex())) >+ if (ResourceLoader* loader = resourceLoaderForOrdinal(page, ordinal(), frameIndex())) > loader->didReceiveResponse(*m_response); > // FIXME: signal error if the callback couldn't be fired. > } > >-void ResourceLoaderDidSendData::dispatch(ReplayController& controller) >+void ResourceLoaderDidSendData::dispatch(Page& page) > { >- if (ResourceLoader* loader = resourceLoaderForOrdinal(controller.page(), ordinal(), frameIndex())) >+ if (ResourceLoader* loader = resourceLoaderForOrdinal(page, ordinal(), frameIndex())) > loader->didSendData(m_bytesSent, m_totalBytesToBeSent); > // FIXME: signal error if the callback couldn't be fired. > } > > // Other event loop inputs. >-void AsyncTimerFired::dispatch(ReplayController& controller) >+void AsyncTimerFired::dispatch(Page& page) > { >- Document* document = documentFromFrameIndex(&controller.page(), m_frameIndex); >+ Document* document = documentFromFrameIndex(&page, m_frameIndex); > if (!document || !document->replayableTimers().fireTimer(m_ordinal)) > LOG_ERROR("%-30s REPLAY DIVERGENCE! Couldn't find async timer %d/%" PRIu64 ".\n", "[ReplayController]", m_frameIndex, m_ordinal); > } > >-void DOMTimerFired::dispatch(ReplayController& controller) >+void DOMTimerFired::dispatch(Page& page) > { >- Document* document = documentFromFrameIndex(&controller.page(), m_frameIndex); >+ Document* document = documentFromFrameIndex(&page, m_frameIndex); > DOMTimer* timer = document->findTimeout(m_timerIdentifier); > if (timer) > timer->fired(); >diff --git a/Source/WebCore/replay/ReplayingInputCursor.h b/Source/WebCore/replay/ReplayingInputCursor.h >index 9c71f41527dc72e17962c672ec0595819eaefece..f3790668f7ce98e8d589951f0d1c0aaa8271bbec 100644 >--- a/Source/WebCore/replay/ReplayingInputCursor.h >+++ b/Source/WebCore/replay/ReplayingInputCursor.h >@@ -30,6 +30,7 @@ > > #if ENABLE(WEB_REPLAY) > >+#include "EventLoopInput.h" > #include <replay/InputCursor.h> > #include <wtf/Vector.h> > #include <wtf/text/AtomicString.h> >@@ -42,11 +43,6 @@ class EventLoopInputDispatcherClient; > class Page; > class ReplaySessionSegment; > >-struct EventLoopInputData { >- EventLoopInputBase* input; >- double timestamp; >-}; >- > class ReplayingInputCursor final : public InputCursor { > WTF_MAKE_NONCOPYABLE(ReplayingInputCursor); > public: >diff --git a/Source/WebKit2/CMakeLists.txt b/Source/WebKit2/CMakeLists.txt >index 8a9ca3b5c74edada88ace30164c33af7af0908f7..1553be96c520391027b2eb4d16982410778c9590 100644 >--- a/Source/WebKit2/CMakeLists.txt >+++ b/Source/WebKit2/CMakeLists.txt >@@ -767,6 +767,16 @@ if (ENABLE_PLUGIN_PROCESS) > endif () > endif () > >+if (ENABLE_WEB_REPLAY) >+ list(APPEND WebKit2_INCLUDE_DIRECTORIES >+ "${WEBKIT2_DIR}/WebProcess/Replay" >+ ) >+ >+ list(APPEND WebKit2_SOURCES >+ WebProcess/Replay/WebReplayClient.cpp >+ ) >+endif () >+ > POPULATE_LIBRARY_VERSION(WEBKIT2) > set_target_properties(WebKit2 PROPERTIES VERSION ${WEBKIT2_VERSION} SOVERSION ${WEBKIT2_VERSION_MAJOR}) > >diff --git a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj >index 59b2f87e61f0117d36c68a3153d007414f66bb99..a3f66d89c6f7a75c77ea6b98c6b92e666c247be5 100644 >--- a/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj >+++ b/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj >@@ -1571,6 +1571,8 @@ > C0E3AA7A1209E83000A49D01 /* ModuleCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA481209E45000A49D01 /* ModuleCF.cpp */; }; > C0E3AA7B1209E83500A49D01 /* Module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0E3AA451209E2BA00A49D01 /* Module.cpp */; }; > C0E3AA7C1209E83C00A49D01 /* Module.h in Headers */ = {isa = PBXBuildFile; fileRef = C0E3AA441209E2BA00A49D01 /* Module.h */; }; >+ C49474B019A3F93F009B3DE8 /* WebReplayClient.h in Headers */ = {isa = PBXBuildFile; fileRef = C49474AE19A3F924009B3DE8 /* WebReplayClient.h */; }; >+ C49474B119A3F947009B3DE8 /* WebReplayClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C49474AD19A3F924009B3DE8 /* WebReplayClient.cpp */; }; > C517388112DF8F4F00EE3F47 /* DragControllerAction.h in Headers */ = {isa = PBXBuildFile; fileRef = C517388012DF8F4F00EE3F47 /* DragControllerAction.h */; }; > C5237F6012441CA300780472 /* WebEditorClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5237F5F12441CA300780472 /* WebEditorClientMac.mm */; }; > C54256B518BEC18C00DE4179 /* WKFormInputControl.h in Headers */ = {isa = PBXBuildFile; fileRef = C54256AF18BEC18B00DE4179 /* WKFormInputControl.h */; }; >@@ -3719,6 +3721,8 @@ > C0E3AA441209E2BA00A49D01 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Module.h; sourceTree = "<group>"; }; > C0E3AA451209E2BA00A49D01 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Module.cpp; sourceTree = "<group>"; }; > C0E3AA481209E45000A49D01 /* ModuleCF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ModuleCF.cpp; sourceTree = "<group>"; }; >+ C49474AD19A3F924009B3DE8 /* WebReplayClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebReplayClient.cpp; sourceTree = "<group>"; }; >+ C49474AE19A3F924009B3DE8 /* WebReplayClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebReplayClient.h; sourceTree = "<group>"; }; > C517388012DF8F4F00EE3F47 /* DragControllerAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragControllerAction.h; sourceTree = "<group>"; }; > C5237F5F12441CA300780472 /* WebEditorClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClientMac.mm; sourceTree = "<group>"; }; > C54256AF18BEC18B00DE4179 /* WKFormInputControl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKFormInputControl.h; path = ios/forms/WKFormInputControl.h; sourceTree = "<group>"; }; >@@ -5812,6 +5816,8 @@ > D3B9484311FF4B6500032B39 /* WebPopupMenu.h */, > 1A1E093118861D3800D2DC49 /* WebProgressTrackerClient.cpp */, > 1A1E093218861D3800D2DC49 /* WebProgressTrackerClient.h */, >+ C49474AD19A3F924009B3DE8 /* WebReplayClient.cpp */, >+ C49474AE19A3F924009B3DE8 /* WebReplayClient.h */, > D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */, > D3B9484511FF4B6500032B39 /* WebSearchPopupMenu.h */, > CEDBA84519FDA00A006866A5 /* WebSQLiteDatabaseTracker.cpp */, >@@ -7773,6 +7779,7 @@ > A1C512C9190656E500448914 /* WebQuickLookHandleClient.h in Headers */, > 37948404150C350600E52CE9 /* WebRenderLayer.h in Headers */, > 3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */, >+ C49474B019A3F93F009B3DE8 /* WebReplayClient.h in Headers */, > 33367630130C9998006C9DE2 /* WebResourceCacheManager.h in Headers */, > 33367656130C9ECA006C9DE2 /* WebResourceCacheManagerMessages.h in Headers */, > 33367636130C99B2006C9DE2 /* WebResourceCacheManagerProxy.h in Headers */, >@@ -9516,6 +9523,7 @@ > A1C512C8190656E500448914 /* WebQuickLookHandleClient.cpp in Sources */, > 37948403150C350600E52CE9 /* WebRenderLayer.cpp in Sources */, > 3760881E150413E900FC82C7 /* WebRenderObject.cpp in Sources */, >+ C49474B119A3F947009B3DE8 /* WebReplayClient.cpp in Sources */, > 3336762F130C9998006C9DE2 /* WebResourceCacheManager.cpp in Sources */, > 33F9D5B91312F1EE000D683F /* WebResourceCacheManagerCFNet.cpp in Sources */, > 33367655130C9ECA006C9DE2 /* WebResourceCacheManagerMessageReceiver.cpp in Sources */, >diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebReplayClient.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebReplayClient.cpp >new file mode 100644 >index 0000000000000000000000000000000000000000..87c6a2beb95b69c1b263993f60cb3a9922e87f07 >--- /dev/null >+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebReplayClient.cpp >@@ -0,0 +1,44 @@ >+/* >+ * Copyright (C) 2014 University of Washington. 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. ``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 >+ * 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 "config.h" >+#include "WebReplayClient.h" >+ >+#if ENABLE(WEB_REPLAY) >+ >+#include "WebPage.h" >+#include <WebCore/EventLoopInput.h> >+#include <WebCore/ReplayController.h> >+ >+namespace WebKit { >+ >+void WebReplayClient::dispatchInput(WebCore::EventLoopInputBase& input) >+{ >+ input.dispatch(*m_page->corePage()); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(WEB_REPLAY) >diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebReplayClient.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebReplayClient.h >new file mode 100644 >index 0000000000000000000000000000000000000000..cee44c3d3928d378be6883c2be150a0f86c61904 >--- /dev/null >+++ b/Source/WebKit2/WebProcess/WebCoreSupport/WebReplayClient.h >@@ -0,0 +1,54 @@ >+/* >+ * Copyright (C) 2014 University of Washington. 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. ``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 >+ * 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 WebReplayClient_h >+#define WebReplayClient_h >+ >+#if ENABLE(WEB_REPLAY) >+ >+#include <WebCore/ReplayClient.h> >+ >+namespace WebKit { >+ >+class WebPage; >+ >+class WebReplayClient : public WebCore::ReplayClient { >+public: >+ WebReplayClient(WebPage* page) >+ : m_page(page) >+ { >+ } >+ >+private: >+ virtual void dispatchInput(WebCore::EventLoopInputBase&) override; >+ >+ WebPage* m_page; >+}; >+ >+} // namespace WebKit >+ >+#endif // ENABLE(WEB_REPLAY) >+ >+#endif // WebReplayClient_h >diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp >index 9e36f78615dc1c35c2f5760d116366278d25fa77..62917dfa1eb7bb51a95462ffa924ec415ff3d1b7 100644 >--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp >@@ -184,6 +184,10 @@ > #include "WebDeviceProximityClient.h" > #endif > >+#if ENABLE(WEB_REPLAY) >+#include "WebReplayClient.h" >+#endif >+ > #if PLATFORM(COCOA) > #include "PDFPlugin.h" > #include "RemoteLayerTreeTransaction.h" >@@ -364,6 +368,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters) > m_inspectorClient = new WebInspectorClient(this); > pageConfiguration.inspectorClient = m_inspectorClient; > #endif >+#if ENABLE(WEB_REPLAY) >+ pageConfiguration.replayClient = new WebReplayClient(this); >+#endif > #if USE(AUTOCORRECTION_PANEL) > pageConfiguration.alternativeTextClient = new WebAlternativeTextClient(this); > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 140445
:
244614
|
244749