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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 : m_ptr(other.get()) | 68 : m_ptr(other.get()) |
69 { | 69 { |
70 } | 70 } |
71 | 71 |
72 // Hash table deleted values, which are only constructed and never copied or
destroyed. | 72 // Hash table deleted values, which are only constructed and never copied or
destroyed. |
73 RawPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } | 73 RawPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } |
74 bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue
(); } | 74 bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedValue
(); } |
75 | 75 |
76 T* get() const { return m_ptr; } | 76 T* get() const { return m_ptr; } |
77 void clear() { m_ptr = 0; } | 77 void clear() { m_ptr = 0; } |
78 // FIXME: oilpan: Remove release and leakRef once we remove RefPtrWillBeRawP
tr. | |
79 RawPtr<T> release() | 78 RawPtr<T> release() |
80 { | 79 { |
81 RawPtr<T> tmp = m_ptr; | 80 RawPtr<T> tmp = m_ptr; |
82 m_ptr = 0; | 81 m_ptr = 0; |
83 return tmp; | 82 return tmp; |
84 } | 83 } |
85 T* leakRef() | 84 T* leakRef() |
86 { | 85 { |
87 T* ptr = m_ptr; | 86 T* ptr = m_ptr; |
88 m_ptr = 0; | 87 m_ptr = 0; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 template<typename T> inline T* getPtr(const RawPtr<T>& p) | 139 template<typename T> inline T* getPtr(const RawPtr<T>& p) |
141 { | 140 { |
142 return p.get(); | 141 return p.get(); |
143 } | 142 } |
144 | 143 |
145 } // namespace WTF | 144 } // namespace WTF |
146 | 145 |
147 using WTF::RawPtr; | 146 using WTF::RawPtr; |
148 | 147 |
149 #endif | 148 #endif |
OLD | NEW |