Bug 202491 - Fix determination of the top-level resource
Summary: Fix determination of the top-level resource
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Rollin
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-02 13:35 PDT by Keith Rollin
Modified: 2019-10-04 14:17 PDT (History)
8 users (show)

See Also:


Attachments
Patch (4.68 KB, patch)
2019-10-02 13:37 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff
Made suggested change. (4.66 KB, patch)
2019-10-04 13:39 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keith Rollin 2019-10-02 13:35:57 PDT
When loading the resources associated with a page, the Networking process needs to know the main resource for the main frame. It uses this information to keep track of page loads and the resources that are loaded in those pages. By keeping track of this information, WebKit can track and report difficult (slow or incomplete) resource loads and their impact on the overall page.

The initial determination of the top resource only looked at whether the resource was the "main" resource of a frame or not. However, this determination was insufficient, and would confuse the tracking mechanism when sub-frames also had main frames. Therefore, augment the test by also looking to see if the hosting frame is the main frame.
Comment 1 Keith Rollin 2019-10-02 13:36:09 PDT
<rdar://problem/50780648>
Comment 2 Keith Rollin 2019-10-02 13:37:38 PDT
Created attachment 380053 [details]
Patch
Comment 3 youenn fablet 2019-10-03 23:51:38 PDT
Comment on attachment 380053 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=380053&action=review

> Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:171
> +    m_networkActivityTracker = m_connection->startTrackingResourceLoad(m_parameters.webPageID, m_parameters.identifier, isMainResource() && isMainFrameLoad());

if isMainFrameLoad() is true, isMainResource() should also be true.
I think we can remove the isMainResource() check.
Comment 4 Keith Rollin 2019-10-04 13:39:35 PDT
Created attachment 380248 [details]
Made suggested change.
Comment 5 WebKit Commit Bot 2019-10-04 14:17:29 PDT
Comment on attachment 380248 [details]
Made suggested change.

Clearing flags on attachment: 380248

Committed r250745: <https://trac.webkit.org/changeset/250745>
Comment 6 WebKit Commit Bot 2019-10-04 14:17:31 PDT
All reviewed patches have been landed.  Closing bug.