| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 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 23 matching lines...) Expand all Loading... |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 StyleFetchedImageSet::StyleFetchedImageSet(ImageResource* image, float imageScal
eFactor, CSSImageSetValue* value, const KURL& url) | 36 StyleFetchedImageSet::StyleFetchedImageSet(ImageResource* image, float imageScal
eFactor, CSSImageSetValue* value, const KURL& url) |
| 37 : m_bestFitImage(image) | 37 : m_bestFitImage(image) |
| 38 , m_imageScaleFactor(imageScaleFactor) | 38 , m_imageScaleFactor(imageScaleFactor) |
| 39 , m_imageSetValue(value) | 39 , m_imageSetValue(value) |
| 40 , m_url(url) | 40 , m_url(url) |
| 41 { | 41 { |
| 42 m_isImageResourceSet = true; | 42 m_isImageResourceSet = true; |
| 43 m_bestFitImage->addClient(this); | 43 m_bestFitImage->addClient(this); |
| 44 #if ENABLE(OILPAN) |
| 45 ThreadState::current()->registerPreFinalizer(this); |
| 46 #endif |
| 44 } | 47 } |
| 45 | 48 |
| 49 StyleFetchedImageSet::~StyleFetchedImageSet() |
| 50 { |
| 51 #if !ENABLE(OILPAN) |
| 52 dispose(); |
| 53 #endif |
| 54 } |
| 46 | 55 |
| 47 StyleFetchedImageSet::~StyleFetchedImageSet() | 56 void StyleFetchedImageSet::dispose() |
| 48 { | 57 { |
| 49 m_bestFitImage->removeClient(this); | 58 m_bestFitImage->removeClient(this); |
| 50 } | 59 } |
| 51 | 60 |
| 52 WrappedImagePtr StyleFetchedImageSet::data() const | 61 WrappedImagePtr StyleFetchedImageSet::data() const |
| 53 { | 62 { |
| 54 return m_bestFitImage.get(); | 63 return m_bestFitImage.get(); |
| 55 } | 64 } |
| 56 | 65 |
| 57 ImageResource* StyleFetchedImageSet::cachedImage() const | 66 ImageResource* StyleFetchedImageSet::cachedImage() const |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 return m_bestFitImage->image()->currentFrameKnownToBeOpaque(Image::PreCacheM
etadata); | 144 return m_bestFitImage->image()->currentFrameKnownToBeOpaque(Image::PreCacheM
etadata); |
| 136 } | 145 } |
| 137 | 146 |
| 138 DEFINE_TRACE(StyleFetchedImageSet) | 147 DEFINE_TRACE(StyleFetchedImageSet) |
| 139 { | 148 { |
| 140 visitor->trace(m_imageSetValue); | 149 visitor->trace(m_imageSetValue); |
| 141 StyleImage::trace(visitor); | 150 StyleImage::trace(visitor); |
| 142 } | 151 } |
| 143 | 152 |
| 144 } // namespace blink | 153 } // namespace blink |
| OLD | NEW |