Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Issue 339593005: Set the target type when creating the request for main resource (Closed)

Created:
6 years, 6 months ago by clamy
Modified:
5 years, 8 months ago
Reviewers:
eseidel, Nate Chapin, ppi
CC:
blink-reviews, fs, apavlov+blink_chromium.org, aandrey+blink_chromium.org, rwlbuis, jamesr, caseq+blink_chromium.org, krit, malch+blink_chromium.org, blink-reviews-html_chromium.org, yurys+blink_chromium.org, abarth-chromium, dglazkov+blink, gavinp+loader_chromium.org, devtools-reviews_chromium.org, pdr., loislo+blink_chromium.org, lushnikov+blink_chromium.org, eustas+blink_chromium.org, paulirish+reviews_chromium.org, gyuyoung.kim_webkit.org, Nate Chapin, Stephen Chennney, kouhei+svg_chromium.org, vsevik+blink_chromium.org, pfeldman+blink_chromium.org, ed+blinkwatch_opera.com, f(malita), sergeyv+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Set the target type when creating the request for main resources This is a preparatory CL before refactoring the navigation logic. The goal is to have the TargetType set upon initialization of the ResourceRequest instead of inside the ResourceFetcher. Ultimately the navigations should not go through the ResourceFetcher anymore. BUG=376025

Patch Set 1 : #

Patch Set 2 : #

Total comments: 5

Patch Set 3 : Removed setting the priority + swicthed to factory method #

Patch Set 4 : Rebase #

Patch Set 5 : Rebase #

Total comments: 4

Patch Set 6 : Made the setter method private #

Total comments: 4

Patch Set 7 : Switched to constructors #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -47 lines) Patch
M Source/core/html/HTMLAnchorElement.cpp View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M Source/core/inspector/InspectorOverlay.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/loader/FrameLoader.cpp View 1 2 3 4 5 6 3 chunks +5 lines, -4 lines 0 comments Download
M Source/core/loader/NavigationScheduler.cpp View 1 2 3 4 5 6 6 chunks +12 lines, -6 lines 0 comments Download
M Source/core/page/CreateWindow.cpp View 1 2 3 4 5 6 2 chunks +3 lines, -2 lines 0 comments Download
M Source/core/page/DragController.cpp View 1 2 3 4 5 6 1 chunk +4 lines, -2 lines 0 comments Download
M Source/core/svg/SVGAElement.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/svg/graphics/SVGImage.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M Source/core/testing/MockPagePopupDriver.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M Source/platform/exported/WebURLRequest.cpp View 1 2 3 4 5 6 2 chunks +15 lines, -0 lines 0 comments Download
M Source/platform/network/ResourceRequest.h View 1 2 3 4 5 6 2 chunks +12 lines, -1 line 0 comments Download
M Source/platform/network/ResourceRequest.cpp View 1 2 3 4 5 6 1 chunk +5 lines, -0 lines 0 comments Download
M Source/web/FrameLoaderClientImpl.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M Source/web/WebEmbeddedWorkerImpl.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M Source/web/WebLocalFrameImpl.cpp View 1 2 3 4 5 6 1 chunk +5 lines, -2 lines 0 comments Download
M Source/web/WebSharedWorkerImpl.cpp View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M Source/web/tests/FrameTestHelpers.cpp View 1 2 1 chunk +1 line, -3 lines 0 comments Download
M Source/web/tests/WebFrameTest.cpp View 1 2 3 4 5 6 5 chunks +9 lines, -9 lines 0 comments Download
M Source/web/tests/WebViewTest.cpp View 1 2 3 4 1 chunk +2 lines, -4 lines 0 comments Download
M public/platform/WebURLRequest.h View 1 2 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
clamy
https://chromiumcodereview.appspot.com/339593005/diff/40001/Source/core/fetch/FetchRequest.cpp File Source/core/fetch/FetchRequest.cpp (right): https://chromiumcodereview.appspot.com/339593005/diff/40001/Source/core/fetch/FetchRequest.cpp#newcode44 Source/core/fetch/FetchRequest.cpp:44: m_resourceRequest.setPriority(priority); In a third patch, the priority will no ...
6 years, 6 months ago (2014-06-19 13:32:08 UTC) #1
clamy
@ppi: PTAL. You probably want to start with ResourceRequest and WebURLRequest as the CL is ...
6 years, 6 months ago (2014-06-19 13:33:19 UTC) #2
ppi
Thanks! Should / could the logic that sets the highest priority for the targets being ...
6 years, 6 months ago (2014-06-19 18:25:43 UTC) #3
clamy
Thanks! PTAL I have removed changes to the priority and will pursue them in a ...
6 years, 6 months ago (2014-06-23 15:32:50 UTC) #4
ppi
This lgtm. Two remarks below, thanks! https://codereview.chromium.org/339593005/diff/120001/Source/platform/exported/WebURLRequest.cpp File Source/platform/exported/WebURLRequest.cpp (right): https://codereview.chromium.org/339593005/diff/120001/Source/platform/exported/WebURLRequest.cpp#newcode74 Source/platform/exported/WebURLRequest.cpp:74: WebURLRequestPrivateImpl(const WebURL& url, ...
6 years, 6 months ago (2014-06-24 12:22:21 UTC) #5
clamy
Thanks for the review! https://chromiumcodereview.appspot.com/339593005/diff/120001/Source/platform/exported/WebURLRequest.cpp File Source/platform/exported/WebURLRequest.cpp (right): https://chromiumcodereview.appspot.com/339593005/diff/120001/Source/platform/exported/WebURLRequest.cpp#newcode74 Source/platform/exported/WebURLRequest.cpp:74: WebURLRequestPrivateImpl(const WebURL& url, bool isMainResource, ...
6 years, 6 months ago (2014-06-24 13:57:07 UTC) #6
clamy
@japhet: PTAL. The goal of the patch is to eventually remove the determination of ResourceRequest ...
6 years, 6 months ago (2014-06-24 14:01:42 UTC) #7
Nate Chapin
LGTM with a couple questions. https://codereview.chromium.org/339593005/diff/100002/Source/platform/network/ResourceRequest.h File Source/platform/network/ResourceRequest.h (right): https://codereview.chromium.org/339593005/diff/100002/Source/platform/network/ResourceRequest.h#newcode96 Source/platform/network/ResourceRequest.h:96: ResourceRequest(const KURL& url, const ...
6 years, 6 months ago (2014-06-24 18:28:55 UTC) #8
clamy
6 years, 6 months ago (2014-06-25 15:47:11 UTC) #9
@eseidel: PTAL

@japhet: Thanks! As per your suggestion I switched to using constructors, which
should fit better with the rest of the code.

https://chromiumcodereview.appspot.com/339593005/diff/100002/Source/platform/...
File Source/platform/network/ResourceRequest.h (right):

https://chromiumcodereview.appspot.com/339593005/diff/100002/Source/platform/...
Source/platform/network/ResourceRequest.h:96: ResourceRequest(const KURL& url,
const Referrer& referrer, ResourceRequestCachePolicy cachePolicy =
UseProtocolCachePolicy)
On 2014/06/24 18:28:54, Nate Chapin wrote:
> Is this constructor actually used for subresource loads? I would have guessed
it
> was main resource only.

You're right it is only used by main resources. I added a parameter to it.

https://chromiumcodereview.appspot.com/339593005/diff/100002/Source/platform/...
Source/platform/network/ResourceRequest.h:104: static ResourceRequest
createMainResourceRequest(const KURL&, bool isMainFrame);
On 2014/06/24 18:28:54, Nate Chapin wrote:
> Why is it better to have these static factory methods instead than
constructors
> (like the other ways to create a ResourceRequest)?

I thought it was more explicit that they give you a ResourceRequest that should
only be used for main resources. But it doesn't fit very well with the rest of
the code which uses constructors. So I made a new patch set with constructors,
so that we only have one way to create a ResourceRequest.

Powered by Google App Engine
This is Rietveld 408576698