| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 void CSSImageGeneratorValue::addClient(LayoutObject* layoutObject, const IntSize
& size) | 45 void CSSImageGeneratorValue::addClient(LayoutObject* layoutObject, const IntSize
& size) |
| 46 { | 46 { |
| 47 ASSERT(layoutObject); | 47 ASSERT(layoutObject); |
| 48 #if !ENABLE(OILPAN) | 48 #if !ENABLE(OILPAN) |
| 49 ref(); | 49 ref(); |
| 50 #else | 50 #else |
| 51 if (m_clients.isEmpty()) { | 51 if (m_clients.isEmpty()) { |
| 52 ASSERT(!m_keepAlive); | 52 ASSERT(!m_keepAlive); |
| 53 m_keepAlive = adoptPtr(new Persistent<CSSImageGeneratorValue>(this)); | 53 m_keepAlive = this; |
| 54 } | 54 } |
| 55 #endif | 55 #endif |
| 56 | 56 |
| 57 if (!size.isEmpty()) | 57 if (!size.isEmpty()) |
| 58 m_sizes.add(size); | 58 m_sizes.add(size); |
| 59 | 59 |
| 60 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); | 60 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); |
| 61 if (it == m_clients.end()) { | 61 if (it == m_clients.end()) { |
| 62 m_clients.add(layoutObject, SizeAndCount(size, 1)); | 62 m_clients.add(layoutObject, SizeAndCount(size, 1)); |
| 63 } else { | 63 } else { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 82 } | 82 } |
| 83 | 83 |
| 84 if (!--sizeCount.count) | 84 if (!--sizeCount.count) |
| 85 m_clients.remove(layoutObject); | 85 m_clients.remove(layoutObject); |
| 86 | 86 |
| 87 #if !ENABLE(OILPAN) | 87 #if !ENABLE(OILPAN) |
| 88 deref(); | 88 deref(); |
| 89 #else | 89 #else |
| 90 if (m_clients.isEmpty()) { | 90 if (m_clients.isEmpty()) { |
| 91 ASSERT(m_keepAlive); | 91 ASSERT(m_keepAlive); |
| 92 m_keepAlive = nullptr; | 92 m_keepAlive.clear(); |
| 93 } | 93 } |
| 94 #endif | 94 #endif |
| 95 } | 95 } |
| 96 | 96 |
| 97 Image* CSSImageGeneratorValue::getImage(LayoutObject* layoutObject, const IntSiz
e& size) | 97 Image* CSSImageGeneratorValue::getImage(LayoutObject* layoutObject, const IntSiz
e& size) |
| 98 { | 98 { |
| 99 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); | 99 LayoutObjectSizeCountMap::iterator it = m_clients.find(layoutObject); |
| 100 if (it != m_clients.end()) { | 100 if (it != m_clients.end()) { |
| 101 SizeAndCount& sizeCount = it->value; | 101 SizeAndCount& sizeCount = it->value; |
| 102 IntSize oldSize = sizeCount.size; | 102 IntSize oldSize = sizeCount.size; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 break; | 219 break; |
| 220 case RadialGradientClass: | 220 case RadialGradientClass: |
| 221 toCSSRadialGradientValue(this)->loadSubimages(document); | 221 toCSSRadialGradientValue(this)->loadSubimages(document); |
| 222 break; | 222 break; |
| 223 default: | 223 default: |
| 224 ASSERT_NOT_REACHED(); | 224 ASSERT_NOT_REACHED(); |
| 225 } | 225 } |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace blink | 228 } // namespace blink |
| OLD | NEW |