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" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 | 12 |
| 13 #ifndef NDEBUG |
| 14 #ifndef TRACK_ALL_TASK_OBJECTS |
| 15 #define TRACK_ALL_TASK_OBJECTS |
| 16 #endif // TRACK_ALL_TASK_OBJECTS |
| 17 #endif // NDEBUG |
| 18 |
13 namespace tracked_objects { | 19 namespace tracked_objects { |
14 | 20 |
15 // Location provides basic info where of an object was constructed, or was | 21 // Location provides basic info where of an object was constructed, or was |
16 // significantly brought to life. | 22 // significantly brought to life. |
17 class BASE_EXPORT Location { | 23 class BASE_EXPORT Location { |
18 public: | 24 public: |
19 // Constructor should be called with a long-lived char*, such as __FILE__. | 25 // Constructor should be called with a long-lived char*, such as __FILE__. |
20 // It assumes the provided value will persist as a global constant, and it | 26 // It assumes the provided value will persist as a global constant, and it |
21 // will not make a copy of it. | 27 // will not make a copy of it. |
22 Location(const char* function_name, | 28 Location(const char* function_name, |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Define a macro to record the current source location. | 80 // Define a macro to record the current source location. |
75 #define FROM_HERE tracked_objects::Location( \ | 81 #define FROM_HERE tracked_objects::Location( \ |
76 __FUNCTION__, \ | 82 __FUNCTION__, \ |
77 __FILE__, \ | 83 __FILE__, \ |
78 __LINE__, \ | 84 __LINE__, \ |
79 tracked_objects::GetProgramCounter()) \ | 85 tracked_objects::GetProgramCounter()) \ |
80 | 86 |
81 } // namespace tracked_objects | 87 } // namespace tracked_objects |
82 | 88 |
83 #endif // BASE_LOCATION_H_ | 89 #endif // BASE_LOCATION_H_ |
OLD | NEW |