Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/3rdparty/masm/stubs/wtf/RefPtr.h |
Switch to Source code | Preprocessed file |
Line | Source | Count | ||||||
---|---|---|---|---|---|---|---|---|
1 | - | |||||||
2 | template <typename T> | - | ||||||
3 | class RefPtr { | - | ||||||
4 | public: | - | ||||||
5 | RefPtr() : m_ptr(0) {} executed 5777311 times by 153 tests: end of block Executed by:
| 5777311 | ||||||
6 | RefPtr(const RefPtr<T> &other) | - | ||||||
7 | : m_ptr(other.m_ptr) | - | ||||||
8 | { | - | ||||||
9 | if (m_ptr
| 0-13188 | ||||||
10 | m_ptr->ref(); executed 13188 times by 64 tests: m_ptr->ref(); Executed by:
| 13188 | ||||||
11 | } executed 13188 times by 64 tests: end of block Executed by:
| 13188 | ||||||
12 | - | |||||||
13 | RefPtr<T>& operator=(const RefPtr<T>& other) | - | ||||||
14 | { | - | ||||||
15 | if (other.m_ptr
| 0-2328913 | ||||||
16 | other.m_ptr->ref(); executed 2328896 times by 153 tests: other.m_ptr->ref(); Executed by:
| 2328896 | ||||||
17 | if (m_ptr
| 0-2329141 | ||||||
18 | m_ptr->deref(); never executed: m_ptr->deref(); | 0 | ||||||
19 | m_ptr = other.m_ptr; | - | ||||||
20 | return executed 2329155 times by 153 tests: *this;return *this; Executed by:
executed 2329155 times by 153 tests: return *this; Executed by:
| 2329155 | ||||||
21 | } | - | ||||||
22 | - | |||||||
23 | RefPtr(const PassRefPtr<T>& other) | - | ||||||
24 | : m_ptr(other.leakRef()) | - | ||||||
25 | { | - | ||||||
26 | } executed 3492566 times by 153 tests: end of block Executed by:
| 3492566 | ||||||
27 | - | |||||||
28 | ~RefPtr() | - | ||||||
29 | { | - | ||||||
30 | if (m_ptr
| 4618635-4670963 | ||||||
31 | m_ptr->deref(); executed 4671008 times by 153 tests: m_ptr->deref(); Executed by:
| 4671008 | ||||||
32 | } executed 9288445 times by 153 tests: end of block Executed by:
| 9288445 | ||||||
33 | - | |||||||
34 | T* operator->() const { return executed 8158697 times by 153 tests: m_ptr;return m_ptr; Executed by:
executed 8158697 times by 153 tests: }return m_ptr; Executed by:
| 8158697 | ||||||
35 | T* get() const { return executed 1164583 times by 153 tests: m_ptr;return m_ptr; Executed by:
executed 1164583 times by 153 tests: }return m_ptr; Executed by:
| 1164583 | ||||||
36 | bool operator!() const { return executed 4665768 times by 153 tests: !m_ptr;return !m_ptr; Executed by:
executed 4665768 times by 153 tests: }return !m_ptr; Executed by:
| 4665768 | ||||||
37 | - | |||||||
38 | PassRefPtr<T> release() | - | ||||||
39 | { | - | ||||||
40 | T* ptr = m_ptr; | - | ||||||
41 | m_ptr = 0; | - | ||||||
42 | return executed 1164569 times by 153 tests: adoptRef(ptr);return adoptRef(ptr); Executed by:
executed 1164569 times by 153 tests: return adoptRef(ptr); Executed by:
| 1164569 | ||||||
43 | } | - | ||||||
44 | - | |||||||
45 | private: | - | ||||||
46 | T* m_ptr; | - | ||||||
47 | }; | - | ||||||
Switch to Source code | Preprocessed file |