| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SelfKeepAlive_h | 5 #ifndef SelfKeepAlive_h |
| 6 #define SelfKeepAlive_h | 6 #define SelfKeepAlive_h |
| 7 | 7 |
| 8 #include "platform/heap/Persistent.h" | 8 #include "platform/heap/Persistent.h" |
| 9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
| 10 #include "wtf/Assertions.h" | 10 #include "wtf/Assertions.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 assign(self); | 54 assign(self); |
| 55 return *this; | 55 return *this; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void clear() { m_keepAlive.clear(); } | 58 void clear() { m_keepAlive.clear(); } |
| 59 | 59 |
| 60 explicit operator bool() const { return m_keepAlive; } | 60 explicit operator bool() const { return m_keepAlive; } |
| 61 | 61 |
| 62 private: | 62 private: |
| 63 void assign(Self* self) { | 63 void assign(Self* self) { |
| 64 ASSERT(!m_keepAlive || m_keepAlive.get() == self); | 64 DCHECK(!m_keepAlive || m_keepAlive.get() == self); |
| 65 m_keepAlive = self; | 65 m_keepAlive = self; |
| 66 } | 66 } |
| 67 | 67 |
| 68 GC_PLUGIN_IGNORE("420515") | 68 GC_PLUGIN_IGNORE("420515") |
| 69 Persistent<Self> m_keepAlive; | 69 Persistent<Self> m_keepAlive; |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace blink | 72 } // namespace blink |
| 73 | 73 |
| 74 #endif // SelfKeepAlive_h | 74 #endif // SelfKeepAlive_h |
| OLD | NEW |