| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/3rdparty/masm/stubs/wtf/PassRefPtr.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | template <typename T> class RefPtr; | - | ||||||
| 2 | - | |||||||
| 3 | template <typename T> | - | ||||||
| 4 | class PassRefPtr { | - | ||||||
| 5 | public: | - | ||||||
| 6 | PassRefPtr() : m_ptr(0) {} executed 2326540 times by 153 tests: end of blockExecuted by:
| 2326540 | ||||||
| 7 | - | |||||||
| 8 | PassRefPtr(T* ptr) | - | ||||||
| 9 | : m_ptr(ptr) | - | ||||||
| 10 | { | - | ||||||
| 11 | if (m_ptr
| 0 | ||||||
| 12 | m_ptr->ref(); never executed: m_ptr->ref(); | 0 | ||||||
| 13 | } never executed: end of block | 0 | ||||||
| 14 | - | |||||||
| 15 | PassRefPtr(const PassRefPtr<T>& other) | - | ||||||
| 16 | : m_ptr(other.leakRef()) | - | ||||||
| 17 | { | - | ||||||
| 18 | } never executed: end of block | 0 | ||||||
| 19 | - | |||||||
| 20 | PassRefPtr(const RefPtr<T>& other) | - | ||||||
| 21 | : m_ptr(other.get()) | - | ||||||
| 22 | { | - | ||||||
| 23 | if (m_ptr
| 0-1164584 | ||||||
| 24 | m_ptr->ref(); executed 1164584 times by 153 tests: m_ptr->ref();Executed by:
| 1164584 | ||||||
| 25 | } executed 1164586 times by 153 tests: end of blockExecuted by:
| 1164586 | ||||||
| 26 | - | |||||||
| 27 | ~PassRefPtr() | - | ||||||
| 28 | { | - | ||||||
| 29 | if (m_ptr
| 0-3492248 | ||||||
| 30 | m_ptr->deref(); never executed: m_ptr->deref(); | 0 | ||||||
| 31 | } executed 3492955 times by 153 tests: end of blockExecuted by:
| 3492955 | ||||||
| 32 | - | |||||||
| 33 | T* operator->() const { return executed 1164586 times by 153 tests: m_ptr;return m_ptr;Executed by:
executed 1164586 times by 153 tests: }return m_ptr;Executed by:
| 1164586 | ||||||
| 34 | - | |||||||
| 35 | T* leakRef() const | - | ||||||
| 36 | { | - | ||||||
| 37 | T* result = m_ptr; | - | ||||||
| 38 | m_ptr = 0; | - | ||||||
| 39 | return executed 3492557 times by 153 tests: result;return result;Executed by:
executed 3492557 times by 153 tests: return result;Executed by:
| 3492557 | ||||||
| 40 | } | - | ||||||
| 41 | - | |||||||
| 42 | private: | - | ||||||
| 43 | PassRefPtr<T>& operator=(const PassRefPtr<T>& t); | - | ||||||
| 44 | - | |||||||
| 45 | template <typename PtrType> friend PassRefPtr<PtrType> adoptRef(PtrType*); | - | ||||||
| 46 | mutable T* m_ptr; | - | ||||||
| 47 | }; | - | ||||||
| 48 | - | |||||||
| 49 | template <typename T> | - | ||||||
| 50 | PassRefPtr<T> adoptRef(T* ptr) | - | ||||||
| 51 | { | - | ||||||
| 52 | PassRefPtr<T> result; | - | ||||||
| 53 | result.m_ptr = ptr; | - | ||||||
| 54 | return executed 2326577 times by 153 tests: result;return result;Executed by:
executed 2326577 times by 153 tests: return result;Executed by:
| 2326577 | ||||||
| 55 | } | - | ||||||
| Switch to Source code | Preprocessed file |