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

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

Issue 1229743005: Fix virtual/override/final usage in Source/core/{fetch,loader,streams,xmlhttprequest}/. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 5 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
« no previous file with comments | « Source/core/fetch/DocumentResourceReference.h ('k') | Source/core/fetch/ImageResource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 26 matching lines...) Expand all
37 class FetchRequest; 37 class FetchRequest;
38 class ResourceFetcher; 38 class ResourceFetcher;
39 class FontPlatformData; 39 class FontPlatformData;
40 class FontCustomPlatformData; 40 class FontCustomPlatformData;
41 41
42 class FontResource final : public Resource { 42 class FontResource final : public Resource {
43 public: 43 public:
44 typedef ResourceClient ClientType; 44 typedef ResourceClient ClientType;
45 45
46 static ResourcePtr<FontResource> fetch(FetchRequest&, ResourceFetcher*); 46 static ResourcePtr<FontResource> fetch(FetchRequest&, ResourceFetcher*);
47 virtual ~FontResource(); 47 ~FontResource() override;
48 48
49 virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) override; 49 void load(ResourceFetcher*, const ResourceLoaderOptions&) override;
50 50
51 virtual void didAddClient(ResourceClient*) override; 51 void didAddClient(ResourceClient*) override;
52 52
53 virtual void allClientsRemoved() override; 53 void allClientsRemoved() override;
54 void beginLoadIfNeeded(ResourceFetcher* dl); 54 void beginLoadIfNeeded(ResourceFetcher* dl);
55 virtual bool stillNeedsLoad() const override { return m_state != LoadInitiat ed; } 55 bool stillNeedsLoad() const override { return m_state != LoadInitiated; }
56 bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; } 56 bool exceedsFontLoadWaitLimit() const { return m_exceedsFontLoadWaitLimit; }
57 57
58 bool loadScheduled() const { return m_state != Unloaded; } 58 bool loadScheduled() const { return m_state != Unloaded; }
59 void didScheduleLoad(); 59 void didScheduleLoad();
60 void didUnscheduleLoad(); 60 void didUnscheduleLoad();
61 61
62 void setCORSFailed() override { m_corsFailed = true; } 62 void setCORSFailed() override { m_corsFailed = true; }
63 bool isCORSFailed() const { return m_corsFailed; } 63 bool isCORSFailed() const { return m_corsFailed; }
64 String otsParsingMessage() const { return m_otsParsingMessage; } 64 String otsParsingMessage() const { return m_otsParsingMessage; }
65 65
66 bool ensureCustomFontData(); 66 bool ensureCustomFontData();
67 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital ic, FontOrientation = FontOrientation::Horizontal); 67 FontPlatformData platformDataFromCustomData(float size, bool bold, bool ital ic, FontOrientation = FontOrientation::Horizontal);
68 68
69 protected: 69 protected:
70 virtual bool isSafeToUnlock() const override; 70 bool isSafeToUnlock() const override;
71 71
72 private: 72 private:
73 class FontResourceFactory : public ResourceFactory { 73 class FontResourceFactory : public ResourceFactory {
74 public: 74 public:
75 FontResourceFactory() 75 FontResourceFactory()
76 : ResourceFactory(Resource::Font) { } 76 : ResourceFactory(Resource::Font) { }
77 77
78 Resource* create(const ResourceRequest& request, const String& charset) const override 78 Resource* create(const ResourceRequest& request, const String& charset) const override
79 { 79 {
80 return new FontResource(request); 80 return new FontResource(request);
81 } 81 }
82 }; 82 };
83 FontResource(const ResourceRequest&); 83 FontResource(const ResourceRequest&);
84 84
85 virtual void checkNotify() override; 85 void checkNotify() override;
86 void fontLoadWaitLimitCallback(Timer<FontResource>*); 86 void fontLoadWaitLimitCallback(Timer<FontResource>*);
87 87
88 enum State { Unloaded, LoadScheduled, LoadInitiated }; 88 enum State { Unloaded, LoadScheduled, LoadInitiated };
89 89
90 OwnPtr<FontCustomPlatformData> m_fontData; 90 OwnPtr<FontCustomPlatformData> m_fontData;
91 String m_otsParsingMessage; 91 String m_otsParsingMessage;
92 State m_state; 92 State m_state;
93 bool m_exceedsFontLoadWaitLimit; 93 bool m_exceedsFontLoadWaitLimit;
94 bool m_corsFailed; 94 bool m_corsFailed;
95 Timer<FontResource> m_fontLoadWaitLimitTimer; 95 Timer<FontResource> m_fontLoadWaitLimitTimer;
96 96
97 friend class MemoryCache; 97 friend class MemoryCache;
98 }; 98 };
99 99
100 DEFINE_RESOURCE_TYPE_CASTS(Font); 100 DEFINE_RESOURCE_TYPE_CASTS(Font);
101 101
102 class FontResourceClient : public ResourceClient { 102 class FontResourceClient : public ResourceClient {
103 public: 103 public:
104 virtual ~FontResourceClient() { } 104 ~FontResourceClient() override {}
105 static ResourceClientType expectedType() { return FontType; } 105 static ResourceClientType expectedType() { return FontType; }
106 virtual ResourceClientType resourceClientType() const override final { retur n expectedType(); } 106 ResourceClientType resourceClientType() const final { return expectedType(); }
107 virtual void fontLoaded(FontResource*) { } 107 virtual void fontLoaded(FontResource*) {}
108 virtual void didStartFontLoad(FontResource*) { } 108 virtual void didStartFontLoad(FontResource*) {}
109 virtual void fontLoadWaitLimitExceeded(FontResource*) { } 109 virtual void fontLoadWaitLimitExceeded(FontResource*) {}
110 }; 110 };
111 111
112 } 112 }
113 113
114 #endif 114 #endif
OLDNEW
« no previous file with comments | « Source/core/fetch/DocumentResourceReference.h ('k') | Source/core/fetch/ImageResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698