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

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

Issue 316353003: Remove font fetching fallback for CORS failures (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add/Update tests Created 6 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 unified diff | Download patch
« no previous file with comments | « Source/core/fetch/FontResource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('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) 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #endif 43 #endif
44 44
45 namespace WebCore { 45 namespace WebCore {
46 46
47 static const double fontLoadWaitLimitSec = 3.0; 47 static const double fontLoadWaitLimitSec = 3.0;
48 48
49 FontResource::FontResource(const ResourceRequest& resourceRequest) 49 FontResource::FontResource(const ResourceRequest& resourceRequest)
50 : Resource(resourceRequest, Font) 50 : Resource(resourceRequest, Font)
51 , m_loadInitiated(false) 51 , m_loadInitiated(false)
52 , m_exceedsFontLoadWaitLimit(false) 52 , m_exceedsFontLoadWaitLimit(false)
53 , m_corsFailed(false)
54 , m_fontLoadWaitLimitTimer(this, &FontResource::fontLoadWaitLimitCallback) 53 , m_fontLoadWaitLimitTimer(this, &FontResource::fontLoadWaitLimitCallback)
55 { 54 {
56 } 55 }
57 56
58 FontResource::~FontResource() 57 FontResource::~FontResource()
59 { 58 {
60 } 59 }
61 60
62 void FontResource::load(ResourceFetcher*, const ResourceLoaderOptions& options) 61 void FontResource::load(ResourceFetcher*, const ResourceLoaderOptions& options)
63 { 62 {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 177
179 void FontResource::allClientsRemoved() 178 void FontResource::allClientsRemoved()
180 { 179 {
181 m_fontData.clear(); 180 m_fontData.clear();
182 Resource::allClientsRemoved(); 181 Resource::allClientsRemoved();
183 } 182 }
184 183
185 void FontResource::checkNotify() 184 void FontResource::checkNotify()
186 { 185 {
187 m_fontLoadWaitLimitTimer.stop(); 186 m_fontLoadWaitLimitTimer.stop();
188
189 ResourceClientWalker<FontResourceClient> w(m_clients); 187 ResourceClientWalker<FontResourceClient> w(m_clients);
190 // FIXME: Remove this CORS fallback once we have enough UMA to make a decisi on. 188 while (FontResourceClient* c = w.next())
191 if (m_corsFailed) { 189 c->fontLoaded(this);
192 while (FontResourceClient* client = w.next())
193 client->corsFailed(this);
194 } else {
195 while (FontResourceClient* c = w.next())
196 c->fontLoaded(this);
197 }
198 } 190 }
199 191
200 } 192 }
OLDNEW
« no previous file with comments | « Source/core/fetch/FontResource.h ('k') | Source/core/fetch/ResourceFetcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698