Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 | 46 |
| 47 template<typename T> class HeapTerminatedArray; | 47 template<typename T> class HeapTerminatedArray; |
| 48 | 48 |
| 49 class PersistentNode { | 49 class PersistentNode { |
| 50 public: | 50 public: |
| 51 explicit PersistentNode(TraceCallback trace) | 51 explicit PersistentNode(TraceCallback trace) |
| 52 : m_trace(trace) | 52 : m_trace(trace) |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 NO_SANITIZE_ADDRESS | |
|
haraken
2015/05/01 15:12:32
This looks valid.
| |
| 56 bool isHeapObjectAlive() { return m_trace; } | 57 bool isHeapObjectAlive() { return m_trace; } |
| 57 | 58 |
| 58 virtual ~PersistentNode() | 59 virtual ~PersistentNode() |
| 59 { | 60 { |
| 60 ASSERT(isHeapObjectAlive()); | 61 ASSERT(isHeapObjectAlive()); |
| 61 m_trace = nullptr; | 62 m_trace = nullptr; |
| 62 } | 63 } |
| 63 | 64 |
| 64 // Ideally the trace method should be virtual and automatically dispatch | 65 // Ideally the trace method should be virtual and automatically dispatch |
| 65 // to the most specific implementation. However having a virtual method | 66 // to the most specific implementation. However having a virtual method |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 MutexLocker m_locker; | 118 MutexLocker m_locker; |
| 118 }; | 119 }; |
| 119 }; | 120 }; |
| 120 | 121 |
| 121 // Base class for persistent handles. RootsAccessor specifies which list to | 122 // Base class for persistent handles. RootsAccessor specifies which list to |
| 122 // link resulting handle into. Owner specifies the class containing trace | 123 // link resulting handle into. Owner specifies the class containing trace |
| 123 // method. | 124 // method. |
| 124 template<typename RootsAccessor, typename Owner> | 125 template<typename RootsAccessor, typename Owner> |
| 125 class PersistentBase : public PersistentNode { | 126 class PersistentBase : public PersistentNode { |
| 126 public: | 127 public: |
| 128 NO_SANITIZE_ADDRESS | |
|
haraken
2015/05/01 15:12:31
This looks valid.
| |
| 127 ~PersistentBase() | 129 ~PersistentBase() |
| 128 { | 130 { |
| 129 typename RootsAccessor::Lock lock; | 131 typename RootsAccessor::Lock lock; |
| 130 ASSERT(m_roots == RootsAccessor::roots()); // Check that the thread is u sing the same roots list. | 132 ASSERT(m_roots == RootsAccessor::roots()); // Check that the thread is u sing the same roots list. |
| 131 ASSERT(isHeapObjectAlive()); | 133 ASSERT(isHeapObjectAlive()); |
| 132 ASSERT(m_next->isHeapObjectAlive()); | 134 ASSERT(m_next->isHeapObjectAlive()); |
| 133 ASSERT(m_prev->isHeapObjectAlive()); | 135 ASSERT(m_prev->isHeapObjectAlive()); |
| 134 m_next->m_prev = m_prev; | 136 m_next->m_prev = m_prev; |
| 135 m_prev->m_next = m_next; | 137 m_prev->m_next = m_next; |
| 136 } | 138 } |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1078 template<typename T> | 1080 template<typename T> |
| 1079 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> { | 1081 struct ParamStorageTraits<RawPtr<T>> : public PointerParamStorageTraits<T*, blin k::IsGarbageCollectedType<T>::value> { |
| 1080 }; | 1082 }; |
| 1081 | 1083 |
| 1082 template<typename T> | 1084 template<typename T> |
| 1083 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; | 1085 PassRefPtr<T> adoptRef(blink::RefCountedGarbageCollected<T>*) = delete; |
| 1084 | 1086 |
| 1085 } // namespace WTF | 1087 } // namespace WTF |
| 1086 | 1088 |
| 1087 #endif | 1089 #endif |
| OLD | NEW |