Bug 199896 - Expose additional resource load statistics to clients
Summary: Expose additional resource load statistics to clients
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-07-17 20:24 PDT by Saagar Jha
Modified: 2019-07-22 09:44 PDT (History)
3 users (show)

See Also:


Attachments
Patch (13.40 KB, patch)
2019-07-17 20:32 PDT, Saagar Jha
no flags Details | Formatted Diff | Diff
Patch (14.39 KB, patch)
2019-07-22 09:37 PDT, Saagar Jha
saagarjha: review?
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saagar Jha 2019-07-17 20:24:49 PDT
Expose additional resource load statistics to clients
Comment 1 Saagar Jha 2019-07-17 20:32:59 PDT
Created attachment 374365 [details]
Patch
Comment 2 Sam Weinig 2019-07-18 16:31:31 PDT
Comment on attachment 374365 [details]
Patch

What is the use case for this information? Also, this needs tests.
Comment 3 Chris Dumez 2019-07-19 11:14:14 PDT
Comment on attachment 374365 [details]
Patch

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

> Source/WebKit/NetworkProcess/NetworkSession.cpp:154
> +void NetworkSession::didLoadResourceWithoutCookies(const String& resource, WebCore::PageIdentifier pageID)

This should not be a String, likely a URL.

> Source/WebKit/NetworkProcess/NetworkSession.h:90
> +    void didLoadResourceWithoutCookies(const String &resource, WebCore::PageIdentifier);

& on wrong side.

> Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:210
> +        session.didLoadResourceWithoutCookies(request.url().string(), pageID);

I would call this willLoad... rather than didLoad.. given that we have not started loading yet.

> Source/WebKit/UIProcess/API/APINavigationClient.h:156
> +    virtual void didLoadResourceWithoutCookies(const WTF::String& resource) { }

URL, also WTF:: is not needed.

> Source/WebKit/UIProcess/Cocoa/NavigationState.h:146
> +        void didLoadResourceWithoutCookies(const WTF::String& resource) override;

URL, also WTF:: is not needed.

> Source/WebKit/UIProcess/Cocoa/NavigationState.mm:1165
> +void NavigationState::NavigationClient::didLoadResourceWithoutCookies(const WTF::String& resource)

URL, also WTF:: is not needed.

> Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:931
> +void NetworkProcessProxy::didLoadResourceWithoutCookies(const String &resource, PageIdentifier pageID)

& on wrong side, and should be a URL.

> Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:933
> +    if (auto page = WebProcessProxy::webPage(pageID))

auto*

> Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in:52
> +    DidLoadResourceWithoutCookies(String resource, WebCore::PageIdentifier pageID);

URL
Comment 4 Saagar Jha 2019-07-22 09:37:02 PDT
Created attachment 374602 [details]
Patch
Comment 5 Saagar Jha 2019-07-22 09:44:57 PDT
(In reply to Chris Dumez from comment #3)

I've uploaded a new patch that takes your feedback into account. Specifically:

> Comment on attachment 374365 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=374365&action=review
> 
> > Source/WebKit/NetworkProcess/NetworkSession.cpp:154
> > +void NetworkSession::didLoadResourceWithoutCookies(const String& resource, WebCore::PageIdentifier pageID)
> 
> This should not be a String, likely a URL.

Yes, this has been changed.

> > Source/WebKit/NetworkProcess/NetworkSession.h:90
> > +    void didLoadResourceWithoutCookies(const String &resource, WebCore::PageIdentifier);
> 
> & on wrong side.

Fixed.

> > Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:210
> > +        session.didLoadResourceWithoutCookies(request.url().string(), pageID);
> 
> I would call this willLoad... rather than didLoad.. given that we have not
> started loading yet.

Good point, renamed.

> > Source/WebKit/UIProcess/API/APINavigationClient.h:156
> > +    virtual void didLoadResourceWithoutCookies(const WTF::String& resource) { }
> 
> URL, also WTF:: is not needed.

I seemed to need it: since this is in the API namespace, URL resolves to API::URL instead of WTF::URL (I think that's why the other instances also qualify using the namespace?)

> > Source/WebKit/UIProcess/Cocoa/NavigationState.h:146
> > +        void didLoadResourceWithoutCookies(const WTF::String& resource) override;
> 
> URL, also WTF:: is not needed.

Done.

> > Source/WebKit/UIProcess/Cocoa/NavigationState.mm:1165
> > +void NavigationState::NavigationClient::didLoadResourceWithoutCookies(const WTF::String& resource)
> 
> URL, also WTF:: is not needed.

Done.

> > Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:931
> > +void NetworkProcessProxy::didLoadResourceWithoutCookies(const String &resource, PageIdentifier pageID)
> 
> & on wrong side, and should be a URL.

Done.

> > Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:933
> > +    if (auto page = WebProcessProxy::webPage(pageID))
> 
> auto*

Does it actually matter, or is this just part of WebKit's style?

> > Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in:52
> > +    DidLoadResourceWithoutCookies(String resource, WebCore::PageIdentifier pageID);
> 
> URL

Done.