| 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 |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "core/css/CSSFontFaceSrcValue.h" | 26 #include "core/css/CSSFontFaceSrcValue.h" |
| 27 | 27 |
| 28 #include "core/css/CSSMarkup.h" | 28 #include "core/css/CSSMarkup.h" |
| 29 #include "core/css/StyleSheetContents.h" | 29 #include "core/css/StyleSheetContents.h" |
| 30 #include "core/css/serializer/CSSDeserializeStream.h" |
| 31 #include "core/css/serializer/CSSSerializeStream.h" |
| 30 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 31 #include "core/dom/Node.h" | 33 #include "core/dom/Node.h" |
| 32 #include "core/fetch/FetchInitiatorTypeNames.h" | 34 #include "core/fetch/FetchInitiatorTypeNames.h" |
| 33 #include "core/fetch/FetchRequest.h" | 35 #include "core/fetch/FetchRequest.h" |
| 34 #include "core/fetch/FontResource.h" | 36 #include "core/fetch/FontResource.h" |
| 35 #include "core/fetch/ResourceFetcher.h" | 37 #include "core/fetch/ResourceFetcher.h" |
| 36 #include "core/loader/MixedContentChecker.h" | 38 #include "core/loader/MixedContentChecker.h" |
| 37 #include "platform/CrossOriginAttributeValue.h" | 39 #include "platform/CrossOriginAttributeValue.h" |
| 38 #include "platform/fonts/FontCache.h" | 40 #include "platform/fonts/FontCache.h" |
| 39 #include "platform/fonts/FontCustomPlatformData.h" | 41 #include "platform/fonts/FontCustomPlatformData.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 MixedContentChecker::shouldBlockFetch(document->frame(), m_fetched->lastReso
urceRequest(), | 118 MixedContentChecker::shouldBlockFetch(document->frame(), m_fetched->lastReso
urceRequest(), |
| 117 m_fetched->lastResourceRequest().url(), MixedContentChecker::SendReport)
; | 119 m_fetched->lastResourceRequest().url(), MixedContentChecker::SendReport)
; |
| 118 document->fetcher()->requestLoadStarted(m_fetched.get(), request, ResourceFe
tcher::ResourceLoadingFromCache); | 120 document->fetcher()->requestLoadStarted(m_fetched.get(), request, ResourceFe
tcher::ResourceLoadingFromCache); |
| 119 } | 121 } |
| 120 | 122 |
| 121 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const | 123 bool CSSFontFaceSrcValue::equals(const CSSFontFaceSrcValue& other) const |
| 122 { | 124 { |
| 123 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; | 125 return m_isLocal == other.m_isLocal && m_format == other.m_format && m_resou
rce == other.m_resource; |
| 124 } | 126 } |
| 125 | 127 |
| 128 void CSSFontFaceSrcValue::serializeAfterDispatch(CSSSerializeStream* stream) con
st |
| 129 { |
| 130 stream->writeString(m_resource); |
| 131 stream->writeString(m_format); |
| 132 stream->writeReferrer(m_referrer); |
| 133 stream->writeBool(m_isLocal); |
| 134 stream->writeEnumAsInt<ContentSecurityPolicyDisposition>(m_shouldCheckConten
tSecurityPolicy); |
| 126 } | 135 } |
| 136 |
| 137 PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> CSSFontFaceSrcValue::deserializeAfte
rDispatch(CSSDeserializeStream* stream) |
| 138 { |
| 139 String resource = stream->readString(); |
| 140 String format = stream->readString(); |
| 141 Referrer referrer = stream->readReferrer(); |
| 142 bool isLocal = stream->readBool(); |
| 143 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy = stream->
readIntAsEnum<ContentSecurityPolicyDisposition>(); |
| 144 |
| 145 RefPtrWillBeRawPtr<CSSFontFaceSrcValue> value = adoptRefWillBeNoop(new CSSFo
ntFaceSrcValue(resource, isLocal, shouldCheckContentSecurityPolicy)); |
| 146 value->setFormat(format); |
| 147 value->setReferrer(referrer); |
| 148 |
| 149 return value.release(); |
| 150 } |
| 151 |
| 152 } |
| OLD | NEW |