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

Unified Diff: Source/core/fetch/FontResource.h

Issue 1170503003: Remove resource type-specific fetching logic from ResourceFetcher (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Null-check Document::loader() before calling startPreload() Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fetch/FetchContext.h ('k') | Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/FontResource.h
diff --git a/Source/core/fetch/FontResource.h b/Source/core/fetch/FontResource.h
index 33b7f0cdbb4e781cfaa663d76ccd32b4b42654e0..e5606a9446c50e533bb874c7e47d8dfb72ed8b70 100644
--- a/Source/core/fetch/FontResource.h
+++ b/Source/core/fetch/FontResource.h
@@ -34,6 +34,7 @@
namespace blink {
+class FetchRequest;
class ResourceFetcher;
class FontPlatformData;
class FontCustomPlatformData;
@@ -42,7 +43,7 @@ class FontResource final : public Resource {
public:
typedef ResourceClient ClientType;
- FontResource(const ResourceRequest&);
+ static ResourcePtr<FontResource> fetch(FetchRequest&, ResourceFetcher*);
virtual ~FontResource();
virtual void load(ResourceFetcher*, const ResourceLoaderOptions&) override;
@@ -58,7 +59,7 @@ public:
void didScheduleLoad();
void didUnscheduleLoad();
- void setCORSFailed() { m_corsFailed = true; }
+ void setCORSFailed() override { m_corsFailed = true; }
bool isCORSFailed() const { return m_corsFailed; }
bool ensureCustomFontData();
@@ -68,6 +69,18 @@ protected:
virtual bool isSafeToUnlock() const override;
private:
+ class FontResourceFactory : public ResourceFactory {
+ public:
+ FontResourceFactory()
+ : ResourceFactory(Resource::Font) { }
+
+ Resource* create(const ResourceRequest& request, const String& charset) const override
+ {
+ return new FontResource(request);
+ }
+ };
+ FontResource(const ResourceRequest&);
+
virtual void checkNotify() override;
void fontLoadWaitLimitCallback(Timer<FontResource>*);
« no previous file with comments | « Source/core/fetch/FetchContext.h ('k') | Source/core/fetch/FontResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698