| OLD | NEW |
| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 FontResource* CSSFontFaceSrcValue::fetch(Document* document) | 83 FontResource* CSSFontFaceSrcValue::fetch(Document* document) |
| 84 { | 84 { |
| 85 if (!m_fetched) { | 85 if (!m_fetched) { |
| 86 FetchRequest request(ResourceRequest(document->completeURL(m_resource)),
FetchInitiatorTypeNames::css); | 86 FetchRequest request(ResourceRequest(document->completeURL(m_resource)),
FetchInitiatorTypeNames::css); |
| 87 request.setContentSecurityCheck(m_shouldCheckContentSecurityPolicy); | 87 request.setContentSecurityCheck(m_shouldCheckContentSecurityPolicy); |
| 88 SecurityOrigin* securityOrigin = document->securityOrigin(); | 88 SecurityOrigin* securityOrigin = document->securityOrigin(); |
| 89 if (shouldSetCrossOriginAccessControl(request.url(), securityOrigin)) { | 89 if (shouldSetCrossOriginAccessControl(request.url(), securityOrigin)) { |
| 90 request.setCrossOriginAccessControl(securityOrigin, DoNotAllowStored
Credentials); | 90 request.setCrossOriginAccessControl(securityOrigin, DoNotAllowStored
Credentials); |
| 91 } | 91 } |
| 92 request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generat
eReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); | 92 request.mutableResourceRequest().setHTTPReferrer(SecurityPolicy::generat
eReferrer(m_referrer.referrerPolicy, request.url(), m_referrer.referrer)); |
| 93 m_fetched = document->fetcher()->fetchFont(request); | 93 m_fetched = FontResource::fetch(request, document->fetcher()); |
| 94 } else { | 94 } else { |
| 95 // FIXME: CSSFontFaceSrcValue::fetch is invoked when @font-face rule | 95 // FIXME: CSSFontFaceSrcValue::fetch is invoked when @font-face rule |
| 96 // is processed by StyleResolver / StyleEngine. | 96 // is processed by StyleResolver / StyleEngine. |
| 97 restoreCachedResourceIfNeeded(document); | 97 restoreCachedResourceIfNeeded(document); |
| 98 } | 98 } |
| 99 return m_fetched.get(); | 99 return m_fetched.get(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void CSSFontFaceSrcValue::restoreCachedResourceIfNeeded(Document* document) | 102 void CSSFontFaceSrcValue::restoreCachedResourceIfNeeded(Document* document) |
| 103 { | 103 { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 114 m_fetched->lastResourceRequest().url(), MixedContentChecker::SendReport)
; | 114 m_fetched->lastResourceRequest().url(), MixedContentChecker::SendReport)
; |
| 115 document->fetcher()->requestLoadStarted(m_fetched.get(), request, ResourceFe
tcher::ResourceLoadingFromCache); | 115 document->fetcher()->requestLoadStarted(m_fetched.get(), request, ResourceFe
tcher::ResourceLoadingFromCache); |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const | 118 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const |
| 119 { | 119 { |
| 120 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; | 120 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; |
| 121 } | 121 } |
| 122 | 122 |
| 123 } | 123 } |
| OLD | NEW |