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

Side by Side Diff: Source/core/fetch/FontResource.h

Issue 63713002: Initiate webfont download right after style recalc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix zoom-zoom-coords.xhtml Created 7 years, 1 month 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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class FontResource : public Resource { 43 class FontResource : public Resource {
44 public: 44 public:
45 FontResource(const ResourceRequest&); 45 FontResource(const ResourceRequest&);
46 virtual ~FontResource(); 46 virtual ~FontResource();
47 47
48 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&); 48 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&);
49 49
50 virtual void didAddClient(ResourceClient*); 50 virtual void didAddClient(ResourceClient*);
51 51
52 virtual void allClientsRemoved(); 52 virtual void allClientsRemoved();
53 void willUseFontData();
54 void beginLoadIfNeeded(ResourceFetcher* dl); 53 void beginLoadIfNeeded(ResourceFetcher* dl);
55 bool stillNeedsLoad() const { return !m_loadInitiated; } 54 bool stillNeedsLoad() const { return !m_loadInitiated; }
56 55
57 bool ensureCustomFontData(); 56 bool ensureCustomFontData();
58 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital ic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth); 57 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital ic, FontOrientation = Horizontal, FontWidthVariant = RegularWidth);
59 58
60 #if ENABLE(SVG_FONTS) 59 #if ENABLE(SVG_FONTS)
61 bool ensureSVGFontData(); 60 bool ensureSVGFontData();
62 SVGFontElement* getSVGFontById(const String&) const; 61 SVGFontElement* getSVGFontById(const String&) const;
63 #endif 62 #endif
64 63
65 private: 64 private:
66 virtual void checkNotify(); 65 virtual void checkNotify();
67 OwnPtr<FontCustomPlatformData> m_fontData; 66 OwnPtr<FontCustomPlatformData> m_fontData;
68 bool m_loadInitiated; 67 bool m_loadInitiated;
69 68
70 #if ENABLE(SVG_FONTS) 69 #if ENABLE(SVG_FONTS)
71 RefPtr<WebCore::SVGDocument> m_externalSVGDocument; 70 RefPtr<WebCore::SVGDocument> m_externalSVGDocument;
72 #endif 71 #endif
73 class FontResourceHistograms {
74 public:
75 enum UsageType {
76 StyledAndUsed,
77 StyledButNotUsed,
78 NotStyledButUsed,
79 UsageTypeMax
80 };
81 FontResourceHistograms() : m_styledTime(0) { }
82 ~FontResourceHistograms();
83 void willUseFontData();
84 void loadStarted();
85 private:
86 double m_styledTime;
87 };
88 FontResourceHistograms m_histograms;
89 72
90 friend class MemoryCache; 73 friend class MemoryCache;
91 }; 74 };
92 75
93 class FontResourceClient : public ResourceClient { 76 class FontResourceClient : public ResourceClient {
94 public: 77 public:
95 virtual ~FontResourceClient() { } 78 virtual ~FontResourceClient() { }
96 static ResourceClientType expectedType() { return FontType; } 79 static ResourceClientType expectedType() { return FontType; }
97 virtual ResourceClientType resourceClientType() const { return expectedType( ); } 80 virtual ResourceClientType resourceClientType() const { return expectedType( ); }
98 virtual void fontLoaded(FontResource*) { } 81 virtual void fontLoaded(FontResource*) { }
99 virtual void didStartFontLoad(FontResource*) { } 82 virtual void didStartFontLoad(FontResource*) { }
100 }; 83 };
101 84
102 } 85 }
103 86
104 #endif 87 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698