Bug 78510 - [WK2] Implement WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache()
Summary: [WK2] Implement WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache()
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-13 11:32 PST by Carlos Garcia Campos
Modified: 2012-02-28 06:36 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2012-02-13 11:32:21 PST
It's currently unimplemented in WebKit2. It's needed to keep track of loaded resources in the UI process.
Comment 1 Sam Weinig 2012-02-13 13:51:12 PST
Why do you want to track loaded resources in the UI Process.  I would like to reduce the API surface area that does this as much as possible going forward.
Comment 2 Carlos Garcia Campos 2012-02-14 00:27:20 PST
We want to provide a web_view_get_subresources() API similar to WebKit1, typically used to implement save(). Resources are cached by the web view and released before every load. When reloading, cached resources are still loaded (with 304 http response), but when loading the same url twice, resources in memory are not loaded at all. In this case, we release the resources cached by the web view before the second load, and the view only sees the resources that are not in memory. So the effect is basically: 

loadURI(http://foo.com)
n_resources1 = getResources().size()
loadURI(http://foo.com)
n_resources2 = getResources().size()

n_resources1 != n_resources2
Comment 3 Sam Weinig 2012-02-14 12:03:43 PST
(In reply to comment #2)
> We want to provide a web_view_get_subresources() API similar to WebKit1, typically used to implement save(). Resources are cached by the web view and released before every load. When reloading, cached resources are still loaded (with 304 http response), but when loading the same url twice, resources in memory are not loaded at all. In this case, we release the resources cached by the web view before the second load, and the view only sees the resources that are not in memory. So the effect is basically: 
> 
> loadURI(http://foo.com)
> n_resources1 = getResources().size()
> loadURI(http://foo.com)
> n_resources2 = getResources().size()
> 
> n_resources1 != n_resources2

This is not something that we want to support in the UIProcess, at least at this time.
Comment 4 Carlos Garcia Campos 2012-02-14 23:28:57 PST
(In reply to comment #3) 
> This is not something that we want to support in the UIProcess, at least at this time.

Would you accept at least adding only injected bundle api for it? I understand it's actually a corner case, there's only a problem when the same url is loaded twice (reloading wouldn't be affected).
Comment 5 Martin Robinson 2012-02-14 23:41:56 PST
(In reply to comment #3)

> This is not something that we want to support in the UIProcess, at least at this time.

Our port doesn't use Web Archives, so we'll need some method to save bundles of web content to avoid feature regressions in the Gnome platform. I believe in WebKit1 we implement this by freezing the contents of all resources to disk. Is the best approach here just to add GTK-only IPC calls between the WebProcess and UIProcess to support saving all subresources of a page?
Comment 6 Carlos Garcia Campos 2012-02-23 10:27:40 PST
I've noticed that for some resources loaded from memory cache the loader client callbacks are still emitted, but for CSSImageValue images they are not. I'm not sure if there are more resources affected, though. Is that expected or a bug? If normal resource load callback are amitted we don't need WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache() at all.