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

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

Issue 953693002: InlinedVisitor: Migrate css to use inlined tracing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef RemoteFontFaceSource_h 5 #ifndef RemoteFontFaceSource_h
6 #define RemoteFontFaceSource_h 6 #define RemoteFontFaceSource_h
7 7
8 #include "core/css/CSSFontFaceSource.h" 8 #include "core/css/CSSFontFaceSource.h"
9 #include "core/fetch/FontResource.h" 9 #include "core/fetch/FontResource.h"
10 #include "core/fetch/ResourcePtr.h" 10 #include "core/fetch/ResourcePtr.h"
(...skipping 16 matching lines...) Expand all
27 virtual bool ensureFontData(); 27 virtual bool ensureFontData();
28 28
29 virtual void didStartFontLoad(FontResource*) override; 29 virtual void didStartFontLoad(FontResource*) override;
30 virtual void fontLoaded(FontResource*) override; 30 virtual void fontLoaded(FontResource*) override;
31 virtual void fontLoadWaitLimitExceeded(FontResource*) override; 31 virtual void fontLoadWaitLimitExceeded(FontResource*) override;
32 32
33 // For UMA reporting 33 // For UMA reporting
34 virtual bool hadBlankText() override { return m_histograms.hadBlankText(); } 34 virtual bool hadBlankText() override { return m_histograms.hadBlankText(); }
35 void paintRequested() { m_histograms.fallbackFontPainted(); } 35 void paintRequested() { m_histograms.fallbackFontPainted(); }
36 36
37 virtual void trace(Visitor*) override; 37 DECLARE_VIRTUAL_TRACE();
38 38
39 protected: 39 protected:
40 virtual PassRefPtr<SimpleFontData> createFontData(const FontDescription&) ov erride; 40 virtual PassRefPtr<SimpleFontData> createFontData(const FontDescription&) ov erride;
41 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti on&); 41 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti on&);
42 void pruneTable(); 42 void pruneTable();
43 43
44 private: 44 private:
45 class FontLoadHistograms { 45 class FontLoadHistograms {
46 public: 46 public:
47 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { } 47 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { }
48 void loadStarted(); 48 void loadStarted();
49 void fallbackFontPainted(); 49 void fallbackFontPainted();
50 void recordRemoteFont(const FontResource*); 50 void recordRemoteFont(const FontResource*);
51 void recordFallbackTime(const FontResource*); 51 void recordFallbackTime(const FontResource*);
52 bool hadBlankText() { return m_fallbackPaintTime; } 52 bool hadBlankText() { return m_fallbackPaintTime; }
53 private: 53 private:
54 const char* histogramName(const FontResource*); 54 const char* histogramName(const FontResource*);
55 double m_loadStartTime; 55 double m_loadStartTime;
56 double m_fallbackPaintTime; 56 double m_fallbackPaintTime;
57 }; 57 };
58 58
59 ResourcePtr<FontResource> m_font; 59 ResourcePtr<FontResource> m_font;
60 RefPtrWillBeMember<FontLoader> m_fontLoader; 60 RefPtrWillBeMember<FontLoader> m_fontLoader;
61 FontLoadHistograms m_histograms; 61 FontLoadHistograms m_histograms;
62 }; 62 };
63 63
64 } // namespace blink 64 } // namespace blink
65 65
66 #endif 66 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698