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

Issue 2550663002: Allow creating font data while FontResource is revalidating (Closed)

Created:
4 years ago by Kunihiko Sakamoto
Modified:
3 years, 10 months ago
CC:
chromium-reviews, blink-reviews, Takashi Toyoshima
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Allow creating font data while FontResource is revalidating Before this patch, RemoteFontFaceSource::createFontData() returned a blank fontdata ("loading fallback" fontdata) whenever FontResource::isLoaded() is false. However, FontResource once loaded can go back to "loading" state by resource revalidation. This caused a bug where webfonts are not displayed when loaded in one frame and immediately revalidated in another frame. After this change, existing RemoteFontFaceSource returns fontdata from FontResource, even while it is being revalidated by other RemoteFontFaceSource instances. BUG=602968, 652974, 692574

Patch Set 1 #

Patch Set 2 : Allow to create font data while revalidating #

Patch Set 3 : rebase #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -1 line) Patch
A third_party/WebKit/LayoutTests/http/tests/webfont/font-face-revalidation.html View 1 chunk +26 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/webfont/font-face-revalidation-expected.html View 1 chunk +6 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp View 1 2 1 chunk +1 line, -1 line 2 comments Download
M third_party/WebKit/Source/core/loader/resource/FontResource.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 16 (11 generated)
Kunihiko Sakamoto
3 years, 10 months ago (2017-02-22 09:08:27 UTC) #11
Takashi Toyoshima
https://codereview.chromium.org/2550663002/diff/40001/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp File third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp (right): https://codereview.chromium.org/2550663002/diff/40001/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp#newcode209 third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp:209: if (!isLoaded() && !m_font->hasCustomFontData()) Should we still have the ...
3 years, 10 months ago (2017-02-23 03:21:37 UTC) #13
hiroshige
[1] I feel like |FontResource::m_fontData| is not updated on revalidation and thus revalidation on FontResource ...
3 years, 10 months ago (2017-02-23 18:35:27 UTC) #14
hiroshige
On 2017/02/23 18:35:27, hiroshige wrote: > [1] I feel like |FontResource::m_fontData| is not updated on ...
3 years, 10 months ago (2017-02-23 18:41:13 UTC) #15
Kunihiko Sakamoto
3 years, 10 months ago (2017-02-24 08:31:57 UTC) #16
On 2017/02/23 18:41:13, hiroshige wrote:
> On 2017/02/23 18:35:27, hiroshige wrote:
> > [1] I feel like |FontResource::m_fontData| is not updated on revalidation
and
> > thus revalidation on FontResource has virtually no effect.
> > 
> > [2] If we fix [1], then |m_fontData| is null during revalidation (after
> > responseReceived() and before finish(), or when revalidation response is
> error),
> > and thus this CL doen't work in such cases.
> > In the case of FontResource, if we are not interested in
updates/revalidations
> > after notifyFinished(), then we should receive the decoded data from
> > FontResource in notifyFinished() and never access FontResource after that
> point,
> > i.e.,
> > - make FontCustomPlatformData RefCounted,
> > - make RemoteFontFaceSource to get RefPtr<FontCustomPlatformData> and
> > - use it in RemoteFontFaceSource::createFontData().
> > 
> > FYI. ScriptResource might have a similar? issue under investigation (see
> > https://codereview.chromium.org/2706303002/).
> 
> If we want to have a quick and mergeable fix, then the direction of this
current
> CL looks good.
> [1] is already broken, so this CL just allows use of
|FontResource::m_fontData|
> for an additional short period of time (between responseReceived() and
> finish()), which doesn't weaken security fundamentally.

Your suggestion [2] sounds like the right way to fix this.
I didn't intend to merge this, so let me close this and create a new CL for [2].

Thanks!

Powered by Google App Engine
This is Rietveld 408576698