Skip to content

Nondeterminism in NavigationScheduler should be mediated #387

@burg

Description

@burg

Sometimes, navigation of a frame is asynchronously scheduled through NavigationScheduler::schedule(). This can be of variable-length delay, and has lots of other logic. So, instead of going through EventSender, this class should directly store and load nondeterministic timings.

The implementation should look similar to ScriptRunner.


Example stack trace:

ASSERTION FAILED: withinInputExtent()
/Users/burg/repos/timelapse/Source/WebCore/replay/CaptureInputIterator.cpp(98) : virtual void WebCore::CaptureInputIterator::incrementExecutionTicks()
1   0x111806270 WTFCrash
2   0x114248815 WebCore::CaptureInputIterator::incrementExecutionTicks()
3   0x1142403b2 WebCore::ReplayController::willDispatchEvent(WebCore::Event const&, WebCore::Frame*, WebCore::PositionMark const&)
4   0x1142465c4 WebCore::InspectorReplayAgent::willDispatchEvent(WebCore::Event const&, WebCore::Frame*)
5   0x113248f78 WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl(WebCore::InstrumentingAgents*, WebCore::Event const&, WebCore::DOMWindow*)
6   0x112ce619a WebCore::InspectorInstrumentation::willDispatchEventOnWindow(WebCore::Frame*, WebCore::Event const&, WebCore::DOMWindow*)
7   0x112cdad13 WebCore::DOMWindow::dispatchEvent(WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::EventTarget>)
8   0x114238b72 WebCore::AsyncEventProxy::dispatchEvent(WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::EventTarget>)
9   0x114238738 WebCore::AsyncEventProxy::dispatchAsyncEvent(WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::EventTarget>, bool)
10  0x112ce1d00 WebCore::DOMWindow::dispatchAsyncEvent(WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::EventTarget>)
11  0x112e6bdb3 WebCore::FrameLoader::handleBeforeUnloadEvent(WebCore::Chrome&, WebCore::FrameLoader*)
12  0x112e6bb93 WebCore::FrameLoader::shouldClose()
13  0x112e66d5d WebCore::FrameLoader::continueLoadAfterNavigationPolicy(WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool)
14  0x112e67117 WebCore::FrameLoader::callContinueLoadAfterNavigationPolicy(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool)
15  0x1139f236c WebCore::PolicyCallback::call(bool)
16  0x1139f339a WebCore::PolicyChecker::continueAfterNavigationPolicy(WebCore::PolicyAction)
17  0x1139f8e9e WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*)::$_0::operator()(WebCore::PolicyAction) const
18  0x1139f8e6e std::__1::__function::__func<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*)::$_0, std::__1::allocator<WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*)::$_0>, void (WebCore::PolicyAction)>::operator()(WebCore::PolicyAction&&)
19  0x10fc5509c std::__1::function<void (WebCore::PolicyAction)>::operator()(WebCore::PolicyAction) const
20  0x10fc5b6ec WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction(WebCore::NavigationAction const&, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, std::__1::function<void (WebCore::PolicyAction)>)
21  0x1139f2e09 WebCore::PolicyChecker::checkNavigationPolicy(WebCore::ResourceRequest const&, WebCore::DocumentLoader*, WTF::PassRefPtr<WebCore::FormState>, void (*)(void*, WebCore::ResourceRequest const&, WTF::PassRefPtr<WebCore::FormState>, bool), void*)
22  0x112e66a3c WebCore::FrameLoader::loadWithDocumentLoader(WebCore::DocumentLoader*, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::FormState>)
23  0x112e65ce0 WebCore::FrameLoader::loadWithNavigationAction(WebCore::ResourceRequest const&, WebCore::NavigationAction const&, bool, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::FormState>)
24  0x112e63e79 WebCore::FrameLoader::loadURL(WebCore::URL const&, WTF::String const&, WTF::String const&, bool, WebCore::FrameLoadType, WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::FormState>)
25  0x112e5fa2b WebCore::FrameLoader::loadFrameRequest(WebCore::FrameLoadRequest const&, bool, bool, WTF::PassRefPtr<WebCore::Event>, WTF::PassRefPtr<WebCore::FormState>, WebCore::ShouldSendReferrer)
26  0x112e5f306 WebCore::FrameLoader::urlSelected(WebCore::FrameLoadRequest const&, WTF::PassRefPtr<WebCore::Event>, bool, bool, WebCore::ShouldSendReferrer, WebCore::ShouldReplaceDocumentIfJavaScriptURL)
27  0x112e5f098 WebCore::FrameLoader::changeLocation(WebCore::SecurityOrigin*, WebCore::URL const&, WTF::String const&, bool, bool, bool)
28  0x11392d302 WebCore::ScheduledURLNavigation::fire(WebCore::Frame*)
29  0x11392a816 WebCore::NavigationScheduler::timerFired(WebCore::Timer<WebCore::NavigationScheduler>*)
30  0x11392c7a3 WebCore::Timer<WebCore::NavigationScheduler>::fired()
31  0x114098963 WebCore::ThreadTimers::sharedTimerFiredInternal()

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions