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

Issue 2260303002: Sending an async GET request for doc.written blocked scripts. (Closed)

Created:
4 years, 4 months ago by shivanisha
Modified:
4 years, 3 months ago
CC:
blink-reviews, blink-reviews-api_chromium.org, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, Bryan McQuade, chromium-reviews, dglazkov+blink, eae+blinkwatch, gavinp+loader_chromium.org, jkarlin, kinuko+watch, loading-reviews+parser_chromium.org, loading-reviews+fetch_chromium.org, loading-reviews_chromium.org, rwlbuis, sof, tyoshino+watch_chromium.org, Yoav Weiss
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Sending an async GET request for doc.written blocked scripts. BUG=639401 While fetching the original request, ScriptLoader sets a member flag. On receiving notifyFinished for the original request, HTMLScriptRunner creates a new ScriptLoader instance using the original Element with another flag set to true. It then calls ScriptLoader::prepareScript which further calls fetchScript. prepareScript sets the defer flag as LazyLoad and fetchScript sets the intervention info and header in the resource request. The intervention info is used to set the priority in ResourceFetcher::requestResource. This CL also adds a link in the dev tools console warning. Also added internals.getResourcePriority() for the layout test to test that the new request goes out with priority very low. The code was tested using netlog to verify the second request is sent and has the correct priority (net::IDLE). One of the example sites created by jkarlin@ is: http://www.karlin.me/test/docwrite/ Committed: https://crrev.com/57536eaf61f21cb9f6e351663ef75c3d6e09d705 Cr-Commit-Position: refs/heads/master@{#419476}

Patch Set 1 #

Patch Set 2 : updated code #

Patch Set 3 : layout tests console warning fixed #

Patch Set 4 : extra new lines removed #

Total comments: 6

Patch Set 5 : Test added #

Patch Set 6 : Test added and failing tests fixed. #

Patch Set 7 : Test added, failed bot tests fixed, converted to enum. #

Patch Set 8 : Test added, failed bot tests fixed, converted to enum. #

Total comments: 12

Patch Set 9 : Nate's feedback #

Total comments: 8

Patch Set 10 : Nate's feedback #

Patch Set 11 : variables renamed and comment added for better readability. #

Patch Set 12 : variables renamed and comment added for better readability. #

Patch Set 13 : Rebased. #

Total comments: 8

Patch Set 14 : Rebased till refs/heads/master@{#417978} #

Patch Set 15 : Feedback incorporated, new internal.GetResourcePriority API added for test. #

Patch Set 16 : Windows compile error for GetResourcePriority return type fixed. #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+158 lines, -29 lines) Patch
M third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block-all-conn-types-expected.txt View 1 2 1 chunk +4 lines, -4 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block-expected.txt View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -6 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-conn-type-expected.txt View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-reload-expected.txt View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ScriptLoader.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +17 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ScriptLoader.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +44 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FetchRequest.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +7 lines, -5 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +43 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameFetchContext.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +15 lines, -0 lines 1 comment Download
M third_party/WebKit/Source/core/testing/Internals.idl View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 1 comment Download

Messages

Total messages: 99 (64 generated)
shivanisha
4 years, 4 months ago (2016-08-19 20:50:23 UTC) #13
shivanisha
On 2016/08/19 at 20:50:23, shivanisha wrote: > PTAL, Thanks!
4 years, 4 months ago (2016-08-19 20:50:42 UTC) #14
Charlie Harrison
I'll let Nate sign off on the design portion. I left a few comments inline. ...
4 years, 4 months ago (2016-08-19 21:24:27 UTC) #15
shivanisha
On 2016/08/19 at 21:24:27, csharrison wrote: > I'll let Nate sign off on the design ...
4 years, 4 months ago (2016-08-22 16:13:46 UTC) #29
shivanisha
https://codereview.chromium.org/2260303002/diff/60001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h (right): https://codereview.chromium.org/2260303002/diff/60001/third_party/WebKit/Source/core/dom/ScriptLoader.h#newcode125 third_party/WebKit/Source/core/dom/ScriptLoader.h:125: bool m_disallowedFetchForDocWrittenScript : 1; // This script will be ...
4 years, 4 months ago (2016-08-22 16:15:22 UTC) #32
shivanisha
Haraken@, PTAL, Thanks!
4 years, 4 months ago (2016-08-22 17:48:29 UTC) #34
Nate Chapin
https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h (left): https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/dom/ScriptLoader.h#oldcode126 third_party/WebKit/Source/core/dom/ScriptLoader.h:126: Why these deletes? https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h (right): https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/dom/ScriptLoader.h#newcode42 third_party/WebKit/Source/core/dom/ScriptLoader.h:42: ...
4 years, 4 months ago (2016-08-22 19:47:03 UTC) #37
shivanisha
https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h (left): https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/dom/ScriptLoader.h#oldcode126 third_party/WebKit/Source/core/dom/ScriptLoader.h:126: On 2016/08/22 at 19:47:03, Nate Chapin wrote: > Why ...
4 years, 4 months ago (2016-08-22 20:44:00 UTC) #40
Nate Chapin
https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode166 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:166: priority = request.resourceRequest().computePriorityForInterventions(priority); On 2016/08/22 20:44:00, shivanisha wrote: > ...
4 years, 4 months ago (2016-08-22 20:55:12 UTC) #41
shivanisha
Removing haraken@ as reviewer since ResourceRequest.* will no longer have any code changes after incorporating ...
4 years, 4 months ago (2016-08-23 00:07:06 UTC) #45
haraken
+hiroshige for MemoryCache handling. https://codereview.chromium.org/2260303002/diff/160001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h (right): https://codereview.chromium.org/2260303002/diff/160001/third_party/WebKit/Source/core/dom/ScriptLoader.h#newcode91 third_party/WebKit/Source/core/dom/ScriptLoader.h:91: bool disallowedFetchForDocWrittenScript() { return m_documentWriteIntervention ...
4 years, 4 months ago (2016-08-23 00:30:39 UTC) #47
shivanisha
https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp File third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp (right): https://codereview.chromium.org/2260303002/diff/140001/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp#newcode166 third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp:166: priority = request.resourceRequest().computePriorityForInterventions(priority); On 2016/08/22 at 20:55:12, Nate Chapin ...
4 years, 4 months ago (2016-08-23 01:04:46 UTC) #50
shivanisha
https://codereview.chromium.org/2260303002/diff/160001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h (right): https://codereview.chromium.org/2260303002/diff/160001/third_party/WebKit/Source/core/dom/ScriptLoader.h#newcode91 third_party/WebKit/Source/core/dom/ScriptLoader.h:91: bool disallowedFetchForDocWrittenScript() { return m_documentWriteIntervention == DocumentWriteIntervention::DisallowedFetchForDocWrittenScript; } On ...
4 years, 4 months ago (2016-08-24 17:47:40 UTC) #53
shivanisha
Thanks all, for the feedback. I have incorporated/responded to all the feedback. PTAL, thanks!
4 years, 4 months ago (2016-08-24 17:54:07 UTC) #54
haraken
On 2016/08/24 17:47:40, shivanisha wrote: > https://codereview.chromium.org/2260303002/diff/160001/third_party/WebKit/Source/core/dom/ScriptLoader.h > File third_party/WebKit/Source/core/dom/ScriptLoader.h (right): > > https://codereview.chromium.org/2260303002/diff/160001/third_party/WebKit/Source/core/dom/ScriptLoader.h#newcode91 > ...
4 years, 4 months ago (2016-08-25 01:20:59 UTC) #55
shivanisha
On 2016/08/25 at 01:20:59, haraken wrote: > On 2016/08/24 17:47:40, shivanisha wrote: > > https://codereview.chromium.org/2260303002/diff/160001/third_party/WebKit/Source/core/dom/ScriptLoader.h ...
4 years, 3 months ago (2016-08-25 15:37:16 UTC) #62
shivanisha
The layout tests are failing after rebasing. The test function that they used testRunner.dumpResourceRequestPriorities has ...
4 years, 3 months ago (2016-09-01 18:58:04 UTC) #69
shivanisha
On 2016/09/01 at 18:58:04, shivanisha wrote: > The layout tests are failing after rebasing. The ...
4 years, 3 months ago (2016-09-06 16:56:17 UTC) #70
Nate Chapin
LGTM, just a couple nitpicks. https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html File third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html (right): https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html#newcode84 third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html:84: if (window.testRunner) { This ...
4 years, 3 months ago (2016-09-06 20:28:13 UTC) #71
shivanisha
https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html File third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html (right): https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html#newcode84 third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html:84: if (window.testRunner) { On 2016/09/06 at 20:28:12, Nate Chapin ...
4 years, 3 months ago (2016-09-06 20:31:25 UTC) #72
Nate Chapin
On 2016/09/06 20:31:25, shivanisha wrote: > https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html > File > third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html > (right): > > ...
4 years, 3 months ago (2016-09-06 20:41:47 UTC) #73
haraken
https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h (right): https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/Source/core/dom/ScriptLoader.h#newcode137 third_party/WebKit/Source/core/dom/ScriptLoader.h:137: FetchDocWrittenScriptDeferIdle, FetchDocWrittenScriptInIdleTask ? https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp File third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp (right): https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp#newcode279 third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp:279: ...
4 years, 3 months ago (2016-09-07 01:47:36 UTC) #74
shivanisha
On 2016/09/06 at 20:41:47, japhet wrote: > On 2016/09/06 20:31:25, shivanisha wrote: > > https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/LayoutTests/http/tests/loading/doc-write-sync-third-party-script-block.html ...
4 years, 3 months ago (2016-09-12 20:17:22 UTC) #75
Nate Chapin
On 2016/09/12 20:17:22, shivanisha wrote: > On 2016/09/06 at 20:41:47, japhet wrote: > > On ...
4 years, 3 months ago (2016-09-12 21:02:22 UTC) #76
shivanisha
On 2016/09/12 at 21:02:22, japhet wrote: > On 2016/09/12 20:17:22, shivanisha wrote: > > On ...
4 years, 3 months ago (2016-09-13 16:48:19 UTC) #77
Nate Chapin
On 2016/09/13 16:48:19, shivanisha wrote: > On 2016/09/12 at 21:02:22, japhet wrote: > > On ...
4 years, 3 months ago (2016-09-13 22:38:47 UTC) #78
shivanisha
On 2016/09/13 at 22:38:47, japhet wrote: > On 2016/09/13 16:48:19, shivanisha wrote: > > On ...
4 years, 3 months ago (2016-09-14 00:13:58 UTC) #79
Nate Chapin
On 2016/09/14 00:13:58, shivanisha wrote: > On 2016/09/13 at 22:38:47, japhet wrote: > > On ...
4 years, 3 months ago (2016-09-14 19:36:25 UTC) #80
shivanisha
On 2016/09/14 at 19:36:25, japhet wrote: > On 2016/09/14 00:13:58, shivanisha wrote: > > On ...
4 years, 3 months ago (2016-09-14 19:45:07 UTC) #81
shivanisha
On 2016/09/14 at 19:45:07, shivanisha wrote: > On 2016/09/14 at 19:36:25, japhet wrote: > > ...
4 years, 3 months ago (2016-09-14 20:43:03 UTC) #82
shivanisha
The new patch adds a new internal.GetResourcePriority for testing and addresses feedback. https://codereview.chromium.org/2260303002/diff/240001/third_party/WebKit/Source/core/dom/ScriptLoader.h File third_party/WebKit/Source/core/dom/ScriptLoader.h ...
4 years, 3 months ago (2016-09-15 20:35:08 UTC) #85
Nate Chapin
LGTM with a couple of nits. https://codereview.chromium.org/2260303002/diff/300001/third_party/WebKit/Source/core/testing/Internals.cpp File third_party/WebKit/Source/core/testing/Internals.cpp (right): https://codereview.chromium.org/2260303002/diff/300001/third_party/WebKit/Source/core/testing/Internals.cpp#newcode419 third_party/WebKit/Source/core/testing/Internals.cpp:419: Resource* resource = ...
4 years, 3 months ago (2016-09-16 21:37:53 UTC) #92
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2260303002/300001
4 years, 3 months ago (2016-09-19 15:07:37 UTC) #96
commit-bot: I haz the power
Committed patchset #16 (id:300001)
4 years, 3 months ago (2016-09-19 16:19:07 UTC) #97
commit-bot: I haz the power
4 years, 3 months ago (2016-09-19 16:21:24 UTC) #99
Message was sent while issue was closed.
Patchset 16 (id:??) landed as
https://crrev.com/57536eaf61f21cb9f6e351663ef75c3d6e09d705
Cr-Commit-Position: refs/heads/master@{#419476}

Powered by Google App Engine
This is Rietveld 408576698