Repository navigation
Implement cross-origin redirects when loading site-isolated iframes - #16383
Conversation
|
EWS run on previous version of this PR (hash d00077d) Details
|
d00077d to
ef9ec97
Compare
|
EWS run on previous version of this PR (hash ef9ec97) Details
|
…ssage https://bugs.webkit.org/show_bug.cgi?id=259864 Reviewed by Wenson Hsieh. We are sending the response, and separately we are sending a bool indicating if the response is null. This is unnecessary redundant information. Also, I'm going to need the whole response on NavigationActionData for WebKit#16383 and this is a little piece of that change that is easy to separate into a non-behavior-changing PR. * Source/WebKit/Shared/NavigationActionData.h: * Source/WebKit/Shared/NavigationActionData.serialization.in: * Source/WebKit/UIProcess/API/APINavigation.h: (API::Navigation::currentRequestIsRedirect const): * Source/WebKit/UIProcess/API/APINavigationAction.h: * Source/WebKit/UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync): (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync): * Source/WebKit/UIProcess/ProvisionalPageProxy.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): (WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared): * Source/WebKit/UIProcess/WebPageProxy.h: * Source/WebKit/UIProcess/WebPageProxy.messages.in: * Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp: (WebKit::WebChromeClient::createWindow): * Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp: (WebKit::WebLocalFrameLoaderClient::didSameDocumentNavigationForFrameViaJSHistoryAPI): (WebKit::WebLocalFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Canonical link: https://commits.webkit.org/266620@main
ef9ec97 to
e890393
Compare
|
EWS run on previous version of this PR (hash e890393) Details
|
There was a problem hiding this comment.
Based on the implementation, it sounds like you mean cross-site, not cross-origin.
There was a problem hiding this comment.
Why are we disabling this optimization? This seems bad. I don't think this optimization is incompatible with site isolation.
There was a problem hiding this comment.
When redirecting multiple times, I was making a new RemotePageProxy before clearing the old one, which caused two RemotePageProxies to be using the same process with the same page ID at the same time. I'm fixing that by cleaning the old RemotePageProxy before making a new one instead of this.
e890393 to
2ae6f5c
Compare
|
EWS run on current version of this PR (hash 2ae6f5c) Details
|
https://bugs.webkit.org/show_bug.cgi?id=259817 rdar://113377510 Reviewed by Chris Dumez. In order to get this to work, I needed to do several things: 1. Implement some message handlers in RemotePageProxy to call WebPageProxy methods with the correct process. 2. Make 2 modifications to WebFrameProxy::prepareForProvisionalNavigationInProcess: 2.a. If we are redirected back to the WebFrameProxy's process, stop using a ProvisionalFrameProxy or RemotePageProxy. We are just doing a same-process navigation when this happens. 2.b. If we have a provisional frame but we are doing a cross-origin redirect, make a new provisional frame in the new process. 3. After preparing for a provisional navigation, skip the didCommitLoadForFrame call from the new process because we've already received it from the first page. This is what YesAfterProvisionalLoadStarted does. 4. If we are redirecting, frameProcessBeforeNavigation needs to be the provisional frame's process for continueWithProcessForNavigation. 5. If site isolation is enabled, we can't reuse a process that hasn't seen a provisional navigation committed because we need a provisional load starting to a new domain to come from a new domain's process. This may be optimized away when we implement redirect chain following without starting processes for each domain along the chain, but the change in WebProcessPool::processForNavigationInternal is needed until then. Covered by testing a variety of same-domain and cross-domain redirects in addition to existing tests. * Source/WebCore/loader/FrameLoader.cpp: (WebCore::FrameLoader::load): * Source/WebKit/UIProcess/API/APINavigation.cpp: (API::Navigation::currentRequestIsCrossOriginRedirect const): * Source/WebKit/UIProcess/API/APINavigation.h: * Source/WebKit/UIProcess/RemotePageProxy.cpp: (WebKit::RemotePageProxy::didReceiveMessage): (WebKit::RemotePageProxy::decidePolicyForNavigationActionAsync): (WebKit::RemotePageProxy::decidePolicyForNavigationActionSync): (WebKit::RemotePageProxy::didChangeProvisionalURLForFrame): (WebKit::RemotePageProxy::didReceiveSyncMessage): * Source/WebKit/UIProcess/RemotePageProxy.h: * Source/WebKit/UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::prepareForProvisionalNavigationInProcess): * Source/WebKit/UIProcess/WebFrameProxy.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::continueNavigationInNewProcess): (WebKit::WebPageProxy::decidePolicyForNavigationAction): * Source/WebKit/UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::processForNavigationInternal): * Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm: (TestWebKitAPI::TEST): Canonical link: https://commits.webkit.org/266768@main
2ae6f5c to
a9f7a67
Compare
|
Committed 266768@main (a9f7a67): https://commits.webkit.org/266768@main Reviewed commits have been landed. Closing PR #16383 and removing active labels. |
a9f7a67
2ae6f5c
🧪 wpe-wk2🧪 gtk-wk2🧪 mac-AS-debug-wk2