Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 OwnPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } | 49 OwnPtr(HashTableDeletedValueType) : m_ptr(hashTableDeletedValue()) { } |
| 50 bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedV alue(); } | 50 bool isHashTableDeletedValue() const { return m_ptr == hashTableDeletedV alue(); } |
| 51 | 51 |
| 52 ~OwnPtr() | 52 ~OwnPtr() |
| 53 { | 53 { |
| 54 OwnedPtrDeleter<T>::deletePtr(m_ptr); | 54 OwnedPtrDeleter<T>::deletePtr(m_ptr); |
| 55 m_ptr = 0; | 55 m_ptr = 0; |
| 56 } | 56 } |
| 57 | 57 |
| 58 PtrType get() const { return m_ptr; } | 58 PtrType get() const { return m_ptr; } |
| 59 ValueType& getReference() const { ASSERT(m_ptr); return *m_ptr; }; | |
|
Julien - ping for review
2015/03/16 15:27:54
Note that this is basically operator* so it seems
Sunil Ratnu
2015/03/17 11:31:19
Done. Now using operator* itself instead of the ne
| |
| 59 | 60 |
| 60 void clear(); | 61 void clear(); |
| 61 PassOwnPtr<T> release(); | 62 PassOwnPtr<T> release(); |
| 62 PtrType leakPtr() WARN_UNUSED_RETURN; | 63 PtrType leakPtr() WARN_UNUSED_RETURN; |
| 63 | 64 |
| 64 ValueType& operator*() const { ASSERT(m_ptr); return *m_ptr; } | 65 ValueType& operator*() const { ASSERT(m_ptr); return *m_ptr; } |
| 65 PtrType operator->() const { ASSERT(m_ptr); return m_ptr; } | 66 PtrType operator->() const { ASSERT(m_ptr); return m_ptr; } |
| 66 | 67 |
| 67 ValueType& operator[](std::ptrdiff_t i) const; | 68 ValueType& operator[](std::ptrdiff_t i) const; |
| 68 | 69 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 template<typename T> inline typename OwnPtr<T>::PtrType getPtr(const OwnPtr< T>& p) | 217 template<typename T> inline typename OwnPtr<T>::PtrType getPtr(const OwnPtr< T>& p) |
| 217 { | 218 { |
| 218 return p.get(); | 219 return p.get(); |
| 219 } | 220 } |
| 220 | 221 |
| 221 } // namespace WTF | 222 } // namespace WTF |
| 222 | 223 |
| 223 using WTF::OwnPtr; | 224 using WTF::OwnPtr; |
| 224 | 225 |
| 225 #endif // WTF_OwnPtr_h | 226 #endif // WTF_OwnPtr_h |
| OLD | NEW |