OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 } | 72 } |
73 | 73 |
74 int refCount() const | 74 int refCount() const |
75 { | 75 { |
76 #if CHECK_REF_COUNTED_LIFECYCLE | 76 #if CHECK_REF_COUNTED_LIFECYCLE |
77 ASSERT(m_verifier.isSafeToUse()); | 77 ASSERT(m_verifier.isSafeToUse()); |
78 #endif | 78 #endif |
79 return m_refCount; | 79 return m_refCount; |
80 } | 80 } |
81 | 81 |
82 void relaxAdoptionRequirement() | |
83 { | |
84 ASSERT_WITH_SECURITY_IMPLICATION(!m_deletionHasBegun); | |
85 #if CHECK_REF_COUNTED_LIFECYCLE | |
86 ASSERT(m_adoptionIsRequired); | |
87 m_adoptionIsRequired = false; | |
88 #endif | |
89 } | |
90 | |
91 protected: | 82 protected: |
92 RefCountedBase() | 83 RefCountedBase() |
93 : m_refCount(1) | 84 : m_refCount(1) |
94 #if SECURITY_ASSERT_ENABLED | 85 #if SECURITY_ASSERT_ENABLED |
95 , m_deletionHasBegun(false) | 86 , m_deletionHasBegun(false) |
96 #endif | 87 #endif |
97 #if CHECK_REF_COUNTED_LIFECYCLE | 88 #if CHECK_REF_COUNTED_LIFECYCLE |
98 , m_adoptionIsRequired(true) | 89 , m_adoptionIsRequired(true) |
99 #endif | 90 #endif |
100 { | 91 { |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 { | 188 { |
198 } | 189 } |
199 #endif | 190 #endif |
200 }; | 191 }; |
201 | 192 |
202 } // namespace WTF | 193 } // namespace WTF |
203 | 194 |
204 using WTF::RefCounted; | 195 using WTF::RefCounted; |
205 | 196 |
206 #endif // RefCounted_h | 197 #endif // RefCounted_h |
OLD | NEW |