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