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

Unified Diff: base/location.h

Issue 2399053004: Move GetProgramCounter in FROM_HERE to a common function (Closed)
Patch Set: -BASE_EXPORT Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/BUILD.gn ('k') | base/location.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/location.h
diff --git a/base/location.h b/base/location.h
index dd78515ce2b003b9ede74e8a59bff7d7451a7548..a036844e34708b163ceecc22b19fff9d7dbf0d23 100644
--- a/base/location.h
+++ b/base/location.h
@@ -33,6 +33,11 @@ class BASE_EXPORT Location {
// Copy constructor.
Location(const Location& other);
+ static Location CreateForCurrentProgramCounter(
+ const char* function_name,
+ const char* file_name,
+ int line_number);
+
// Comparator for hash map insertion.
// No need to use |function_name_| since the other two fields uniquely
// identify this location.
@@ -99,11 +104,9 @@ BASE_EXPORT const void* GetProgramCounter();
// Define a macro to record the current source location.
#define FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION(__func__)
-#define FROM_HERE_WITH_EXPLICIT_FUNCTION(function_name) \
- ::tracked_objects::Location(function_name, \
- __FILE__, \
- __LINE__, \
- ::tracked_objects::GetProgramCounter())
+#define FROM_HERE_WITH_EXPLICIT_FUNCTION(function_name) \
+ ::tracked_objects::Location::CreateForCurrentProgramCounter( \
+ function_name, __FILE__, __LINE__) \
} // namespace tracked_objects
« no previous file with comments | « base/BUILD.gn ('k') | base/location.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698