RESOLVED FIXED 183665
First piece of process swapping on navigation
https://bugs.webkit.org/show_bug.cgi?id=183665
Summary First piece of process swapping on navigation
Brady Eidson
Reported 2018-03-15 10:54:38 PDT
First piece of process swapping on navigation
Attachments
Patch (50.79 KB, patch)
2018-03-15 15:52 PDT, Brady Eidson
no flags
Patch (50.82 KB, patch)
2018-03-15 16:21 PDT, Brady Eidson
aestes: review+
Patch (56.19 KB, patch)
2018-03-20 16:20 PDT, Brady Eidson
no flags
Brady Eidson
Comment 1 2018-03-15 10:54:55 PDT
Brady Eidson
Comment 2 2018-03-15 15:52:57 PDT
Brady Eidson
Comment 3 2018-03-15 16:21:30 PDT
Andy Estes
Comment 4 2018-03-15 17:22:02 PDT
Comment on attachment 335906 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=335906&action=review > Source/WebCore/loader/FrameLoader.cpp:1407 > + SetForScope<bool> currentLoadShouldCheckNavigationPolicyGuard(m_currentLoadShouldCheckNavigationPolicy, request.shouldCheckNavigationPolicy()); Can shouldCheckNavigationPolicy be a property of DocumentLoader to avoid needing a SetForScope thing here? > Source/WebKit/UIProcess/API/APINavigation.h:40 > + Navigation(const Navigation&) = delete; WTF_MAKE_NONCOPYABLE? > Source/WebKit/UIProcess/WebPageProxy.cpp:2392 > + if (m_currentNavigationPolicyListenerID && *m_currentNavigationPolicyListenerID == listenerID) { > + m_currentNavigationPolicyListenerID = std::nullopt; > + > + if (action == PolicyAction::Use && navigation) { > + auto proposedProcess = process().processPool().processForNavigation(*this, navigation->request().url()); > + if (proposedProcess.ptr() != &process()) { > + action = PolicyAction::Suspend; > + RunLoop::main().dispatch([this, protectedThis = makeRef(*this), navigation = makeRef(*navigation), proposedProcess = WTFMove(proposedProcess)]() mutable { > + continueNavigationInNewProcess(navigation.get(), WTFMove(proposedProcess)); > + }); > + } > + } > + } I was confused why we only now needed m_currentNavigationPolicyListenerID, and you explained to me that it was to distinguish decidePolicyForNavigationAction from the other policy decisions (response, new window). A more direct way to do this might be to add a type enum to WebFramePolicyListenerProxy and check that instead. Looks like you can get to the active listener from WebFrameProxy::m_activeListener (and you could always assert or check that it's listener ID equals listenerID).
Brady Eidson
Comment 5 2018-03-20 14:02:48 PDT
(In reply to Andy Estes from comment #4) > Comment on attachment 335906 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=335906&action=review > > > Source/WebCore/loader/FrameLoader.cpp:1407 > > + SetForScope<bool> currentLoadShouldCheckNavigationPolicyGuard(m_currentLoadShouldCheckNavigationPolicy, request.shouldCheckNavigationPolicy()); > > Can shouldCheckNavigationPolicy be a property of DocumentLoader to avoid > needing a SetForScope thing here? Unique DocumentLoaders can go through multiple rounds of policy checks, as well, so something similar would still be needed. > > > Source/WebKit/UIProcess/API/APINavigation.h:40 > > + Navigation(const Navigation&) = delete; > > WTF_MAKE_NONCOPYABLE? Sure > > > Source/WebKit/UIProcess/WebPageProxy.cpp:2392 > > + if (m_currentNavigationPolicyListenerID && *m_currentNavigationPolicyListenerID == listenerID) { > > + m_currentNavigationPolicyListenerID = std::nullopt; > > + > > + if (action == PolicyAction::Use && navigation) { > > + auto proposedProcess = process().processPool().processForNavigation(*this, navigation->request().url()); > > + if (proposedProcess.ptr() != &process()) { > > + action = PolicyAction::Suspend; > > + RunLoop::main().dispatch([this, protectedThis = makeRef(*this), navigation = makeRef(*navigation), proposedProcess = WTFMove(proposedProcess)]() mutable { > > + continueNavigationInNewProcess(navigation.get(), WTFMove(proposedProcess)); > > + }); > > + } > > + } > > + } > > I was confused why we only now needed m_currentNavigationPolicyListenerID, > and you explained to me that it was to distinguish > decidePolicyForNavigationAction from the other policy decisions (response, > new window). A more direct way to do this might be to add a type enum to > WebFramePolicyListenerProxy and check that instead. Looks like you can get > to the active listener from WebFrameProxy::m_activeListener (and you could > always assert or check that it's listener ID equals listenerID). Will try this.
Brady Eidson
Comment 6 2018-03-20 16:20:45 PDT
Brady Eidson
Comment 7 2018-03-20 16:21:03 PDT
(In reply to Brady Eidson from comment #6) > Created attachment 336164 [details] > Patch Will cq+ after EWS
WebKit Commit Bot
Comment 8 2018-03-20 17:06:03 PDT
Comment on attachment 336164 [details] Patch Clearing flags on attachment: 336164 Committed r229778: <https://trac.webkit.org/changeset/229778>
Michael Catanzaro
Comment 9 2018-03-22 18:21:35 PDT
Fixed?
Note You need to log in before you can comment on or make changes to this bug.