New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 664135 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 631966



Sign in to add a comment

dispatchDidLoadResourceFromMemoryCache doesn't pass resource type to browser correctly

Project Member Reported by alexilin@chromium.org, Nov 10 2016

Issue description

What steps will reproduce the problem?
(1) Put a resource into the memory cache.
(2) Request the same resource again to get it from the memory cache.
(3) Wait for the message FrameHostMsg_DidLoadResourceFromMemoryCache from renderer.

What is the expected result?
WebContentsImpl::OnDidLoadResourceFromMemoryCache expects to have correct resource type passed as parameter.

What happens instead?
Resource type is always equal to content::RESOURCE_TYPE_SUB_RESOURCE.

The bug is located in FrameFetchContext::dispatchDidLoadResourceFromMemoryCache(). When we "convert" the resource into blink::ResourceRequest to pass it to FrameLoaderClient, we use default value of WebURLRequest::RequestContext that then is converted to resource type in RenderFrameImpl::didLoadResourceFromMemoryCache().

Proposed fix:
Set the right value of WebURLRequest::RequestContext in FrameFetchContext::dispatchDidLoadResourceFromMemoryCache().
 

Comment 1 Deleted

Comment 2 by pasko@chromium.org, Nov 10 2016

Cc: tyoshino@chromium.org y...@yoav.ws mkwst@chromium.org japhet@chromium.org yhirano@chromium.org
Labels: -Pri-3 Pri-2
+yoav and core/loader owners

Comment 3 by y...@yoav.ws, Nov 15 2016

Yeah, seems reasonable to set the right context to ResourceRequest in FrameFetchContext::dispatchDidLoadResourceFromMemoryCache().
We already have that info there, so the fix should be straight forward.

You can probably test it by adding a unit test to FrameFetchContextTest.cpp
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6a5b9a93ca59066746f7e46a6f4a8e2594d3bb07

commit 6a5b9a93ca59066746f7e46a6f4a8e2594d3bb07
Author: alexilin <alexilin@chromium.org>
Date: Mon Nov 28 10:31:25 2016

Pass correct resource type to OnDidLoadResourceFromMemoryCache.

Resource type isn't passed to browser correctly.
More details in  https://crbug.com/664135 
This is an attempt to fix it.

BUG= 664135 

Review-Url: https://codereview.chromium.org/2494713002
Cr-Commit-Position: refs/heads/master@{#434629}

[modify] https://crrev.com/6a5b9a93ca59066746f7e46a6f4a8e2594d3bb07/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
[modify] https://crrev.com/6a5b9a93ca59066746f7e46a6f4a8e2594d3bb07/third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp

Status: Fixed (was: Started)

Sign in to add a comment