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

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

Issue 23717059: [Font Load Events] Implement FontFaceSet methods (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 20 matching lines...) Expand all
31 #include "wtf/PassRefPtr.h" 31 #include "wtf/PassRefPtr.h"
32 #include "wtf/RefCounted.h" 32 #include "wtf/RefCounted.h"
33 #include "wtf/Vector.h" 33 #include "wtf/Vector.h"
34 34
35 namespace WebCore { 35 namespace WebCore {
36 36
37 class CSSFontFace; 37 class CSSFontFace;
38 class CSSFontSelector; 38 class CSSFontSelector;
39 class FontData; 39 class FontData;
40 class FontDescription; 40 class FontDescription;
41 class FontFace;
41 class SegmentedFontData; 42 class SegmentedFontData;
42 43
43 class CSSSegmentedFontFace : public RefCounted<CSSSegmentedFontFace> { 44 class CSSSegmentedFontFace : public RefCounted<CSSSegmentedFontFace> {
44 public: 45 public:
45 static PassRefPtr<CSSSegmentedFontFace> create(CSSFontSelector* selector, Fo ntTraitsMask traitsMask, bool isLocalFallback) { return adoptRef(new CSSSegmente dFontFace(selector, traitsMask, isLocalFallback)); } 46 static PassRefPtr<CSSSegmentedFontFace> create(CSSFontSelector* selector, Fo ntTraitsMask traitsMask, bool isLocalFallback) { return adoptRef(new CSSSegmente dFontFace(selector, traitsMask, isLocalFallback)); }
46 ~CSSSegmentedFontFace(); 47 ~CSSSegmentedFontFace();
47 48
48 CSSFontSelector* fontSelector() const { return m_fontSelector; } 49 CSSFontSelector* fontSelector() const { return m_fontSelector; }
49 FontTraitsMask traitsMask() const { return m_traitsMask; } 50 FontTraitsMask traitsMask() const { return m_traitsMask; }
50 bool isLocalFallback() const { return m_isLocalFallback; } 51 bool isLocalFallback() const { return m_isLocalFallback; }
(...skipping 10 matching lines...) Expand all
61 62
62 class LoadFontCallback : public RefCounted<LoadFontCallback> { 63 class LoadFontCallback : public RefCounted<LoadFontCallback> {
63 public: 64 public:
64 virtual ~LoadFontCallback() { } 65 virtual ~LoadFontCallback() { }
65 virtual void notifyLoaded(CSSSegmentedFontFace*) = 0; 66 virtual void notifyLoaded(CSSSegmentedFontFace*) = 0;
66 virtual void notifyError(CSSSegmentedFontFace*) = 0; 67 virtual void notifyError(CSSSegmentedFontFace*) = 0;
67 }; 68 };
68 69
69 bool checkFont() const; 70 bool checkFont() const;
70 void loadFont(const FontDescription&, PassRefPtr<LoadFontCallback> loadCallb ack); 71 void loadFont(const FontDescription&, PassRefPtr<LoadFontCallback> loadCallb ack);
72 Vector<RefPtr<FontFace> > fontFaces() const;
71 void willUseFontData(const FontDescription&); 73 void willUseFontData(const FontDescription&);
72 74
73 private: 75 private:
74 CSSSegmentedFontFace(CSSFontSelector*, FontTraitsMask, bool isLocalFallback) ; 76 CSSSegmentedFontFace(CSSFontSelector*, FontTraitsMask, bool isLocalFallback) ;
75 77
76 void pruneTable(); 78 void pruneTable();
77 bool isValid() const; 79 bool isValid() const;
78 bool isLoading() const; 80 bool isLoading() const;
79 81
80 CSSFontSelector* m_fontSelector; 82 CSSFontSelector* m_fontSelector;
81 FontTraitsMask m_traitsMask; 83 FontTraitsMask m_traitsMask;
82 bool m_isLocalFallback; 84 bool m_isLocalFallback;
83 HashMap<unsigned, RefPtr<SegmentedFontData> > m_fontDataTable; 85 HashMap<unsigned, RefPtr<SegmentedFontData> > m_fontDataTable;
84 Vector<RefPtr<CSSFontFace>, 1> m_fontFaces; 86 Vector<RefPtr<CSSFontFace>, 1> m_fontFaces;
85 Vector<RefPtr<LoadFontCallback> > m_callbacks; 87 Vector<RefPtr<LoadFontCallback> > m_callbacks;
86 }; 88 };
87 89
88 } // namespace WebCore 90 } // namespace WebCore
89 91
90 #endif // CSSSegmentedFontFace_h 92 #endif // CSSSegmentedFontFace_h
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/webfont/fontloader-loading-attribute-expected.txt ('k') | Source/core/css/CSSSegmentedFontFace.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698