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_LOCATION_H_ | 5 #ifndef BASE_LOCATION_H_ |
6 #define BASE_LOCATION_H_ | 6 #define BASE_LOCATION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <cassert> | 10 #include <cassert> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 ~LocationSnapshot(); | 90 ~LocationSnapshot(); |
91 | 91 |
92 std::string file_name; | 92 std::string file_name; |
93 std::string function_name; | 93 std::string function_name; |
94 int line_number; | 94 int line_number; |
95 }; | 95 }; |
96 | 96 |
97 BASE_EXPORT const void* GetProgramCounter(); | 97 BASE_EXPORT const void* GetProgramCounter(); |
98 | 98 |
99 // Define a macro to record the current source location. | 99 // Define a macro to record the current source location. |
100 #define FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION(__FUNCTION__) | 100 #define FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION(__func__) |
101 | 101 |
102 #define FROM_HERE_WITH_EXPLICIT_FUNCTION(function_name) \ | 102 #define FROM_HERE_WITH_EXPLICIT_FUNCTION(function_name) \ |
103 ::tracked_objects::Location(function_name, \ | 103 ::tracked_objects::Location(function_name, \ |
104 __FILE__, \ | 104 __FILE__, \ |
105 __LINE__, \ | 105 __LINE__, \ |
106 ::tracked_objects::GetProgramCounter()) | 106 ::tracked_objects::GetProgramCounter()) |
107 | 107 |
108 } // namespace tracked_objects | 108 } // namespace tracked_objects |
109 | 109 |
110 #endif // BASE_LOCATION_H_ | 110 #endif // BASE_LOCATION_H_ |
OLD | NEW |