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

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

Issue 640593002: Replace FINAL and OVERRIDE with their C++11 counterparts in Source/core/[css|rendering|clipboard] (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased the patch Created 6 years, 2 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
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"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class FontLoader; 14 class FontLoader;
15 15
16 class RemoteFontFaceSource : public CSSFontFaceSource, public FontResourceClient { 16 class RemoteFontFaceSource : public CSSFontFaceSource, public FontResourceClient {
17 public: 17 public:
18 explicit RemoteFontFaceSource(FontResource*, PassRefPtrWillBeRawPtr<FontLoad er>); 18 explicit RemoteFontFaceSource(FontResource*, PassRefPtrWillBeRawPtr<FontLoad er>);
19 virtual ~RemoteFontFaceSource(); 19 virtual ~RemoteFontFaceSource();
20 20
21 virtual FontResource* resource() OVERRIDE { return m_font.get(); } 21 virtual FontResource* resource() override { return m_font.get(); }
22 virtual bool isLoading() const OVERRIDE; 22 virtual bool isLoading() const override;
23 virtual bool isLoaded() const OVERRIDE; 23 virtual bool isLoaded() const override;
24 virtual bool isValid() const OVERRIDE; 24 virtual bool isValid() const override;
25 25
26 void beginLoadIfNeeded() OVERRIDE; 26 void beginLoadIfNeeded() override;
27 virtual bool ensureFontData(); 27 virtual bool ensureFontData();
28 28
29 #if ENABLE(SVG_FONTS) 29 #if ENABLE(SVG_FONTS)
30 virtual bool isSVGFontFaceSource() const { return false; } 30 virtual bool isSVGFontFaceSource() const { return false; }
31 #endif 31 #endif
32 32
33 virtual void didStartFontLoad(FontResource*) OVERRIDE; 33 virtual void didStartFontLoad(FontResource*) override;
34 virtual void fontLoaded(FontResource*) OVERRIDE; 34 virtual void fontLoaded(FontResource*) override;
35 virtual void fontLoadWaitLimitExceeded(FontResource*) OVERRIDE; 35 virtual void fontLoadWaitLimitExceeded(FontResource*) override;
36 36
37 // For UMA reporting 37 // For UMA reporting
38 virtual bool hadBlankText() OVERRIDE { return m_histograms.hadBlankText(); } 38 virtual bool hadBlankText() override { return m_histograms.hadBlankText(); }
39 void paintRequested() { m_histograms.fallbackFontPainted(); } 39 void paintRequested() { m_histograms.fallbackFontPainted(); }
40 40
41 virtual void trace(Visitor*) OVERRIDE; 41 virtual void trace(Visitor*) override;
42 42
43 protected: 43 protected:
44 virtual PassRefPtr<SimpleFontData> createFontData(const FontDescription&) OV ERRIDE; 44 virtual PassRefPtr<SimpleFontData> createFontData(const FontDescription&) ov erride;
45 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti on&); 45 PassRefPtr<SimpleFontData> createLoadingFallbackFontData(const FontDescripti on&);
46 void pruneTable(); 46 void pruneTable();
47 47
48 private: 48 private:
49 class FontLoadHistograms { 49 class FontLoadHistograms {
50 public: 50 public:
51 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { } 51 FontLoadHistograms() : m_loadStartTime(0), m_fallbackPaintTime(0) { }
52 void loadStarted(); 52 void loadStarted();
53 void fallbackFontPainted(); 53 void fallbackFontPainted();
54 void recordRemoteFont(const FontResource*); 54 void recordRemoteFont(const FontResource*);
55 void recordFallbackTime(const FontResource*); 55 void recordFallbackTime(const FontResource*);
56 bool hadBlankText() { return m_fallbackPaintTime; } 56 bool hadBlankText() { return m_fallbackPaintTime; }
57 private: 57 private:
58 const char* histogramName(const FontResource*); 58 const char* histogramName(const FontResource*);
59 double m_loadStartTime; 59 double m_loadStartTime;
60 double m_fallbackPaintTime; 60 double m_fallbackPaintTime;
61 }; 61 };
62 62
63 ResourcePtr<FontResource> m_font; 63 ResourcePtr<FontResource> m_font;
64 RefPtrWillBeMember<FontLoader> m_fontLoader; 64 RefPtrWillBeMember<FontLoader> m_fontLoader;
65 FontLoadHistograms m_histograms; 65 FontLoadHistograms m_histograms;
66 }; 66 };
67 67
68 } // namespace blink 68 } // namespace blink
69 69
70 #endif 70 #endif
OLDNEW
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/SiblingTraversalStrategies.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698