| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 void setFormat(const String& format) { m_format = format; } | 55 void setFormat(const String& format) { m_format = format; } |
| 56 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } | 56 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } |
| 57 | 57 |
| 58 bool isSupportedFormat() const; | 58 bool isSupportedFormat() const; |
| 59 | 59 |
| 60 String customCSSText() const; | 60 String customCSSText() const; |
| 61 | 61 |
| 62 bool hasFailedOrCanceledSubresources() const; | 62 bool hasFailedOrCanceledSubresources() const; |
| 63 | 63 |
| 64 FontResource* fetch(Document*); | 64 FontResource* fetch(Document*) const; |
| 65 | 65 |
| 66 bool equals(const CSSFontFaceSrcValue&) const; | 66 bool equals(const CSSFontFaceSrcValue&) const; |
| 67 | 67 |
| 68 DEFINE_INLINE_TRACE_AFTER_DISPATCH() | 68 DEFINE_INLINE_TRACE_AFTER_DISPATCH() |
| 69 { | 69 { |
| 70 visitor->trace(m_fetched); | 70 visitor->trace(m_fetched); |
| 71 CSSValue::traceAfterDispatch(visitor); | 71 CSSValue::traceAfterDispatch(visitor); |
| 72 } | 72 } |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 CSSFontFaceSrcValue(const String& specifiedResource, const String& absoluteR
esource, bool local, ContentSecurityPolicyDisposition shouldCheckContentSecurity
Policy) | 75 CSSFontFaceSrcValue(const String& specifiedResource, const String& absoluteR
esource, bool local, ContentSecurityPolicyDisposition shouldCheckContentSecurity
Policy) |
| 76 : CSSValue(FontFaceSrcClass) | 76 : CSSValue(FontFaceSrcClass) |
| 77 , m_absoluteResource(absoluteResource) | 77 , m_absoluteResource(absoluteResource) |
| 78 , m_specifiedResource(specifiedResource) | 78 , m_specifiedResource(specifiedResource) |
| 79 , m_isLocal(local) | 79 , m_isLocal(local) |
| 80 , m_shouldCheckContentSecurityPolicy(shouldCheckContentSecurityPolicy) | 80 , m_shouldCheckContentSecurityPolicy(shouldCheckContentSecurityPolicy) |
| 81 { | 81 { |
| 82 } | 82 } |
| 83 | 83 |
| 84 void restoreCachedResourceIfNeeded(Document*); | 84 void restoreCachedResourceIfNeeded(Document*) const; |
| 85 | 85 |
| 86 String m_absoluteResource; | 86 String m_absoluteResource; |
| 87 String m_specifiedResource; | 87 String m_specifiedResource; |
| 88 String m_format; | 88 String m_format; |
| 89 Referrer m_referrer; | 89 Referrer m_referrer; |
| 90 bool m_isLocal; | 90 bool m_isLocal; |
| 91 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; | 91 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; |
| 92 | 92 |
| 93 | 93 |
| 94 class FontResourceHelper : public GarbageCollectedFinalized<FontResourceHelp
er>, public ResourceOwner<FontResource> { | 94 class FontResourceHelper : public GarbageCollectedFinalized<FontResourceHelp
er>, public ResourceOwner<FontResource> { |
| 95 USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper); | 95 USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper); |
| 96 public: | 96 public: |
| 97 static FontResourceHelper* create(FontResource* resource) | 97 static FontResourceHelper* create(FontResource* resource) |
| 98 { | 98 { |
| 99 return new FontResourceHelper(resource); | 99 return new FontResourceHelper(resource); |
| 100 } | 100 } |
| 101 | 101 |
| 102 DEFINE_INLINE_VIRTUAL_TRACE() { ResourceOwner<FontResource>::trace(visit
or); } | 102 DEFINE_INLINE_VIRTUAL_TRACE() { ResourceOwner<FontResource>::trace(visit
or); } |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 FontResourceHelper(FontResource* resource) | 105 FontResourceHelper(FontResource* resource) |
| 106 { | 106 { |
| 107 setResource(resource); | 107 setResource(resource); |
| 108 } | 108 } |
| 109 | 109 |
| 110 String debugName() const override { return "CSSFontFaceSrcValue::FontRes
ourceHelper"; } | 110 String debugName() const override { return "CSSFontFaceSrcValue::FontRes
ourceHelper"; } |
| 111 }; | 111 }; |
| 112 Member<FontResourceHelper> m_fetched; | 112 mutable Member<FontResourceHelper> m_fetched; |
| 113 }; | 113 }; |
| 114 | 114 |
| 115 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); | 115 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); |
| 116 | 116 |
| 117 } // namespace blink | 117 } // namespace blink |
| 118 | 118 |
| 119 #endif | 119 #endif |
| OLD | NEW |