Bug 78510
Summary: | [WK2] Implement WebFrameLoaderClient::dispatchDidLoadResourceFromMemoryCache() | ||
---|---|---|---|
Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> |
Component: | WebKit2 | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | Normal | CC: | gustavo, mrobinson, sam |
Priority: | P2 | ||
Version: | 528+ (Nightly build) | ||
Hardware: | PC | ||
OS: | Linux |
Carlos Garcia Campos
It's currently unimplemented in WebKit2. It's needed to keep track of loaded resources in the UI process.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Sam Weinig
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.
Carlos Garcia Campos
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
Sam Weinig
(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.
Carlos Garcia Campos
(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).
Martin Robinson
(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?
Carlos Garcia Campos
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.