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

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

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: RemoteFontFaceSource cache-aware behavior, fix 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) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Torch Mobile, Inc. 3 * Copyright (C) 2009 Torch Mobile, Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 FontPlatformData FontResource::platformDataFromCustomData( 138 FontPlatformData FontResource::platformDataFromCustomData(
139 float size, 139 float size,
140 bool bold, 140 bool bold,
141 bool italic, 141 bool italic,
142 FontOrientation orientation) { 142 FontOrientation orientation) {
143 DCHECK(m_fontData); 143 DCHECK(m_fontData);
144 return m_fontData->fontPlatformData(size, bold, italic, orientation); 144 return m_fontData->fontPlatformData(size, bold, italic, orientation);
145 } 145 }
146 146
147 void FontResource::willReloadAfterDiskCacheMiss() {
148 ProhibitAddRemoveClientInScope prohibitAddRemoveClient(this);
149
150 ResourceClientWalker<FontResourceClient> walker(clients());
151 while (FontResourceClient* client = walker.next())
152 client->willReloadAfterDiskCacheMiss(this);
153 }
154
147 void FontResource::fontLoadShortLimitCallback(TimerBase*) { 155 void FontResource::fontLoadShortLimitCallback(TimerBase*) {
148 if (!isLoading()) 156 if (!isLoading())
149 return; 157 return;
150 DCHECK_EQ(m_loadLimitState, UnderLimit); 158 DCHECK_EQ(m_loadLimitState, UnderLimit);
151 m_loadLimitState = ShortLimitExceeded; 159 m_loadLimitState = ShortLimitExceeded;
152 ResourceClientWalker<FontResourceClient> walker(clients()); 160 ResourceClientWalker<FontResourceClient> walker(clients());
153 while (FontResourceClient* client = walker.next()) 161 while (FontResourceClient* client = walker.next())
154 client->fontLoadShortLimitExceeded(this); 162 client->fontLoadShortLimitExceeded(this);
155 } 163 }
156 164
(...skipping 13 matching lines...) Expand all
170 } 178 }
171 179
172 void FontResource::checkNotify() { 180 void FontResource::checkNotify() {
173 m_fontLoadShortLimitTimer.stop(); 181 m_fontLoadShortLimitTimer.stop();
174 m_fontLoadLongLimitTimer.stop(); 182 m_fontLoadLongLimitTimer.stop();
175 183
176 Resource::checkNotify(); 184 Resource::checkNotify();
177 } 185 }
178 186
179 } // namespace blink 187 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698