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

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

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: handle case in RemoteFontFaceSource if cache-aware deactivated in startLoad(), rebase Created 4 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 /* 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 bool isCORSFailed() const { return m_corsFailed; } 60 bool isCORSFailed() const { return m_corsFailed; }
61 String otsParsingMessage() const { return m_otsParsingMessage; } 61 String otsParsingMessage() const { return m_otsParsingMessage; }
62 62
63 bool ensureCustomFontData(); 63 bool ensureCustomFontData();
64 FontPlatformData platformDataFromCustomData( 64 FontPlatformData platformDataFromCustomData(
65 float size, 65 float size,
66 bool bold, 66 bool bold,
67 bool italic, 67 bool italic,
68 FontOrientation = FontOrientation::Horizontal); 68 FontOrientation = FontOrientation::Horizontal);
69 69
70 // Calls to addClient() and removeClient() is forbidden in this callback to
71 // prevent potential race issues.
72 void willReloadAfterDiskCacheMiss() override;
73
70 private: 74 private:
71 class FontResourceFactory : public ResourceFactory { 75 class FontResourceFactory : public ResourceFactory {
72 public: 76 public:
73 FontResourceFactory() : ResourceFactory(Resource::Font) {} 77 FontResourceFactory() : ResourceFactory(Resource::Font) {}
74 78
75 Resource* create(const ResourceRequest& request, 79 Resource* create(const ResourceRequest& request,
76 const ResourceLoaderOptions& options, 80 const ResourceLoaderOptions& options,
77 const String& charset) const override { 81 const String& charset) const override {
78 return new FontResource(request, options); 82 return new FontResource(request, options);
79 } 83 }
(...skipping 25 matching lines...) Expand all
105 109
106 class FontResourceClient : public ResourceClient { 110 class FontResourceClient : public ResourceClient {
107 public: 111 public:
108 ~FontResourceClient() override {} 112 ~FontResourceClient() override {}
109 static bool isExpectedType(ResourceClient* client) { 113 static bool isExpectedType(ResourceClient* client) {
110 return client->getResourceClientType() == FontType; 114 return client->getResourceClientType() == FontType;
111 } 115 }
112 ResourceClientType getResourceClientType() const final { return FontType; } 116 ResourceClientType getResourceClientType() const final { return FontType; }
113 virtual void fontLoadShortLimitExceeded(FontResource*) {} 117 virtual void fontLoadShortLimitExceeded(FontResource*) {}
114 virtual void fontLoadLongLimitExceeded(FontResource*) {} 118 virtual void fontLoadLongLimitExceeded(FontResource*) {}
119 virtual void willReloadAfterDiskCacheMiss(const FontResource*) {}
115 }; 120 };
116 121
117 } // namespace blink 122 } // namespace blink
118 123
119 #endif 124 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698