[webkit-changes] [WebKit/WebKit] 2f73df: Remove Messages::WebPageProxy::DidCreateMainFrame

Alex Christensen noreply at github.com
Sat Aug 17 20:45:20 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 2f73df8bb0a2141174afc61bef0e64774f301aa9
      https://github.com/WebKit/WebKit/commit/2f73df8bb0a2141174afc61bef0e64774f301aa9
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2024-08-17 (Sat, 17 Aug 2024)

  Changed paths:
    M Source/WebKit/Shared/WebPageCreationParameters.h
    M Source/WebKit/Shared/WebPageCreationParameters.serialization.in
    M Source/WebKit/UIProcess/API/APIPageConfiguration.cpp
    M Source/WebKit/UIProcess/API/APIPageConfiguration.h
    M Source/WebKit/UIProcess/API/glib/WebKitWebView.cpp
    M Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp
    M Source/WebKit/UIProcess/API/wpe/WPEWebViewLegacy.cpp
    M Source/WebKit/UIProcess/API/wpe/WPEWebViewPlatform.cpp
    M Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.h
    M Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm
    M Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.h
    M Source/WebKit/UIProcess/Cocoa/SOAuthorization/SOAuthorizationCoordinator.mm
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
    M Source/WebKit/UIProcess/FrameProcess.h
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/ProvisionalPageProxy.h
    M Source/WebKit/UIProcess/WebFrameProxy.cpp
    M Source/WebKit/UIProcess/WebFrameProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.messages.in
    M Source/WebKit/UIProcess/WebPageProxyInternals.h
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
    M Source/WebKit/UIProcess/ios/WKContentView.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    M Source/WebKit/UIProcess/playstation/PlayStationWebView.cpp
    M Source/WebKit/UIProcess/win/WebView.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp

  Log Message:
  -----------
  Remove Messages::WebPageProxy::DidCreateMainFrame
https://bugs.webkit.org/show_bug.cgi?id=278063
rdar://133795690

Reviewed by Chris Dumez.

We used to have FrameIdentifiers all generated in the same web content process,
so we needed the web content process to tell the UI process what the identifier
of the main frame was.  With site isolation, we have already made FrameIdentifier
ProcessQualified, which is necessary because frames in different web content
processes can each make new frames with site isolation on.  In order to get
about:blank loads more correct, we need the UI process to be in charge of making
the main frame with its identifier and the web content process is in charge of
making iframes and their identifiers.

Because WebFrameProxy::isMainFrame is now called from functions called by the
ProvisionalPageProxy constructor (like didReceiveServerRedirectForProvisionalLoadForFrameShared)
we had to update it to check a boolean enum stored on the WebFrameProxy instead
of checking the connected WebPageProxy or ProvisionalPageProxy for its main frame.

Because there is no longer a time between WebPageProxy initialization and main frame
construction, setServiceWorkerOpenWindowCompletionCallback needs to be replaced by
just putting it directly on to the main frame.  Removing serviceWorkerOpenWindowCompletionCallback
is necessary to keep the ServiceWorker.OpenWindowWebsiteDataStoreDelegate API test
working, and it is also a simplification.

WebProcessPool::globalDelaysWebProcessLaunchDefaultValue returns false on iOS, which
no longer works nicely with site isolation's process management during WKWebView
instantiation, so PageConfiguration::delaysWebProcessLaunchUntilFirstLoad now returns
false to keep this behavior platform-independent with site isolation on.

In order to get http/tests/site-isolation/iframe-and-window-open.html to keep passing,
I need to initialize WebPageProxy's m_openerFrame in the constructor rather than
the completion handler of WebPageProxy::createNewPage after the page had been initialized
because otherwise some processes would be told it does have an opener and some would
be told that it does not have an opener.

Now that the API::PageConfiguration is where the WebPageProxy gets its opener from,
PopUpSOAuthorizationSession can no longer recreate its own WKWebViewConfiguration that
is similar enough by using _relatedWebView.  It needs to actually use the PageConfiguration
that comes from WebPageProxy::createNewPage where the opener frame is set.

* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/Shared/WebPageCreationParameters.serialization.in:
* Source/WebKit/UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::openerProcess const):
(API::PageConfiguration::setOpenerProcess):
* Source/WebKit/UIProcess/API/APIPageConfiguration.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
(WebKit::ProvisionalPageProxy::initializeWebPage):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
(WebKit::ProvisionalPageProxy::didReceiveMessage):
(WebKit::ProvisionalPageProxy::didCreateMainFrame): Deleted.
* Source/WebKit/UIProcess/ProvisionalPageProxy.h:
* Source/WebKit/UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::frameProcess):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::launchProcess):
(WebKit::WebPageProxy::swapToProvisionalPage):
(WebKit::WebPageProxy::finishAttachingToWebProcess):
(WebKit::WebPageProxy::launchProcessForReload):
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::ensureRunningProcess):
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadFile):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadSimulatedRequest):
(WebKit::WebPageProxy::loadAlternateHTML):
(WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::launchInitialProcessIfNecessary):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSync):
(WebKit::WebPageProxy::createNewPage):
(WebKit::WebPageProxy::loadAndDecodeImage):
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::creationParametersForProvisionalPage):
(WebKit::WebPageProxy::creationParametersForRemotePage):
(WebKit::WebPageProxy::didCreateMainFrame): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxy.messages.in:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::m_flagsChangedEventMonitorTrackingArea):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::m_textAnimationController):

Canonical link: https://commits.webkit.org/282394@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list