OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/base_export.h" | 10 #include "base/base_export.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 private: | 65 private: |
66 const char* function_name_; | 66 const char* function_name_; |
67 const char* file_name_; | 67 const char* file_name_; |
68 int line_number_; | 68 int line_number_; |
69 const void* program_counter_; | 69 const void* program_counter_; |
70 }; | 70 }; |
71 | 71 |
72 BASE_EXPORT const void* GetProgramCounter(); | 72 BASE_EXPORT const void* GetProgramCounter(); |
73 | 73 |
74 // Define a macro to record the current source location. | 74 // Define a macro to record the current source location. |
75 #define FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION(__FUNCTION__) | 75 #define FROM_HERE tracked_objects::Location( \ |
76 | 76 __FUNCTION__, \ |
77 #define FROM_HERE_WITH_EXPLICIT_FUNCTION(function_name) \ | 77 __FILE__, \ |
78 ::tracked_objects::Location(function_name, \ | 78 __LINE__, \ |
79 __FILE__, \ | 79 tracked_objects::GetProgramCounter()) \ |
80 __LINE__, \ | |
81 ::tracked_objects::GetProgramCounter()) | |
82 | 80 |
83 } // namespace tracked_objects | 81 } // namespace tracked_objects |
84 | 82 |
85 #endif // BASE_LOCATION_H_ | 83 #endif // BASE_LOCATION_H_ |
OLD | NEW |