OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_ | 5 #ifndef BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_ |
6 #define BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_ | 6 #define BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 // We use this trick so we don't need to include bind.h in a header | 30 // We use this trick so we don't need to include bind.h in a header |
31 // file like sequenced_task_runner.h. We also wrap the helpers in a | 31 // file like sequenced_task_runner.h. We also wrap the helpers in a |
32 // templated class to make it easier for users of DeleteSoon to | 32 // templated class to make it easier for users of DeleteSoon to |
33 // declare the helper as a friend. | 33 // declare the helper as a friend. |
34 template <class T> | 34 template <class T> |
35 class DeleteHelper { | 35 class DeleteHelper { |
36 private: | 36 private: |
37 template <class T2, class R> friend class subtle::DeleteHelperInternal; | 37 template <class T2, class R> friend class subtle::DeleteHelperInternal; |
38 | 38 |
39 static void DoDelete(const void* object) { | 39 static void DoDelete(const void* object) { |
40 // TODO(tzik): Remove this after http://crbug.com/393634 is fixed. | |
41 const char* function_name = __FUNCTION__; | |
42 debug::Alias(&function_name); | |
43 | |
44 delete reinterpret_cast<const T*>(object); | 40 delete reinterpret_cast<const T*>(object); |
45 } | 41 } |
46 | 42 |
47 DISALLOW_COPY_AND_ASSIGN(DeleteHelper); | 43 DISALLOW_COPY_AND_ASSIGN(DeleteHelper); |
48 }; | 44 }; |
49 | 45 |
50 template <class T> | 46 template <class T> |
51 class ReleaseHelper { | 47 class ReleaseHelper { |
52 private: | 48 private: |
53 template <class T2, class R> friend class subtle::ReleaseHelperInternal; | 49 template <class T2, class R> friend class subtle::ReleaseHelperInternal; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 104 |
109 private: | 105 private: |
110 DISALLOW_COPY_AND_ASSIGN(ReleaseHelperInternal); | 106 DISALLOW_COPY_AND_ASSIGN(ReleaseHelperInternal); |
111 }; | 107 }; |
112 | 108 |
113 } // namespace subtle | 109 } // namespace subtle |
114 | 110 |
115 } // namespace base | 111 } // namespace base |
116 | 112 |
117 #endif // BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_ | 113 #endif // BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_ |
OLD | NEW |