Skip to content

Commit

Permalink
Implement provisional load failure handling with site isolation
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=260643
rdar://114360180

Reviewed by Chris Dumez.

When a provisional load fails, we need to send WebPage::DidFinishLoadInAnotherProcess
to the parent's process to tell the parent that one of its children is no longer loading,
so it shouldn't delay its load event any more.  I took RemoteFrame::didFinishLoadInAnotherProcess
and made it a pure virtual function on Frame.  If the Frame is a RemoteFrame, then behavior is
unchanged.  If the Frame is a LocalFrame and it receives a didFinishLoadInAnotherProcess call,
that means the load failed before it was committed.  I update the state indicating that the
parent's load event should be delayed, then tell the parent to check if its load is complete.

To have the frame tree clean up correctly, I needed to move ownership of the RemotePageProxy
from the WebFrameProxy to the ProvisionalFrameProxy until the frame navigation is committed,
at which point ownership is transferred to the WebFrameProxy and the ProvisionalFrameProxy
is destroyed.  This moves the RemotePageProxy::create call downstream a bit to
WebFrameProxy::prepareForProvisionalNavigationInProcess which makes more sense anyways.

The WebPageProxy::didFailProvisionalLoadForFrame was redundantly sending the FrameIdentifier
as its own parameter and as part of the FrameInfoData.  I removed the first one in favor of the second.

The DidCreateNewProcess enum was unused.  I removed it.

Reusing a process when hasCommittedAnyProvisionalLoads returns false proved problematic.
It is likely possible, but it's an optimization at this point.  I disabled it to make the
process to domain mapping constant with site isolation.

* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::provisionalLoadFailedInAnotherProcess):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* Source/WebCore/loader/FrameLoader.h:
* Source/WebCore/page/Frame.h:
* Source/WebCore/page/LocalFrame.cpp:
(WebCore::LocalFrame::didFinishLoadInAnotherProcess):
* Source/WebCore/page/LocalFrame.h:
* Source/WebCore/page/RemoteFrame.cpp:
(WebCore::RemoteFrame::didFinishLoadInAnotherProcess):
* Source/WebCore/page/RemoteFrame.h:
* Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp:
(WebKit::ProvisionalFrameProxy::ProvisionalFrameProxy):
(WebKit::ProvisionalFrameProxy::takeRemotePageProxy):
* Source/WebKit/UIProcess/ProvisionalFrameProxy.h:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::cancel):
(WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame):
* Source/WebKit/UIProcess/ProvisionalPageProxy.h:
* Source/WebKit/UIProcess/RemotePageProxy.cpp:
(WebKit::RemotePageProxy::didReceiveMessage):
(WebKit::RemotePageProxy::didFailProvisionalLoadForFrame):
* Source/WebKit/UIProcess/RemotePageProxy.h:
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::takeProvisionalFrame):
(WebKit::WebFrameProxy::didFailLoad):
(WebKit::WebFrameProxy::prepareForProvisionalNavigationInProcess):
(WebKit::WebFrameProxy::commitProvisionalFrame):
(WebKit::WebFrameProxy::setRemotePageProxy): Deleted.
* Source/WebKit/UIProcess/WebFrameProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForNavigation):
(WebKit::WebProcessPool::processForNavigationInternal):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/WebProcess/WebCoreSupport/WebLocalFrameLoaderClient.cpp:
(WebKit::WebLocalFrameLoaderClient::dispatchDidFailProvisionalLoad):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::didFinishLoadInAnotherProcess):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolation.mm:
(TestWebKitAPI::TEST):

Canonical link: https://commits.webkit.org/267264@main
  • Loading branch information
achristensen07 committed Aug 25, 2023
1 parent 002b1d2 commit 77752e9
Show file tree
Hide file tree
Showing 23 changed files with 136 additions and 53 deletions.
9 changes: 7 additions & 2 deletions Source/WebCore/loader/FrameLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2089,6 +2089,13 @@ void FrameLoader::clearProvisionalLoad()
setState(FrameState::Complete);
}

void FrameLoader::provisionalLoadFailedInAnotherProcess()
{
m_provisionalLoadHappeningInAnotherProcess = false;
if (auto* localParent = dynamicDowncast<LocalFrame>(m_frame.tree().parent()))
localParent->loader().checkLoadComplete();
}

void FrameLoader::commitProvisionalLoad()
{
RefPtr<DocumentLoader> pdl = m_provisionalDocumentLoader;
Expand Down Expand Up @@ -3718,8 +3725,6 @@ void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque
// Don't call checkCompleted until RemoteFrame::didFinishLoadInAnotherProcess,
// to prevent onload from happening until iframes finish loading in other processes.
ASSERT(m_frame.settings().siteIsolationEnabled());
// FIXME: This needs to be set back to false if the provisional load in another process fails before it it committed.
// When the load is committed, this FrameLoader and its LocalFrame are replaced by a RemoteFrame.
m_provisionalLoadHappeningInAnotherProcess = true;
}

Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/loader/FrameLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ class FrameLoader final {
WEBCORE_EXPORT bool isComplete() const;

void commitProvisionalLoad();
void provisionalLoadFailedInAnotherProcess();

void setLoadsSynchronously(bool loadsSynchronously) { m_loadsSynchronously = loadsSynchronously; }
bool loadsSynchronously() const { return m_loadsSynchronously; }
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/page/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class Frame : public ThreadSafeRefCounted<Frame, WTF::DestructionThread::Main>,
virtual bool preventsParentFromBeingComplete() const = 0;
virtual void changeLocation(FrameLoadRequest&&) = 0;
virtual void broadcastFrameRemovalToOtherProcesses() = 0;
virtual void didFinishLoadInAnotherProcess() = 0;

virtual FrameView* virtualView() const = 0;

Expand Down
5 changes: 5 additions & 0 deletions Source/WebCore/page/LocalFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ void LocalFrame::broadcastFrameRemovalToOtherProcesses()
loader().client().broadcastFrameRemovalToOtherProcesses();
}

void LocalFrame::didFinishLoadInAnotherProcess()
{
loader().provisionalLoadFailedInAnotherProcess();
}

void LocalFrame::invalidateContentEventRegionsIfNeeded(InvalidateContentEventRegionsReason reason)
{
if (!page() || !m_doc || !m_doc->renderView())
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/page/LocalFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ class LocalFrame final : public Frame {
bool preventsParentFromBeingComplete() const final;
void changeLocation(FrameLoadRequest&&) final;
void broadcastFrameRemovalToOtherProcesses() final;
void didFinishLoadInAnotherProcess() final;

FrameView* virtualView() const final;
DOMWindow* virtualWindow() const final;
Expand Down
1 change: 0 additions & 1 deletion Source/WebCore/page/RemoteFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ RemoteDOMWindow& RemoteFrame::window() const

void RemoteFrame::didFinishLoadInAnotherProcess()
{
// FIXME: We also need to set this to false if the load fails in another process.
m_preventsParentFromBeingComplete = false;

if (auto* ownerElement = this->ownerElement())
Expand Down
3 changes: 1 addition & 2 deletions Source/WebCore/page/RemoteFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ class RemoteFrame final : public Frame {
void setOpener(Frame* opener) { m_opener = opener; }
Frame* opener() const { return m_opener.get(); }

WEBCORE_EXPORT void didFinishLoadInAnotherProcess();

const RemoteFrameClient& client() const { return m_client.get(); }
RemoteFrameClient& client() { return m_client.get(); }

Expand All @@ -71,6 +69,7 @@ class RemoteFrame final : public Frame {
bool preventsParentFromBeingComplete() const final;
void changeLocation(FrameLoadRequest&&) final;
void broadcastFrameRemovalToOtherProcesses() final;
void didFinishLoadInAnotherProcess() final;

FrameView* virtualView() const final;
DOMWindow* virtualWindow() const final;
Expand Down
14 changes: 11 additions & 3 deletions Source/WebKit/UIProcess/ProvisionalFrameProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@
#include "config.h"
#include "ProvisionalFrameProxy.h"

#include "RemotePageProxy.h"
#include "VisitedLinkStore.h"
#include "WebFrameProxy.h"
#include "WebPageProxy.h"

namespace WebKit {

ProvisionalFrameProxy::ProvisionalFrameProxy(WebFrameProxy& frame, Ref<WebProcessProxy>&& process)
ProvisionalFrameProxy::ProvisionalFrameProxy(WebFrameProxy& frame, WebProcessProxy& process, RefPtr<RemotePageProxy>&& remotePageProxy)
: m_frame(frame)
, m_process(WTFMove(process))
, m_process(process)
, m_remotePageProxy(WTFMove(remotePageProxy))
, m_visitedLinkStore(frame.page()->visitedLinkStore())
, m_pageID(frame.page()->webPageID()) // FIXME: Generate a new one? This can conflict. And we probably want something like ProvisionalPageProxy to respond to messages anyways.
, m_pageID(frame.page()->webPageID())
, m_webPageID(frame.page()->identifier())
, m_layerHostingContextIdentifier(WebCore::LayerHostingContextIdentifier::generate())
{
ASSERT(!m_remotePageProxy || m_remotePageProxy->process().coreProcessIdentifier() == process.coreProcessIdentifier());
m_process->markProcessAsRecentlyUsed();
m_process->addProvisionalFrameProxy(*this);
}
Expand All @@ -49,4 +52,9 @@ ProvisionalFrameProxy::~ProvisionalFrameProxy()
m_process->removeProvisionalFrameProxy(*this);
}

RefPtr<RemotePageProxy> ProvisionalFrameProxy::takeRemotePageProxy()
{
return std::exchange(m_remotePageProxy, nullptr);
}

}
5 changes: 4 additions & 1 deletion Source/WebKit/UIProcess/ProvisionalFrameProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,26 @@

namespace WebKit {

class RemotePageProxy;
class VisitedLinkStore;
class WebFrameProxy;
class WebProcessProxy;

class ProvisionalFrameProxy : public CanMakeWeakPtr<ProvisionalFrameProxy> {
WTF_MAKE_FAST_ALLOCATED;
public:
ProvisionalFrameProxy(WebFrameProxy&, Ref<WebProcessProxy>&&);
ProvisionalFrameProxy(WebFrameProxy&, WebProcessProxy&, RefPtr<RemotePageProxy>&&);
~ProvisionalFrameProxy();

WebProcessProxy& process() { return m_process.get(); }
RefPtr<RemotePageProxy> takeRemotePageProxy();

WebCore::LayerHostingContextIdentifier layerHostingContextIdentifier() const { return m_layerHostingContextIdentifier; }

private:
CheckedRef<WebFrameProxy> m_frame;
Ref<WebProcessProxy> m_process;
RefPtr<RemotePageProxy> m_remotePageProxy;
Ref<VisitedLinkStore> m_visitedLinkStore;
WebCore::PageIdentifier m_pageID;
WebPageProxyIdentifier m_webPageID;
Expand Down
10 changes: 5 additions & 5 deletions Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void ProvisionalPageProxy::cancel()
std::nullopt,
m_mainFrame->processID()
};
didFailProvisionalLoadForFrame(m_mainFrame->frameID(), WTFMove(frameInfo), ResourceRequest { m_request }, m_navigationID, m_provisionalLoadURL.string(), error, WebCore::WillContinueLoading::No, UserData { }, WebCore::WillInternallyHandleFailure::No); // Will delete |this|.
didFailProvisionalLoadForFrame(WTFMove(frameInfo), ResourceRequest { m_request }, m_navigationID, m_provisionalLoadURL.string(), error, WebCore::WillContinueLoading::No, UserData { }, WebCore::WillInternallyHandleFailure::No); // Will delete |this|.
}

void ProvisionalPageProxy::initializeWebPage(RefPtr<API::WebsitePolicies>&& websitePolicies)
Expand Down Expand Up @@ -344,20 +344,20 @@ void ProvisionalPageProxy::didStartProvisionalLoadForFrame(FrameIdentifier frame
m_page->didStartProvisionalLoadForFrameShared(m_process.copyRef(), frameID, WTFMove(frameInfo), WTFMove(request), navigationID, WTFMove(url), WTFMove(unreachableURL), userData);
}

void ProvisionalPageProxy::didFailProvisionalLoadForFrame(FrameIdentifier frameID, FrameInfoData&& frameInfo, ResourceRequest&& request, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError& error, WebCore::WillContinueLoading willContinueLoading, const UserData& userData, WebCore::WillInternallyHandleFailure willInternallyHandleFailure)
void ProvisionalPageProxy::didFailProvisionalLoadForFrame(FrameInfoData&& frameInfo, ResourceRequest&& request, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError& error, WebCore::WillContinueLoading willContinueLoading, const UserData& userData, WebCore::WillInternallyHandleFailure willInternallyHandleFailure)
{
if (!validateInput(frameID, navigationID))
if (!validateInput(frameInfo.frameID, navigationID))
return;

PROVISIONALPAGEPROXY_RELEASE_LOG_ERROR(ProcessSwapping, "didFailProvisionalLoadForFrame: frameID=%" PRIu64, frameID.object().toUInt64());
PROVISIONALPAGEPROXY_RELEASE_LOG_ERROR(ProcessSwapping, "didFailProvisionalLoadForFrame: frameID=%" PRIu64, frameInfo.frameID.object().toUInt64());
ASSERT(!m_provisionalLoadURL.isNull());
m_provisionalLoadURL = { };

// Make sure the Page's main frame's expectedURL gets cleared since we updated it in didStartProvisionalLoad.
if (auto* pageMainFrame = m_page->mainFrame())
pageMainFrame->didFailProvisionalLoad();

RefPtr frame = WebFrameProxy::webFrame(frameID);
RefPtr frame = WebFrameProxy::webFrame(frameInfo.frameID);
MESSAGE_CHECK(m_process, frame);
m_page->didFailProvisionalLoadForFrameShared(m_process.copyRef(), *frame, WTFMove(frameInfo), WTFMove(request), navigationID, provisionalURL, error, willContinueLoading, userData, willInternallyHandleFailure); // May delete |this|.
}
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/ProvisionalPageProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class ProvisionalPageProxy : public IPC::MessageReceiver, public IPC::MessageSen
void didCreateMainFrame(WebCore::FrameIdentifier);
void didStartProvisionalLoadForFrame(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, URL&&, URL&& unreachableURL, const UserData&);
void didCommitLoadForFrame(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, WebCore::FrameLoadType, const WebCore::CertificateInfo&, bool usedLegacyTLS, bool privateRelayed, bool containsPluginDocument, WebCore::HasInsecureContent, WebCore::MouseEventPolicy, const UserData&);
void didFailProvisionalLoadForFrame(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&, WebCore::WillInternallyHandleFailure);
void didFailProvisionalLoadForFrame(FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&, WebCore::WillInternallyHandleFailure);
void logDiagnosticMessageFromWebProcess(const String& message, const String& description, WebCore::ShouldSample);
void logDiagnosticMessageWithEnhancedPrivacyFromWebProcess(const String& message, const String& description, WebCore::ShouldSample);
void logDiagnosticMessageWithValueDictionaryFromWebProcess(const String& message, const String& description, const WebCore::DiagnosticLoggingClient::ValueDictionary&, WebCore::ShouldSample);
Expand Down
17 changes: 17 additions & 0 deletions Source/WebKit/UIProcess/RemotePageProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ void RemotePageProxy::didReceiveMessage(IPC::Connection& connection, IPC::Decode
return;
}

if (decoder.messageName() == Messages::WebPageProxy::DidFailProvisionalLoadForFrame::name()) {
IPC::handleMessage<Messages::WebPageProxy::DidFailProvisionalLoadForFrame>(connection, decoder, this, &RemotePageProxy::didFailProvisionalLoadForFrame);
return;
}

if (m_page)
m_page->didReceiveMessage(connection, decoder);
}
Expand Down Expand Up @@ -145,6 +150,18 @@ void RemotePageProxy::decidePolicyForNavigationActionSync(FrameInfoData&& frameI
m_page->decidePolicyForNavigationActionSyncShared(m_process.copyRef(), m_webPageID, WTFMove(frameInfo), navigationID, WTFMove(navigationActionData), WTFMove(originatingFrameInfo), originatingPageID, originalRequest, WTFMove(request), WTFMove(requestBody), WTFMove(completionHandler));
}

void RemotePageProxy::didFailProvisionalLoadForFrame(FrameInfoData&& frameInfo, WebCore::ResourceRequest&& request, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError& error, WebCore::WillContinueLoading willContinueLoading, const UserData& userData, WebCore::WillInternallyHandleFailure willInternallyHandleFailure)
{
if (!m_page)
return;

RefPtr frame = WebFrameProxy::webFrame(frameInfo.frameID);
if (!frame)
return;

m_page->didFailProvisionalLoadForFrameShared(m_process.copyRef(), *frame, WTFMove(frameInfo), WTFMove(request), navigationID, provisionalURL, error, willContinueLoading, userData, willInternallyHandleFailure);
}

void RemotePageProxy::didChangeProvisionalURLForFrame(WebCore::FrameIdentifier frameID, uint64_t navigationID, URL&& url)
{
if (!m_page)
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/UIProcess/RemotePageProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class RemotePageProxy : public RefCounted<RemotePageProxy>, public IPC::MessageR
void didCommitLoadForFrame(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, WebCore::FrameLoadType, const WebCore::CertificateInfo&, bool usedLegacyTLS, bool privateRelayed, bool containsPluginDocument, WebCore::HasInsecureContent, WebCore::MouseEventPolicy, const UserData&);
void decidePolicyForNavigationActionAsync(FrameInfoData&&, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo, std::optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, CompletionHandler<void(PolicyDecision&&)>&&);
void decidePolicyForNavigationActionSync(FrameInfoData&&, uint64_t navigationID, NavigationActionData&&, FrameInfoData&& originatingFrameInfo, std::optional<WebPageProxyIdentifier> originatingPageID, const WebCore::ResourceRequest& originalRequest, WebCore::ResourceRequest&&, IPC::FormDataReference&& requestBody, CompletionHandler<void(PolicyDecision&&)>&&);
void didFailProvisionalLoadForFrame(FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& provisionalURL, const WebCore::ResourceError&, WebCore::WillContinueLoading, const UserData&, WebCore::WillInternallyHandleFailure);
void didChangeProvisionalURLForFrame(WebCore::FrameIdentifier, uint64_t, URL&&);

const WebCore::PageIdentifier m_webPageID;
Expand Down
29 changes: 17 additions & 12 deletions Source/WebKit/UIProcess/WebFrameProxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ WebPageProxy* WebFrameProxy::page() const
return m_page.get();
}

std::unique_ptr<ProvisionalFrameProxy> WebFrameProxy::takeProvisionalFrame()
{
return std::exchange(m_provisionalFrame, nullptr);
}

void WebFrameProxy::webProcessWillShutDown()
{
for (auto& childFrame : std::exchange(m_childFrames, { }))
Expand Down Expand Up @@ -264,8 +269,6 @@ void WebFrameProxy::didFailLoad()

if (m_navigateCallback)
m_navigateCallback({ }, { });

// FIXME: Should we send DidFinishLoadInAnotherProcess here too?
}

void WebFrameProxy::didSameDocumentNavigation(const URL& url)
Expand Down Expand Up @@ -397,7 +400,16 @@ void WebFrameProxy::prepareForProvisionalNavigationInProcess(WebProcessProxy& pr

if (!m_provisionalFrame || navigation.currentRequestIsCrossSiteRedirect()) {
// FIXME: Main resource (of main or subframe) request redirects should go straight from the network to UI process so we don't need to make the processes for each domain in a redirect chain.
m_provisionalFrame = makeUnique<ProvisionalFrameProxy>(*this, Ref { process });
RegistrableDomain navigationDomain(navigation.currentRequest().url());
RefPtr remotePageProxy = m_page->remotePageProxyForRegistrableDomain(navigationDomain);
if (remotePageProxy)
ASSERT(remotePageProxy->process().coreProcessIdentifier() == process.coreProcessIdentifier());
else if (navigationDomain != RegistrableDomain(m_page->mainFrame()->url())) {
remotePageProxy = RemotePageProxy::create(*m_page, process, navigationDomain);
remotePageProxy->injectPageIntoNewProcess();
}

m_provisionalFrame = makeUnique<ProvisionalFrameProxy>(*this, process, WTFMove(remotePageProxy));
// FIXME: This gives too much cookie access. This should be removed when a RemoteFrame is given a topOrigin member.
auto giveAllCookieAccess = LoadedWebArchive::Yes;
WebCore::RegistrableDomain domain { };
Expand All @@ -421,20 +433,13 @@ void WebFrameProxy::commitProvisionalFrame(FrameIdentifier frameID, FrameInfoDat
if (m_provisionalFrame) {
m_provisionalFrame->process().provisionalFrameCommitted(*this);
m_process->send(Messages::WebPage::DidCommitLoadInAnotherProcess(frameID, m_provisionalFrame->layerHostingContextIdentifier()), m_page->webPageID());
m_process = std::exchange(m_provisionalFrame, nullptr)->process();
m_process = m_provisionalFrame->process();
m_remotePageProxy = m_provisionalFrame->takeRemotePageProxy();
m_provisionalFrame = nullptr;

RegistrableDomain oldDomain(url());
m_remotePageProxy = m_page->remotePageProxyForRegistrableDomain(RegistrableDomain(request.url()));
}
m_page->didCommitLoadForFrame(frameID, WTFMove(frameInfo), WTFMove(request), navigationID, mimeType, frameHasCustomContentProvider, frameLoadType, certificateInfo, usedLegacyTLS, privateRelayed, containsPluginDocument, hasInsecureContent, mouseEventPolicy, userData);
}

void WebFrameProxy::setRemotePageProxy(RemotePageProxy* remotePageProxy)
{
m_remotePageProxy = remotePageProxy;
}

void WebFrameProxy::getFrameInfo(CompletionHandler<void(FrameTreeNodeData&&)>&& completionHandler)
{
class FrameInfoCallbackAggregator : public RefCounted<FrameInfoCallbackAggregator> {
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/UIProcess/WebFrameProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ class WebFrameProxy : public API::ObjectImpl<API::Object::Type::Frame>, public C
void prepareForProvisionalNavigationInProcess(WebProcessProxy&, const API::Navigation&, CompletionHandler<void()>&&);

void commitProvisionalFrame(WebCore::FrameIdentifier, FrameInfoData&&, WebCore::ResourceRequest&&, uint64_t navigationID, const String& mimeType, bool frameHasCustomContentProvider, WebCore::FrameLoadType, const WebCore::CertificateInfo&, bool usedLegacyTLS, bool privateRelayed, bool containsPluginDocument, WebCore::HasInsecureContent, WebCore::MouseEventPolicy, const UserData&);
void setRemotePageProxy(RemotePageProxy*);

void getFrameInfo(CompletionHandler<void(FrameTreeNodeData&&)>&&);
FrameTreeCreationParameters frameTreeCreationParameters() const;
Expand All @@ -163,6 +162,7 @@ class WebFrameProxy : public API::ObjectImpl<API::Object::Type::Frame>, public C
WebProcessProxy& process() { return m_process.get(); }
void setProcess(WebProcessProxy& process) { m_process = process; }
ProvisionalFrameProxy* provisionalFrame() { return m_provisionalFrame.get(); }
std::unique_ptr<ProvisionalFrameProxy> takeProvisionalFrame();

private:
WebFrameProxy(WebPageProxy&, WebProcessProxy&, WebCore::FrameIdentifier);
Expand Down
Loading

0 comments on commit 77752e9

Please sign in to comment.