Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ccc524ab96943311a538cbdeb97faa8e6072ae71
      
https://github.com/WebKit/WebKit/commit/ccc524ab96943311a538cbdeb97faa8e6072ae71
  Author: Alex Christensen <[email protected]>
  Date:   2024-09-17 (Tue, 17 Sep 2024)

  Changed paths:
    M 
Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h
    M 
Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm
    M Source/WebKit/UIProcess/FrameLoadState.cpp
    M Source/WebKit/UIProcess/FrameLoadState.h
    M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
    M Source/WebKit/UIProcess/WebFrameProxy.cpp
    M Source/WebKit/UIProcess/WebFrameProxy.h
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebPageProxyInternals.h

  Log Message:
  -----------
  Clean up state in PageLoadTimingFrameLoadStateObserver better when running 
PLT with site isolation
https://bugs.webkit.org/show_bug.cgi?id=279858

Reviewed by Ryosuke Niwa.

When running PLT with site isolation on, the state in 
PageLoadTimingFrameLoadStateObserver
and other state used by WebPageProxy::generatePageLoadingTimingSoon gets 
confused.

Firstly, one of the subtests has an onload that creates a few iframes after the 
page load
timing for that page is complete.  This causes m_loadingFrameCount to be 
incremented a few
times and it is not reset when the main frame commits the next load and the 
frames and frame
processes are discarded without waiting for the didFailProvisionalLoad calls 
from those frames.

Similarly, several tests start loading some subresources after the page load is 
"complete",
which causes m_framesWithSubresourceLoadingForPageLoadTiming to be non-empty, 
and we
don't get a WebPageProxy::didDestroyFrame message for each frame, so we need a 
call to
m_framesWithSubresourceLoadingForPageLoadTiming.clear() when the main frame 
commits a new load.

In order to make the FrameLoadStateObserver callbacks able to be used to track 
state for
loads like this, I needed to add a few new ones and add an IsMainFrame 
parameter to only
reset when the main frame commits a load.  The existing callbacks are currently 
mostly used
to aggressively gather lists of URLs and not to precisely track entering and 
exiting loading
state.  For example, if FrameLoadState::setURL is called and we hadn't already 
started a
provisional load, we would get a call to didCancelProvisionalLoad without a 
corresponding
start call.

This makes PLT run most tests to completion immediately.  There is still a 
subtest that
has an iframe do a cross-site redirect to a load fail.  That needs separate 
investigation.

* 
Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.h:
* 
Source/WebKit/UIProcess/Cocoa/SOAuthorization/SubFrameSOAuthorizationSession.mm:
(WebKit::SubFrameSOAuthorizationSession::didFinishLoad):
* Source/WebKit/UIProcess/FrameLoadState.cpp:
(WebKit::FrameLoadState::didStartProvisionalLoad):
(WebKit::FrameLoadState::didFailProvisionalLoad):
(WebKit::FrameLoadState::didCommitLoad):
(WebKit::FrameLoadState::didFinishLoad):
* Source/WebKit/UIProcess/FrameLoadState.h:
(WebKit::FrameLoadStateObserver::didStartProvisionalLoad):
(WebKit::FrameLoadStateObserver::didFailProvisionalLoad):
(WebKit::FrameLoadStateObserver::didCommitProvisionalLoad):
(WebKit::FrameLoadStateObserver::didFinishLoad):
(WebKit::FrameLoadState::FrameLoadState):
(WebKit::FrameLoadState::isMainFrame const):
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::ProvisionalPageProxy):
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::WebFrameProxy):
(WebKit::WebFrameProxy::didCreateSubframe):
(WebKit::WebFrameProxy::isMainFrame const):
* Source/WebKit/UIProcess/WebFrameProxy.h:
(WebKit::WebFrameProxy::isMainFrame const): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::initializeWebPage):
(WebKit::WebPageProxy::didCommitLoadForFrame):
* Source/WebKit/UIProcess/WebPageProxyInternals.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to