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

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

Issue 1829403002: Clean up font loading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Resource_status
Patch Set: Created 4 years, 8 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 // cached or it is a data: url. In this case, we "Reload" the image, 657 // cached or it is a data: url. In this case, we "Reload" the image,
658 // then defer it with resourceNeedsLoad() so that it never actually 658 // then defer it with resourceNeedsLoad() so that it never actually
659 // goes to the network. 659 // goes to the network.
660 // 2. Images are enabled, but not loaded automatically. In this case, we 660 // 2. Images are enabled, but not loaded automatically. In this case, we
661 // will Use cached resources or data: urls, but will similarly fall back 661 // will Use cached resources or data: urls, but will similarly fall back
662 // to a deferred network load if we don't have the data available 662 // to a deferred network load if we don't have the data available
663 // without a network request. We check allowImage() here, which is 663 // without a network request. We check allowImage() here, which is
664 // affected by m_imagesEnabled but not m_autoLoadImages, in order to 664 // affected by m_imagesEnabled but not m_autoLoadImages, in order to
665 // allow for this differing behavior. 665 // allow for this differing behavior.
666 // TODO(japhet): Can we get rid of one of these settings? 666 // TODO(japhet): Can we get rid of one of these settings?
667 if (FetchRequest::DeferredByClient == fetchRequest.defer()) 667 if (existingResource->isImage() && (FetchRequest::DeferredByClient == fetchR equest.defer() || !context().allowImage(m_imagesEnabled, existingResource->url() )))
Takashi Toyoshima 2016/04/11 11:51:54 So, we will return USE for font resources even if
Nate Chapin 2016/04/11 18:47:32 Correct. This logic is a messy special-case for Im
668 return Reload;
669 if (existingResource->isImage() && !context().allowImage(m_imagesEnabled, ex istingResource->url()))
670 return Reload; 668 return Reload;
671 669
672 // Never use cache entries for downloadToFile / useStreamOnResponse 670 // Never use cache entries for downloadToFile / useStreamOnResponse
673 // requests. The data will be delivered through other paths. 671 // requests. The data will be delivered through other paths.
674 if (request.downloadToFile() || request.useStreamOnResponse()) 672 if (request.downloadToFile() || request.useStreamOnResponse())
675 return Reload; 673 return Reload;
676 674
677 // If resource was populated from a SubstituteData load or data: url, use it . 675 // If resource was populated from a SubstituteData load or data: url, use it .
678 if (isStaticData) 676 if (isStaticData)
679 return Use; 677 return Use;
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 visitor->trace(m_context); 1183 visitor->trace(m_context);
1186 visitor->trace(m_archive); 1184 visitor->trace(m_archive);
1187 visitor->trace(m_loaders); 1185 visitor->trace(m_loaders);
1188 visitor->trace(m_nonBlockingLoaders); 1186 visitor->trace(m_nonBlockingLoaders);
1189 visitor->trace(m_documentResources); 1187 visitor->trace(m_documentResources);
1190 visitor->trace(m_preloads); 1188 visitor->trace(m_preloads);
1191 visitor->trace(m_resourceTimingInfoMap); 1189 visitor->trace(m_resourceTimingInfoMap);
1192 } 1190 }
1193 1191
1194 } // namespace blink 1192 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698