| Summary: | Web Inspector: Frontend loaded resources from cache are not hidden as expected | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||||
| Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | bburg, beidson, commit-queue, graouts, japhet, joepeck, timothy, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
|
Description
Joseph Pecoraro
2014-03-10 15:21:32 PDT
The issue is that when there is a cached resource load of a frontend loaded resource, WebCore send their resource load notifier delegates with a fresh ResourceRequest, losing out on the flags from the original resource request. For example:
lldb> bt
* frame #0: WebCore`WebCore::InspectorResourceAgent::willSendRequest
...
frame #5: WebCore`WebCore::FrameLoader::loadedResourceFromMemoryCache
frame #6: WebCore`WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache
frame #7: WebCore`WebCore::CachedResourceLoader::requestResource
frame #8: WebCore`WebCore::CachedResourceLoader::requestRawResource
frame #9: WebCore`WebCore::DocumentThreadableLoader::loadRequest
...
frame #15: WebCore`WebCore::XMLHttpRequest::send
frame #16: WebCore`WebCore::XMLHttpRequest::send
frame #17: WebCore`WebCore::XMLHttpRequest::sendForInspector
The XHR send for inspector sets "hiddenFromInspector" on the resource request. Later in requestResource we determine we can reuse the cached resource from the cache, and go through the notifer process with a new request that only copies the URL from the original request.
Created attachment 226345 [details]
[PATCH] Proposed Fix
Proposed fix. Brady, can we pass this option (hiddenFromInspector) into loadedResourceFromMemoryCache in a cleaner way then this? As far as I can tell, these functions are all only used once in this path, there are no other callers.
Comment on attachment 226345 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=226345&action=review > Source/WebCore/loader/FrameLoader.cpp:3002 > newRequest = ResourceRequest(resource->url()); It might just be best if the caller did this. That would remove the dance you have to do. Comment on attachment 226345 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=226345&action=review >> Source/WebCore/loader/FrameLoader.cpp:3002 >> newRequest = ResourceRequest(resource->url()); > > It might just be best if the caller did this. That would remove the dance you have to do. I like that idea, seeing that this is only called in one place. Created attachment 226378 [details]
[PATCH] For Landing
Comment on attachment 226378 [details] [PATCH] For Landing Clearing flags on attachment: 226378 Committed r165427: <http://trac.webkit.org/changeset/165427> |