Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(33)

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed)

Created:
4 years, 11 months ago by Nate Chapin
Modified:
4 years, 10 months ago
Reviewers:
Yoav Weiss, sof, Mike West
CC:
darktears, apavlov+blink_chromium.org, arv+blink, blink-reviews, blink-reviews-bindings_chromium.org, blink-reviews-css, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, blink-reviews-style_chromium.org, caseq+blink_chromium.org, devtools-reviews_chromium.org, dglazkov+blink, krit, eae+blinkwatch, eric.carlson_apple.com, f(malita), fs, gavinp+loader_chromium.org, gavinp+prerender_chromium.org, gasubic, gyuyoung2, kouhei+svg_chromium.org, kozyatinskiy+blink_chromium.org, lushnikov+blink_chromium.org, oilpan-reviews, pdr+svgwatchlist_chromium.org, pfeldman+blink_chromium.org, philipj_slow, rwlbuis, Stephen Chennney, sergeyv+blink_chromium.org, sof, nessy, tyoshino+watch_chromium.org, vcarbune.chromium, vivekg_samsung, vivekg, webcomponents-bugzilla_chromium.org, yurys+blink_chromium.org
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Remove resource type-specific fetching logic from ResourceFetcher Instead of having a whole bunch of ResourceFetcher::fetchFoo() functions, start a fetch by calling FooResource::fetch(). This allows ResourceFetcher to just have generic loading logic, and puts all of the specific logic for a given type in one place. This requires adding a ResourceFactory class hierarchy, which allows ResourceFetcher to create the proper Resource subclass simply by calling ResourceFactory::create. BUG=458222 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=197145

Patch Set 1 #

Total comments: 4

Patch Set 2 : Address yoav's comments #

Patch Set 3 : Null-check Document::loader() before calling startPreload() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+495 lines, -353 lines) Patch
M Source/bindings/core/v8/ScriptStreamerTest.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/bindings/core/v8/V8ScriptRunnerTest.cpp View 5 chunks +6 lines, -6 lines 0 comments Download
M Source/core/core.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/css/CSSFontFaceSrcValue.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSImageSetValue.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSImageValue.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/CSSSVGDocumentValue.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/css/StyleRuleImport.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/ProcessingInstruction.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/dom/ScriptLoader.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/fetch/CSSStyleSheetResource.h View 1 2 chunks +16 lines, -1 line 0 comments Download
M Source/core/fetch/CSSStyleSheetResource.cpp View 1 2 chunks +9 lines, -0 lines 0 comments Download
M Source/core/fetch/CachingCorrectnessTest.cpp View 1 2 3 chunks +4 lines, -3 lines 0 comments Download
M Source/core/fetch/DocumentResource.h View 2 chunks +15 lines, -1 line 0 comments Download
M Source/core/fetch/DocumentResource.cpp View 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/fetch/FetchContext.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/fetch/FontResource.h View 4 chunks +15 lines, -2 lines 0 comments Download
M Source/core/fetch/FontResource.cpp View 2 chunks +9 lines, -0 lines 0 comments Download
M Source/core/fetch/ImageResource.h View 3 chunks +17 lines, -1 line 0 comments Download
M Source/core/fetch/ImageResource.cpp View 1 chunk +49 lines, -0 lines 0 comments Download
M Source/core/fetch/ImageResourceTest.cpp View 1 2 4 chunks +4 lines, -4 lines 0 comments Download
A Source/core/fetch/LinkFetchResource.h View 1 chunk +41 lines, -0 lines 0 comments Download
A Source/core/fetch/LinkFetchResource.cpp View 1 chunk +32 lines, -0 lines 0 comments Download
M Source/core/fetch/RawResource.h View 2 chunks +23 lines, -0 lines 0 comments Download
M Source/core/fetch/RawResource.cpp View 1 chunk +71 lines, -0 lines 0 comments Download
M Source/core/fetch/Resource.h View 3 chunks +13 lines, -0 lines 0 comments Download
M Source/core/fetch/ResourceFetcher.h View 4 chunks +8 lines, -23 lines 0 comments Download
M Source/core/fetch/ResourceFetcher.cpp View 1 18 chunks +27 lines, -266 lines 0 comments Download
M Source/core/fetch/ResourceFetcherTest.cpp View 2 chunks +14 lines, -3 lines 0 comments Download
M Source/core/fetch/ScriptResource.h View 3 chunks +15 lines, -5 lines 0 comments Download
M Source/core/fetch/ScriptResource.cpp View 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/fetch/XSLStyleSheetResource.h View 1 chunk +16 lines, -1 line 0 comments Download
M Source/core/fetch/XSLStyleSheetResource.cpp View 1 chunk +9 lines, -0 lines 0 comments Download
M Source/core/html/HTMLLinkElement.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/imports/HTMLImportsController.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/HTMLResourcePreloader.cpp View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M Source/core/inspector/InspectorResourceContentLoader.cpp View 1 2 chunks +2 lines, -2 lines 0 comments Download
M Source/core/loader/DocumentLoader.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/loader/DocumentLoader.cpp View 1 2 3 chunks +20 lines, -1 line 0 comments Download
M Source/core/loader/DocumentThreadableLoader.cpp View 2 chunks +3 lines, -3 lines 0 comments Download
M Source/core/loader/FrameFetchContext.h View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/loader/FrameFetchContext.cpp View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/loader/ImageLoader.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/loader/LinkLoader.cpp View 3 chunks +3 lines, -2 lines 0 comments Download
M Source/core/loader/TextTrackLoader.cpp View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/svg/SVGFEImageElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/svg/SVGUseElement.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/XSLImportRule.cpp View 1 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/xml/XSLTProcessorLibxslt.cpp View 1 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/xml/parser/XMLDocumentParser.cpp View 2 chunks +2 lines, -1 line 0 comments Download
M Source/web/tests/WebFrameTest.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 24 (11 generated)
Nate Chapin
I think this change is worthwhile on its own. However, it also gives us the ...
4 years, 11 months ago (2015-06-05 17:21:30 UTC) #2
Mike West
I like this change. I want to skim it a bit more to make sure ...
4 years, 10 months ago (2015-06-07 15:37:14 UTC) #4
Yoav Weiss
https://codereview.chromium.org/1170503003/diff/1/Source/core/html/parser/HTMLResourcePreloader.cpp File Source/core/html/parser/HTMLResourcePreloader.cpp (right): https://codereview.chromium.org/1170503003/diff/1/Source/core/html/parser/HTMLResourcePreloader.cpp#newcode78 Source/core/html/parser/HTMLResourcePreloader.cpp:78: Can't say that I like adding all that resource ...
4 years, 10 months ago (2015-06-08 06:44:18 UTC) #6
sof
ResourcePtr<> (and ResourceOwner<>) aren't first-class Oilpan abstractions, as they do keep around references that aren't ...
4 years, 10 months ago (2015-06-08 13:08:46 UTC) #8
Mike West
LGTM % Yoav's comments. I agree that there's some tension between teaching all of core/ ...
4 years, 10 months ago (2015-06-08 18:44:31 UTC) #9
Nate Chapin
https://codereview.chromium.org/1170503003/diff/1/Source/core/html/parser/HTMLResourcePreloader.cpp File Source/core/html/parser/HTMLResourcePreloader.cpp (right): https://codereview.chromium.org/1170503003/diff/1/Source/core/html/parser/HTMLResourcePreloader.cpp#newcode78 Source/core/html/parser/HTMLResourcePreloader.cpp:78: On 2015/06/08 06:44:18, Yoav Weiss wrote: > Can't say ...
4 years, 10 months ago (2015-06-08 19:01:22 UTC) #10
Yoav Weiss
On 2015/06/08 19:01:22, Nate Chapin wrote: > https://codereview.chromium.org/1170503003/diff/1/Source/core/html/parser/HTMLResourcePreloader.cpp > File Source/core/html/parser/HTMLResourcePreloader.cpp (right): > > https://codereview.chromium.org/1170503003/diff/1/Source/core/html/parser/HTMLResourcePreloader.cpp#newcode78 ...
4 years, 10 months ago (2015-06-09 06:04:30 UTC) #11
Nate Chapin
Ok, I moved the Resource creation portion of preloading to DocumentLoader. It's not a perfect ...
4 years, 10 months ago (2015-06-09 18:39:56 UTC) #12
Nate Chapin
On 2015/06/09 18:39:56, Nate Chapin wrote: > Ok, I moved the Resource creation portion of ...
4 years, 10 months ago (2015-06-15 18:09:35 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1170503003/20001
4 years, 10 months ago (2015-06-15 18:10:30 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/66677)
4 years, 10 months ago (2015-06-15 20:08:24 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1170503003/40001
4 years, 10 months ago (2015-06-15 22:37:30 UTC) #23
commit-bot: I haz the power
4 years, 10 months ago (2015-06-15 23:39:29 UTC) #24
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=197145

Powered by Google App Engine
This is Rietveld 408576698