OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #include "webrtc/base/constructormagic.h" | 27 #include "webrtc/base/constructormagic.h" |
28 #include "webrtc/base/template_util.h" | 28 #include "webrtc/base/template_util.h" |
29 #include "webrtc/typedefs.h" | 29 #include "webrtc/typedefs.h" |
30 | 30 |
31 namespace rtc { | 31 namespace rtc { |
32 | 32 |
33 template <typename T, typename Deleter = std::default_delete<T>> | 33 template <typename T, typename Deleter = std::default_delete<T>> |
34 using scoped_ptr = std::unique_ptr<T, Deleter>; | 34 using scoped_ptr = std::unique_ptr<T, Deleter>; |
35 | 35 |
36 // These used to convert between rtc::scoped_ptr and std::unique_ptr. Now they | 36 // These used to convert between std::unique_ptr and std::unique_ptr. Now they |
37 // are no-ops. | 37 // are no-ops. |
38 template <typename T> | 38 template <typename T> |
39 std::unique_ptr<T> ScopedToUnique(std::unique_ptr<T> up) { | 39 std::unique_ptr<T> ScopedToUnique(std::unique_ptr<T> up) { |
40 return up; | 40 return up; |
41 } | 41 } |
42 template <typename T> | 42 template <typename T> |
43 std::unique_ptr<T> UniqueToScoped(std::unique_ptr<T> up) { | 43 std::unique_ptr<T> UniqueToScoped(std::unique_ptr<T> up) { |
44 return up; | 44 return up; |
45 } | 45 } |
46 | 46 |
47 } // namespace rtc | 47 } // namespace rtc |
48 | 48 |
49 #endif // #ifndef WEBRTC_BASE_SCOPED_PTR_H__ | 49 #endif // #ifndef WEBRTC_BASE_SCOPED_PTR_H__ |
OLD | NEW |