| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/fetch/ResourcePtr.h" | 30 #include "core/fetch/ResourcePtr.h" |
| 31 #include "platform/weborigin/Referrer.h" | 31 #include "platform/weborigin/Referrer.h" |
| 32 #include "wtf/PassRefPtr.h" | 32 #include "wtf/PassRefPtr.h" |
| 33 #include "wtf/text/WTFString.h" | 33 #include "wtf/text/WTFString.h" |
| 34 | 34 |
| 35 namespace blink { | 35 namespace blink { |
| 36 | 36 |
| 37 class FontResource; | 37 class FontResource; |
| 38 class Document; | 38 class Document; |
| 39 | 39 |
| 40 class CSSFontFaceSrcValue : public CSSValue { | 40 class CSSFontFaceSrcValue : public CSSValueObject { |
| 41 public: | 41 public: |
| 42 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& reso
urce, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) | 42 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& reso
urce, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) |
| 43 { | 43 { |
| 44 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, false, shoul
dCheckContentSecurityPolicy)); | 44 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, false, shoul
dCheckContentSecurityPolicy)); |
| 45 } | 45 } |
| 46 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String&
resource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) | 46 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String&
resource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) |
| 47 { | 47 { |
| 48 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, true, should
CheckContentSecurityPolicy)); | 48 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, true, should
CheckContentSecurityPolicy)); |
| 49 } | 49 } |
| 50 | 50 |
| 51 const String& resource() const { return m_resource; } | 51 const String& resource() const { return m_resource; } |
| 52 const String& format() const { return m_format; } | 52 const String& format() const { return m_format; } |
| 53 bool isLocal() const { return m_isLocal; } | 53 bool isLocal() const { return m_isLocal; } |
| 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*); |
| 65 | 65 |
| 66 bool equals(const CSSFontFaceSrcValue&) const; | 66 bool equals(const CSSFontFaceSrcValue&) const; |
| 67 | 67 |
| 68 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValue::traceAfterDispatch(visitor)
; } | 68 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValueObject::traceAfterDispatch(vi
sitor); } |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 CSSFontFaceSrcValue(const String& resource, bool local, ContentSecurityPolic
yDisposition shouldCheckContentSecurityPolicy) | 71 CSSFontFaceSrcValue(const String& resource, bool local, ContentSecurityPolic
yDisposition shouldCheckContentSecurityPolicy) |
| 72 : CSSValue(FontFaceSrcClass) | 72 : CSSValueObject(FontFaceSrcClass) |
| 73 , m_resource(resource) | 73 , m_resource(resource) |
| 74 , m_isLocal(local) | 74 , m_isLocal(local) |
| 75 , m_shouldCheckContentSecurityPolicy(shouldCheckContentSecurityPolicy) | 75 , m_shouldCheckContentSecurityPolicy(shouldCheckContentSecurityPolicy) |
| 76 { | 76 { |
| 77 } | 77 } |
| 78 | 78 |
| 79 void restoreCachedResourceIfNeeded(Document*); | 79 void restoreCachedResourceIfNeeded(Document*); |
| 80 bool shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin*
); | 80 bool shouldSetCrossOriginAccessControl(const KURL& resource, SecurityOrigin*
); |
| 81 | 81 |
| 82 String m_resource; | 82 String m_resource; |
| 83 String m_format; | 83 String m_format; |
| 84 Referrer m_referrer; | 84 Referrer m_referrer; |
| 85 bool m_isLocal; | 85 bool m_isLocal; |
| 86 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; | 86 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; |
| 87 | 87 |
| 88 ResourcePtr<FontResource> m_fetched; | 88 ResourcePtr<FontResource> m_fetched; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); | 91 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); |
| 92 | 92 |
| 93 } | 93 } |
| 94 | 94 |
| 95 #endif | 95 #endif |
| OLD | NEW |