Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: base/sequenced_task_runner_helpers.h

Issue 522643003: [DoDelete] Hold function name in Deletehelper::DoDelete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10
10 // TODO(akalin): Investigate whether it's possible to just have 11 // TODO(akalin): Investigate whether it's possible to just have
11 // SequencedTaskRunner use these helpers (instead of MessageLoop). 12 // SequencedTaskRunner use these helpers (instead of MessageLoop).
12 // Then we can just move these to sequenced_task_runner.h. 13 // Then we can just move these to sequenced_task_runner.h.
13 14
14 namespace tracked_objects { 15 namespace tracked_objects {
15 class Location; 16 class Location;
16 } 17 }
17 18
18 namespace base { 19 namespace base {
(...skipping 10 matching lines...) Expand all
29 // 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
30 // 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
31 // templated class to make it easier for users of DeleteSoon to 32 // templated class to make it easier for users of DeleteSoon to
32 // declare the helper as a friend. 33 // declare the helper as a friend.
33 template <class T> 34 template <class T>
34 class DeleteHelper { 35 class DeleteHelper {
35 private: 36 private:
36 template <class T2, class R> friend class subtle::DeleteHelperInternal; 37 template <class T2, class R> friend class subtle::DeleteHelperInternal;
37 38
38 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
39 delete reinterpret_cast<const T*>(object); 44 delete reinterpret_cast<const T*>(object);
40 } 45 }
41 46
42 DISALLOW_COPY_AND_ASSIGN(DeleteHelper); 47 DISALLOW_COPY_AND_ASSIGN(DeleteHelper);
43 }; 48 };
44 49
45 template <class T> 50 template <class T>
46 class ReleaseHelper { 51 class ReleaseHelper {
47 private: 52 private:
48 template <class T2, class R> friend class subtle::ReleaseHelperInternal; 53 template <class T2, class R> friend class subtle::ReleaseHelperInternal;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 108
104 private: 109 private:
105 DISALLOW_COPY_AND_ASSIGN(ReleaseHelperInternal); 110 DISALLOW_COPY_AND_ASSIGN(ReleaseHelperInternal);
106 }; 111 };
107 112
108 } // namespace subtle 113 } // namespace subtle
109 114
110 } // namespace base 115 } // namespace base
111 116
112 #endif // BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_ 117 #endif // BASE_SEQUENCED_TASK_RUNNER_HELPERS_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698