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

Side by Side Diff: Source/core/css/CSSCustomFontData.h

Issue 171823002: Make text visible when font loading takes longer than 3 seconds (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google, Inc. 2 * Copyright (C) 2013 Google, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 10 matching lines...) Expand all
21 #ifndef CSSCustomFontData_h 21 #ifndef CSSCustomFontData_h
22 #define CSSCustomFontData_h 22 #define CSSCustomFontData_h
23 23
24 #include "core/css/CSSFontFaceSource.h" 24 #include "core/css/CSSFontFaceSource.h"
25 #include "platform/fonts/CustomFontData.h" 25 #include "platform/fonts/CustomFontData.h"
26 26
27 namespace WebCore { 27 namespace WebCore {
28 28
29 class CSSCustomFontData FINAL : public CustomFontData { 29 class CSSCustomFontData FINAL : public CustomFontData {
30 public: 30 public:
31 static PassRefPtr<CSSCustomFontData> create(bool isLoadingFallback = false) 31 static PassRefPtr<CSSCustomFontData> create(bool isLoadingFallback = false, FallbackVisibility visibility = VisibleFallback)
32 { 32 {
33 return adoptRef(new CSSCustomFontData(isLoadingFallback)); 33 return adoptRef(new CSSCustomFontData(isLoadingFallback, visibility));
34 } 34 }
35 35
36 virtual ~CSSCustomFontData() { } 36 virtual ~CSSCustomFontData() { }
37 37
38 virtual void beginLoadIfNeeded() const OVERRIDE 38 virtual void beginLoadIfNeeded() const OVERRIDE
39 { 39 {
40 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) { 40 if (!m_isUsed && m_isLoadingFallback && m_fontFaceSource) {
41 m_isUsed = true; 41 m_isUsed = true;
42 m_fontFaceSource->beginLoadIfNeeded(); 42 m_fontFaceSource->beginLoadIfNeeded();
43 } 43 }
44 } 44 }
45 45
46 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo ntFaceSource = source; } 46 virtual void setCSSFontFaceSource(CSSFontFaceSource* source) OVERRIDE { m_fo ntFaceSource = source; }
47 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; } 47 virtual void clearCSSFontFaceSource() OVERRIDE { m_fontFaceSource = 0; }
48 48
49 private: 49 private:
50 CSSCustomFontData(bool isLoadingFallback) 50 CSSCustomFontData(bool isLoadingFallback, FallbackVisibility visibility)
51 : CustomFontData(isLoadingFallback) 51 : CustomFontData(isLoadingFallback, visibility)
52 , m_fontFaceSource(0) 52 , m_fontFaceSource(0)
53 { 53 {
54 } 54 }
55 55
56 CSSFontFaceSource* m_fontFaceSource; 56 CSSFontFaceSource* m_fontFaceSource;
57 }; 57 };
58 58
59 } 59 }
60 60
61 #endif // CSSCustomFontData_h 61 #endif // CSSCustomFontData_h
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/webfont/slow-loading-expected.html ('k') | Source/core/css/CSSFontFace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698