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

Issue 1704693002: [SVG 2/5] Do not reload FontResource created by resourceForStaticData()

Created:
4 years, 10 months ago by hiroshige
Modified:
4 years, 8 months ago
CC:
chromium-reviews, blink-reviews, loading-reviews+fetch_chromium.org, tyoshino+watch_chromium.org, gavinp+loader_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@Loader_SVGImage_Fix1
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not reload FontResource created by resourceForStaticData() There are cases where FontResource::checkNotify() is called without calling FontResource::load(), e.g. when FontResource is created by ResourceFetcher::resourceForStaticData(). In such cases, loading is no longer needed, but FontResource::stillNeedsLoad() remains true after checkNotify() and thus FontResource is reloaded. This CL sets |FontResource::m_state| to LoadInitiated in checkNotify() and thus prevents subsequent FontResource::load() calls. This CL is [2/5] to load FontResource of data: URLs synchronously so that all subresource loading of SVG image completes before loading of the SVG file: [1/5] Make fonts with data: URLs to be served by resourceForStaticData(). https://codereview.chromium.org/1700233003/ [2/5] Do not reload FontResource created by resourceForStaticData(). https://codereview.chromium.org/1704693002/ (This CL) [3/5] Make invalid data: URLs to be served by resourceForStaticData(). https://codereview.chromium.org/1707013002/ [4/5] Add layout tests. https://codereview.chromium.org/1699323002/ [5/5] Check SVG's subresource load completion in ImageLoader::notifyFinished(). https://codereview.chromium.org/1515963005/ BUG=382170

Patch Set 1 #

Patch Set 2 : Fix tests. #

Patch Set 3 : #

Patch Set 4 : #

Total comments: 6

Patch Set 5 : Rebase. Fix comments. #

Patch Set 6 : auto-Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -5 lines) Patch
M third_party/WebKit/LayoutTests/fast/css/fontfaceset-download-error-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/css/fontfaceset-download-error-expected.txt View 1 2 3 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/fast/css/fontfaceset-download-error-expected.txt View 1 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/fetch/FontResource.cpp View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download

Messages

Total messages: 36 (18 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1704693002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1704693002/1
4 years, 10 months ago (2016-02-16 22:16:34 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/181805)
4 years, 10 months ago (2016-02-16 23:28:47 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1704693002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1704693002/20001
4 years, 10 months ago (2016-02-17 00:09:28 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-17 01:31:49 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1704693002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1704693002/40001
4 years, 9 months ago (2016-02-29 19:46:40 UTC) #15
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/181466)
4 years, 9 months ago (2016-02-29 20:23:41 UTC) #17
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1704693002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1704693002/60001
4 years, 9 months ago (2016-02-29 21:53:52 UTC) #19
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-02-29 23:59:24 UTC) #21
hiroshige
PTAL.
4 years, 9 months ago (2016-03-01 18:46:21 UTC) #24
Nate Chapin
lgtm https://codereview.chromium.org/1704693002/diff/60001/third_party/WebKit/Source/core/fetch/FontResource.cpp File third_party/WebKit/Source/core/fetch/FontResource.cpp (right): https://codereview.chromium.org/1704693002/diff/60001/third_party/WebKit/Source/core/fetch/FontResource.cpp#newcode198 third_party/WebKit/Source/core/fetch/FontResource.cpp:198: // example when the FontResource is created by ...
4 years, 9 months ago (2016-03-01 19:17:29 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1704693002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1704693002/80001
4 years, 9 months ago (2016-03-01 20:24:52 UTC) #27
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/189700)
4 years, 9 months ago (2016-03-01 21:34:09 UTC) #29
hiroshige
+ksakamoto@, could you take another look at this change to state management in FontResource? https://codereview.chromium.org/1704693002/diff/60001/third_party/WebKit/Source/core/fetch/FontResource.cpp ...
4 years, 9 months ago (2016-03-01 22:11:52 UTC) #31
Kunihiko Sakamoto
Hmm, so FontResource::checkNotify() can be called even if beginLoadIfNeeded() isn't called... Wouldn't this break the ...
4 years, 9 months ago (2016-03-02 03:17:49 UTC) #32
hiroshige
On 2016/03/02 03:17:49, Kunihiko Sakamoto wrote: > Hmm, so FontResource::checkNotify() can be called even if ...
4 years, 9 months ago (2016-03-02 06:24:39 UTC) #33
Kunihiko Sakamoto
On 2016/03/02 06:24:39, hiroshige wrote: > On 2016/03/02 03:17:49, Kunihiko Sakamoto wrote: > > Hmm, ...
4 years, 9 months ago (2016-03-02 09:54:37 UTC) #34
hiroshige
On 2016/03/02 09:54:37, Kunihiko Sakamoto wrote: > On 2016/03/02 06:24:39, hiroshige wrote: > > On ...
4 years, 9 months ago (2016-03-03 01:57:59 UTC) #35
Nate Chapin
4 years, 9 months ago (2016-03-23 18:04:26 UTC) #36
On 2016/03/03 01:57:59, hiroshige wrote:
> On 2016/03/02 09:54:37, Kunihiko Sakamoto wrote:
> > On 2016/03/02 06:24:39, hiroshige wrote:
> > > On 2016/03/02 03:17:49, Kunihiko Sakamoto wrote:
> > > > Hmm, so FontResource::checkNotify() can be called even if
> > beginLoadIfNeeded()
> > > > isn't called...
> > > > Wouldn't this break the laziness of WebFont loading?
> > > > 
> > > > <!doctype html>
> > > > <style>
> > > > @font-face {
> > > >    font-family: Unused;
> > > >    src:url("data:font/ttf,");
> > > > }
> > > > </style>
> > > > // The data URL shouldn't be fetched
> > > 
> > > Current implementation:
> > >   data URL is parsed and converted to WebData
> > >   when ResourceFetcher::requestResource() is called (i.e. around when
> > > FontResource::load() is called).
> > > 
> > > After [1/5] https://codereview.chromium.org/1700233003/:
> > >   data URL is parsed and converted to WebData, and Resource::finish() etc.
> are
> > > called
> > >   when ResourceFetcher::requestResource() is called.
> > >   (See ResourceFetcher::resourceForStaticData() around
> > >   
> > >
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit...
> > >   )
> > > 
> > > Should we also delay some (or all) of these to the timing when
> > > beginLoadIfNeeded()/Resource::load() is actually called?
> > 
> > FontResource::checkNotify() calls RemoteFontFaceSource::fontLoaded(), which
> > starts decoding the font. At least we should delay that until the font is
> > actually requested (i.e. beginLoadIfNeeded() called).
> > 
> > Also, I see unused webfonts with data URL appear on devtools network tab,
> > locally applying [1/5] and [2/5]. I'm not sure what's triggering this.
> 
> Thanks. I'm rewriting CLs to defer FontResource::checkNotify() calls.
> I'll restart reviews when ready. Probably this CL will be unnecessary and
> closed.

BTW, I think this will be fixed by https://codereview.chromium.org/1802123002/,
which unifies FontResource's definition of needing load with Resource's
definition.

Powered by Google App Engine
This is Rietveld 408576698