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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef WTF_OwnPtr_h | 22 #ifndef WTF_OwnPtr_h |
| 23 #define WTF_OwnPtr_h | 23 #define WTF_OwnPtr_h |
| 24 | 24 |
| 25 #include "wtf/HashTableDeletedValueType.h" | 25 #include "wtf/HashTableDeletedValueType.h" |
| 26 #include "wtf/Noncopyable.h" | 26 #include "wtf/Noncopyable.h" |
| 27 #include "wtf/NullPtr.h" | 27 #include "wtf/NullPtr.h" |
| 28 #include "wtf/OwnPtrCommon.h" | 28 #include "wtf/OwnPtrCommon.h" |
| 29 #include <algorithm> | 29 #include <algorithm> // For std::swap |
|
Nico
2015/04/16 21:16:56
remove comment
Nico
2015/04/16 21:16:56
add <utiility> :-/
| |
| 30 | 30 |
| 31 namespace WTF { | 31 namespace WTF { |
| 32 | 32 |
| 33 template<typename T> class PassOwnPtr; | 33 template<typename T> class PassOwnPtr; |
| 34 | 34 |
| 35 template<typename T> class OwnPtr { | 35 template<typename T> class OwnPtr { |
| 36 WTF_MAKE_NONCOPYABLE(OwnPtr); | 36 WTF_MAKE_NONCOPYABLE(OwnPtr); |
| 37 public: | 37 public: |
| 38 typedef typename RemoveExtent<T>::Type ValueType; | 38 typedef typename RemoveExtent<T>::Type ValueType; |
| 39 typedef ValueType* PtrType; | 39 typedef ValueType* PtrType; |
| (...skipping 176 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) | 216 template<typename T> inline typename OwnPtr<T>::PtrType getPtr(const OwnPtr< T>& p) |
| 217 { | 217 { |
| 218 return p.get(); | 218 return p.get(); |
| 219 } | 219 } |
| 220 | 220 |
| 221 } // namespace WTF | 221 } // namespace WTF |
| 222 | 222 |
| 223 using WTF::OwnPtr; | 223 using WTF::OwnPtr; |
| 224 | 224 |
| 225 #endif // WTF_OwnPtr_h | 225 #endif // WTF_OwnPtr_h |
| OLD | NEW |