| 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 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 namespace blink { | 36 namespace blink { |
| 37 | 37 |
| 38 class Document; | 38 class Document; |
| 39 | 39 |
| 40 class CSSFontFaceSrcValue : public CSSValue { | 40 class CSSFontFaceSrcValue : public CSSValue { |
| 41 public: | 41 public: |
| 42 static CSSFontFaceSrcValue* create( | 42 static CSSFontFaceSrcValue* create( |
| 43 const String& specifiedResource, | 43 const String& specifiedResource, |
| 44 const String& absoluteResource, | 44 const String& absoluteResource, |
| 45 const Referrer& referrer, |
| 45 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) { | 46 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) { |
| 46 return new CSSFontFaceSrcValue(specifiedResource, absoluteResource, false, | 47 return new CSSFontFaceSrcValue(specifiedResource, absoluteResource, |
| 48 referrer, false, |
| 47 shouldCheckContentSecurityPolicy); | 49 shouldCheckContentSecurityPolicy); |
| 48 } | 50 } |
| 49 static CSSFontFaceSrcValue* createLocal( | 51 static CSSFontFaceSrcValue* createLocal( |
| 50 const String& absoluteResource, | 52 const String& absoluteResource, |
| 51 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) { | 53 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) { |
| 52 return new CSSFontFaceSrcValue(emptyString, absoluteResource, true, | 54 return new CSSFontFaceSrcValue(emptyString, absoluteResource, Referrer(), |
| 53 shouldCheckContentSecurityPolicy); | 55 true, shouldCheckContentSecurityPolicy); |
| 54 } | 56 } |
| 55 | 57 |
| 56 const String& resource() const { return m_absoluteResource; } | 58 const String& resource() const { return m_absoluteResource; } |
| 57 const String& format() const { return m_format; } | 59 const String& format() const { return m_format; } |
| 58 bool isLocal() const { return m_isLocal; } | 60 bool isLocal() const { return m_isLocal; } |
| 59 | 61 |
| 60 void setFormat(const String& format) { m_format = format; } | 62 void setFormat(const String& format) { m_format = format; } |
| 61 void setReferrer(const Referrer& referrer) { m_referrer = referrer; } | |
| 62 | 63 |
| 63 bool isSupportedFormat() const; | 64 bool isSupportedFormat() const; |
| 64 | 65 |
| 65 String customCSSText() const; | 66 String customCSSText() const; |
| 66 | 67 |
| 67 bool hasFailedOrCanceledSubresources() const; | 68 bool hasFailedOrCanceledSubresources() const; |
| 68 | 69 |
| 69 FontResource* fetch(Document*) const; | 70 FontResource* fetch(Document*) const; |
| 70 | 71 |
| 71 bool equals(const CSSFontFaceSrcValue&) const; | 72 bool equals(const CSSFontFaceSrcValue&) const; |
| 72 | 73 |
| 73 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { | 74 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { |
| 74 visitor->trace(m_fetched); | 75 visitor->trace(m_fetched); |
| 75 CSSValue::traceAfterDispatch(visitor); | 76 CSSValue::traceAfterDispatch(visitor); |
| 76 } | 77 } |
| 77 | 78 |
| 78 private: | 79 private: |
| 79 CSSFontFaceSrcValue( | 80 CSSFontFaceSrcValue( |
| 80 const String& specifiedResource, | 81 const String& specifiedResource, |
| 81 const String& absoluteResource, | 82 const String& absoluteResource, |
| 83 const Referrer& referrer, |
| 82 bool local, | 84 bool local, |
| 83 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) | 85 ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) |
| 84 : CSSValue(FontFaceSrcClass), | 86 : CSSValue(FontFaceSrcClass), |
| 85 m_absoluteResource(absoluteResource), | 87 m_absoluteResource(absoluteResource), |
| 86 m_specifiedResource(specifiedResource), | 88 m_specifiedResource(specifiedResource), |
| 89 m_referrer(referrer), |
| 87 m_isLocal(local), | 90 m_isLocal(local), |
| 88 m_shouldCheckContentSecurityPolicy(shouldCheckContentSecurityPolicy) {} | 91 m_shouldCheckContentSecurityPolicy(shouldCheckContentSecurityPolicy) {} |
| 89 | 92 |
| 90 void restoreCachedResourceIfNeeded(Document*) const; | 93 void restoreCachedResourceIfNeeded(Document*) const; |
| 91 | 94 |
| 92 String m_absoluteResource; | 95 String m_absoluteResource; |
| 93 String m_specifiedResource; | 96 String m_specifiedResource; |
| 94 String m_format; | 97 String m_format; |
| 95 Referrer m_referrer; | 98 Referrer m_referrer; |
| 96 bool m_isLocal; | 99 bool m_isLocal; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 118 } | 121 } |
| 119 }; | 122 }; |
| 120 mutable Member<FontResourceHelper> m_fetched; | 123 mutable Member<FontResourceHelper> m_fetched; |
| 121 }; | 124 }; |
| 122 | 125 |
| 123 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); | 126 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); |
| 124 | 127 |
| 125 } // namespace blink | 128 } // namespace blink |
| 126 | 129 |
| 127 #endif | 130 #endif |
| OLD | NEW |