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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSFontFaceSrcValue.cpp

Issue 2390583002: [WIP] WebFonts cache-aware timeout adaption (Closed)
Patch Set: 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, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2010 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return; 81 return;
82 82
83 request.setCrossOriginAccessControl(securityOrigin, 83 request.setCrossOriginAccessControl(securityOrigin,
84 CrossOriginAttributeAnonymous); 84 CrossOriginAttributeAnonymous);
85 } 85 }
86 86
87 FontResource* CSSFontFaceSrcValue::fetch(Document* document) const { 87 FontResource* CSSFontFaceSrcValue::fetch(Document* document) const {
88 if (!m_fetched) { 88 if (!m_fetched) {
89 FetchRequest request(ResourceRequest(m_absoluteResource), 89 FetchRequest request(ResourceRequest(m_absoluteResource),
90 FetchInitiatorTypeNames::css); 90 FetchInitiatorTypeNames::css);
91 request.mutableResourceRequest().setIsCacheAwareLoadingEnabled(true);
Kunihiko Sakamoto 2016/10/03 08:31:38 I think we should do cache-aware loading only for
Takashi Toyoshima 2016/10/03 09:01:04 Since it will introduce additional complexity, we
Shao-Chuan Lee 2016/10/04 09:08:04 Done.
91 request.setContentSecurityCheck(m_shouldCheckContentSecurityPolicy); 92 request.setContentSecurityCheck(m_shouldCheckContentSecurityPolicy);
92 SecurityOrigin* securityOrigin = document->getSecurityOrigin(); 93 SecurityOrigin* securityOrigin = document->getSecurityOrigin();
93 setCrossOriginAccessControl(request, securityOrigin); 94 setCrossOriginAccessControl(request, securityOrigin);
94 request.mutableResourceRequest().setHTTPReferrer( 95 request.mutableResourceRequest().setHTTPReferrer(
95 SecurityPolicy::generateReferrer(m_referrer.referrerPolicy, 96 SecurityPolicy::generateReferrer(m_referrer.referrerPolicy,
96 request.url(), m_referrer.referrer)); 97 request.url(), m_referrer.referrer));
97 FontResource* resource = FontResource::fetch(request, document->fetcher()); 98 FontResource* resource = FontResource::fetch(request, document->fetcher());
98 if (!resource) 99 if (!resource)
99 return nullptr; 100 return nullptr;
100 m_fetched = FontResourceHelper::create(resource); 101 m_fetched = FontResourceHelper::create(resource);
(...skipping 28 matching lines...) Expand all
129 ResourceFetcher::ResourceLoadingFromCache); 130 ResourceFetcher::ResourceLoadingFromCache);
130 } 131 }
131 132
132 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const { 133 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const {
133 return m_isLocal == other.m_isLocal && m_format == other.m_format && 134 return m_isLocal == other.m_isLocal && m_format == other.m_format &&
134 m_specifiedResource == other.m_specifiedResource && 135 m_specifiedResource == other.m_specifiedResource &&
135 m_absoluteResource == other.m_absoluteResource; 136 m_absoluteResource == other.m_absoluteResource;
136 } 137 }
137 138
138 } // namespace blink 139 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/Resource.h » ('j') | third_party/WebKit/Source/core/fetch/Resource.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698