| 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 21 matching lines...) Expand all Loading... |
| 32 #include "platform/weborigin/Referrer.h" | 32 #include "platform/weborigin/Referrer.h" |
| 33 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
| 34 #include "wtf/text/WTFString.h" | 34 #include "wtf/text/WTFString.h" |
| 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 PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> create(const String& reso
urce, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) | 42 static RawPtr<CSSFontFaceSrcValue> create(const String& resource, ContentSec
urityPolicyDisposition shouldCheckContentSecurityPolicy) |
| 43 { | 43 { |
| 44 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, false, shoul
dCheckContentSecurityPolicy)); | 44 return (new CSSFontFaceSrcValue(resource, false, shouldCheckContentSecur
ityPolicy)); |
| 45 } | 45 } |
| 46 static PassRefPtrWillBeRawPtr<CSSFontFaceSrcValue> createLocal(const String&
resource, ContentSecurityPolicyDisposition shouldCheckContentSecurityPolicy) | 46 static RawPtr<CSSFontFaceSrcValue> createLocal(const String& resource, Conte
ntSecurityPolicyDisposition shouldCheckContentSecurityPolicy) |
| 47 { | 47 { |
| 48 return adoptRefWillBeNoop(new CSSFontFaceSrcValue(resource, true, should
CheckContentSecurityPolicy)); | 48 return (new CSSFontFaceSrcValue(resource, true, shouldCheckContentSecuri
tyPolicy)); |
| 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; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 82 | 82 |
| 83 void restoreCachedResourceIfNeeded(Document*); | 83 void restoreCachedResourceIfNeeded(Document*); |
| 84 | 84 |
| 85 String m_resource; | 85 String m_resource; |
| 86 String m_format; | 86 String m_format; |
| 87 Referrer m_referrer; | 87 Referrer m_referrer; |
| 88 bool m_isLocal; | 88 bool m_isLocal; |
| 89 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; | 89 ContentSecurityPolicyDisposition m_shouldCheckContentSecurityPolicy; |
| 90 | 90 |
| 91 | 91 |
| 92 class FontResourceHelper : public NoBaseWillBeGarbageCollectedFinalized<Font
ResourceHelper>, public ResourceOwner<FontResource> { | 92 class FontResourceHelper : public GarbageCollectedFinalized<FontResourceHelp
er>, public ResourceOwner<FontResource> { |
| 93 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper); | 93 USING_GARBAGE_COLLECTED_MIXIN(FontResourceHelper); |
| 94 public: | 94 public: |
| 95 static PassOwnPtrWillBeRawPtr<FontResourceHelper> create(PassRefPtrWillB
eRawPtr<FontResource> resource) | 95 static RawPtr<FontResourceHelper> create(RawPtr<FontResource> resource) |
| 96 { | 96 { |
| 97 return adoptPtrWillBeNoop(new FontResourceHelper(resource)); | 97 return (new FontResourceHelper(resource)); |
| 98 } | 98 } |
| 99 | 99 |
| 100 DEFINE_INLINE_VIRTUAL_TRACE() { ResourceOwner<FontResource>::trace(visit
or); } | 100 DEFINE_INLINE_VIRTUAL_TRACE() { ResourceOwner<FontResource>::trace(visit
or); } |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 FontResourceHelper(PassRefPtrWillBeRawPtr<FontResource> resource) | 103 FontResourceHelper(RawPtr<FontResource> resource) |
| 104 { | 104 { |
| 105 setResource(resource); | 105 setResource(resource); |
| 106 } | 106 } |
| 107 | 107 |
| 108 String debugName() const override { return "CSSFontFaceSrcValue::FontRes
ourceHelper"; } | 108 String debugName() const override { return "CSSFontFaceSrcValue::FontRes
ourceHelper"; } |
| 109 }; | 109 }; |
| 110 OwnPtrWillBeMember<FontResourceHelper> m_fetched; | 110 Member<FontResourceHelper> m_fetched; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); | 113 DEFINE_CSS_VALUE_TYPE_CASTS(CSSFontFaceSrcValue, isFontFaceSrcValue()); |
| 114 | 114 |
| 115 } // namespace blink | 115 } // namespace blink |
| 116 | 116 |
| 117 #endif | 117 #endif |
| OLD | NEW |