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

Issue 1976463003: Preload scan external CSS for @import (Closed)

Created:
4 years, 7 months ago by Charlie Harrison
Modified:
4 years, 3 months ago
CC:
chromium-reviews, tyoshino+watch_chromium.org, blink-reviews-style_chromium.org, tfarina, blink-reviews-html_chromium.org, Yoav Weiss, dglazkov+blink, gavinp+loader_chromium.org, blink-reviews, loading-reviews+fetch_chromium.org, kinuko+watch, blink-reviews-api_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Preload scan external CSS for @import This change adds a StyleSheetResourceClient on all CSS preloads. The client holds a CSSPreloadScanner which receives the stream of CSS as it comes in. This is guarded by two Blink settings, cssExternalScannerPreload and cssExternalScannerNoPreload. The former allows for scanning and preloading and the latter just allows for scanning, as a baseline for the overhead of the feature. This is partially a reland of https://codereview.chromium.org/1819593002, which was reverted manually here: https://codereview.chromium.org/1947053002/ The revert was due to a crash and some faulty logic with regard to all css preload requests being considered "referenced". This CL attempts to fix that by adding an enum to mark a ResourceClient as "passive". BUG=610437, 596676 Committed: https://crrev.com/c016ef022ac17d029d61bc79d8a8996c053556f3 Cr-Commit-Position: refs/heads/master@{#414756}

Patch Set 1 #

Patch Set 2 : actually include crasher fix #

Total comments: 16

Patch Set 3 : Address hiroshige@ and add unit tests per japhet@ #

Patch Set 4 : fix up layout tests #

Patch Set 5 : rebase on 406333 #

Patch Set 6 : preload @import #

Total comments: 8

Patch Set 7 : respond to hiroshige@ comments #

Patch Set 8 : add CORE_EXPORT to StyleSheetResourceClient #

Total comments: 1

Patch Set 9 : rebase + minor style tweaks #

Unified diffs Side-by-side diffs Delta from patch set Stats (+345 lines, -14 lines) Patch
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/preload/external_css_import_no_scanning.html View 1 2 3 1 chunk +21 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/preload/external_css_import_preload.html View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/preload/external_css_import_scan_only.html View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/resources/css_with_import.css View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp View 1 2 3 4 5 6 7 8 3 chunks +17 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/ImageResource.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.h View 1 2 3 4 5 6 7 8 3 chunks +12 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/Resource.cpp View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/ResourceOwner.h View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/StyleSheetResourceClient.h View 1 2 3 4 5 6 7 3 chunks +7 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/Settings.in View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.h View 1 2 3 4 5 6 7 2 chunks +31 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp View 1 2 3 4 5 6 7 8 2 chunks +70 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp View 1 2 3 4 5 6 1 chunk +83 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.h View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp View 1 2 3 4 5 6 7 8 3 chunks +17 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/DocumentLoader.cpp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/WebLoadingBehaviorFlag.h View 1 chunk +3 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 68 (40 generated)
Charlie Harrison
hiroshige@, can you take a look please? I did the easiest thing possible to add ...
4 years, 7 months ago (2016-05-12 22:31:01 UTC) #3
hiroshige
On 2016/05/12 22:31:01, csharrison wrote: > hiroshige@, can you take a look please? > > ...
4 years, 7 months ago (2016-05-13 17:35:34 UTC) #4
Charlie Harrison
On 2016/05/13 17:35:34, hiroshige wrote: > On 2016/05/12 22:31:01, csharrison wrote: > > hiroshige@, can ...
4 years, 7 months ago (2016-05-13 18:03:04 UTC) #5
hiroshige
Let me clarify the context for this CL: The original CL [1] was landed but ...
4 years, 7 months ago (2016-05-17 15:26:23 UTC) #6
Charlie Harrison
On 2016/05/17 15:26:23, hiroshige wrote: > Let me clarify the context for this CL: > ...
4 years, 7 months ago (2016-05-17 15:29:12 UTC) #7
Charlie Harrison
+japhet I had some trouble writing up a test that kills the resource client before ...
4 years, 7 months ago (2016-05-23 18:09:39 UTC) #10
Nate Chapin
On 2016/05/23 18:09:39, csharrison wrote: > +japhet > I had some trouble writing up a ...
4 years, 6 months ago (2016-06-10 19:00:10 UTC) #11
hiroshige
Sorry for my slow response. https://codereview.chromium.org/1976463003/diff/20001/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h File third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h (right): https://codereview.chromium.org/1976463003/diff/20001/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h#newcode53 third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.h:53: void didAddClient(ResourceClient*) override; We ...
4 years, 6 months ago (2016-06-17 12:15:17 UTC) #12
Charlie Harrison
And sorry for my even slower response :) In order to make the resource client ...
4 years, 5 months ago (2016-07-13 18:18:14 UTC) #13
Charlie Harrison
friendly ping
4 years, 5 months ago (2016-07-25 16:30:28 UTC) #24
hiroshige
core/fetch part basically looks good. +oilpan-reviews for a question in CSSStyleSheetResource.cpp (see the comment). https://codereview.chromium.org/1976463003/diff/100001/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp ...
4 years, 4 months ago (2016-07-26 09:57:10 UTC) #32
haraken
https://codereview.chromium.org/1976463003/diff/100001/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp File third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp (right): https://codereview.chromium.org/1976463003/diff/100001/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp#newcode85 third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp:85: static_cast<StyleSheetResourceClient*>(c)->didAppendFirstData(this); On 2016/07/26 09:57:10, hiroshige wrote: > |*c| must ...
4 years, 4 months ago (2016-07-26 10:01:06 UTC) #34
Charlie Harrison
Thanks!! https://codereview.chromium.org/1976463003/diff/100001/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp File third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp (right): https://codereview.chromium.org/1976463003/diff/100001/third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp#newcode87 third_party/WebKit/Source/core/fetch/CSSStyleSheetResource.cpp:87: if (!isLoading()) On 2016/07/26 09:57:10, hiroshige wrote: > ...
4 years, 4 months ago (2016-07-26 16:31:52 UTC) #37
Charlie Harrison
hiroshige, friendly ping :)
4 years, 4 months ago (2016-08-01 21:59:08 UTC) #40
hiroshige
core/fetch non-OWNER lgtm. Particularly, I'm not sure about core/html/parser part. Some bots are red and ...
4 years, 4 months ago (2016-08-03 18:42:53 UTC) #41
Charlie Harrison
Thanks hiroshige. I added CORE_EXPORT to StyleSheetResourceClient, let's see what bots think. japhet@, mind doing ...
4 years, 4 months ago (2016-08-03 22:55:17 UTC) #44
Charlie Harrison
japhet@, friendly ping
4 years, 4 months ago (2016-08-10 13:24:53 UTC) #47
Nate Chapin
core/fetch/ LGTM, I'll defer to others on the parser bits.
4 years, 3 months ago (2016-08-25 18:41:50 UTC) #48
Charlie Harrison
Thanks! Note there are some fetchy things in the parser code (like ResourceClients), so you ...
4 years, 3 months ago (2016-08-25 18:44:00 UTC) #50
Charlie Harrison
https://codereview.chromium.org/1976463003/diff/140001/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp File third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp (right): https://codereview.chromium.org/1976463003/diff/140001/third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp#newcode278 third_party/WebKit/Source/core/html/parser/CSSPreloadScanner.cpp:278: const String& chunk = resource->decodedText(); Let's add UMA here ...
4 years, 3 months ago (2016-08-26 04:16:37 UTC) #51
haraken
Oilpan part LGTM
4 years, 3 months ago (2016-08-26 04:36:13 UTC) #52
kouhei (in TOK)
core lgtm
4 years, 3 months ago (2016-08-26 06:11:09 UTC) #53
Charlie Harrison
Thanks everyone. I think I also need sign off for the changes to public/platform. +japhet ...
4 years, 3 months ago (2016-08-26 12:15:55 UTC) #55
Nate Chapin
public/platform LGTM
4 years, 3 months ago (2016-08-26 18:07:27 UTC) #60
Charlie Harrison
Thanks, everyone! Sorry for all the delays in landing this :/
4 years, 3 months ago (2016-08-26 18:08:28 UTC) #61
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/1976463003/160001
4 years, 3 months ago (2016-08-26 18:09:37 UTC) #64
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 3 months ago (2016-08-26 18:30:27 UTC) #66
commit-bot: I haz the power
4 years, 3 months ago (2016-08-26 18:33:05 UTC) #68
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/c016ef022ac17d029d61bc79d8a8996c053556f3
Cr-Commit-Position: refs/heads/master@{#414756}

Powered by Google App Engine
This is Rietveld 408576698