diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-16 11:45:35 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-07-17 08:59:23 +0000 |
commit | 552906b0f222c5d5dd11b9fd73829d510980461a (patch) | |
tree | 3a11e6ed0538a81dd83b20cf3a4783e297f26d91 /chromium/base/location.h | |
parent | 1b05827804eaf047779b597718c03e7d38344261 (diff) | |
download | qtwebengine-chromium-552906b0f222c5d5dd11b9fd73829d510980461a.tar.gz |
BASELINE: Update Chromium to 83.0.4103.122
Change-Id: Ie3a82f5bb0076eec2a7c6a6162326b4301ee291e
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/base/location.h')
-rw-r--r-- | chromium/base/location.h | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/chromium/base/location.h b/chromium/base/location.h index c07e747fe8f..c9057b28004 100644 --- a/chromium/base/location.h +++ b/chromium/base/location.h @@ -83,10 +83,15 @@ class BASE_EXPORT Location { // are not available, this will return "pc:<hex address>". std::string ToString() const; +#if !BUILDFLAG(FROM_HERE_USES_LOCATION_BUILTINS) +#if !BUILDFLAG(ENABLE_LOCATION_SOURCE) static Location CreateFromHere(const char* file_name); +#else static Location CreateFromHere(const char* function_name, const char* file_name, int line_number); +#endif +#endif #if SUPPORTS_LOCATION_BUILTINS && BUILDFLAG(ENABLE_LOCATION_SOURCE) static Location Current(const char* function_name = __builtin_FUNCTION(), @@ -107,20 +112,20 @@ class BASE_EXPORT Location { BASE_EXPORT const void* GetProgramCounter(); +#if BUILDFLAG(FROM_HERE_USES_LOCATION_BUILTINS) + +#define FROM_HERE ::base::Location::Current() + // The macros defined here will expand to the current function. -#if BUILDFLAG(ENABLE_LOCATION_SOURCE) +#elif BUILDFLAG(ENABLE_LOCATION_SOURCE) // Full source information should be included. -#define FROM_HERE FROM_HERE_WITH_EXPLICIT_FUNCTION(__func__) -#define FROM_HERE_WITH_EXPLICIT_FUNCTION(function_name) \ - ::base::Location::CreateFromHere(function_name, __FILE__, __LINE__) +#define FROM_HERE ::base::Location::CreateFromHere(__func__, __FILE__, __LINE__) #else // TODO(http://crbug.com/760702) remove the __FILE__ argument from these calls. #define FROM_HERE ::base::Location::CreateFromHere(__FILE__) -#define FROM_HERE_WITH_EXPLICIT_FUNCTION(function_name) \ - ::base::Location::CreateFromHere(function_name, __FILE__, -1) #endif @@ -133,7 +138,7 @@ template <> struct hash<::base::Location> { std::size_t operator()(const ::base::Location& loc) const { const void* program_counter = loc.program_counter(); - return base::Hash(&program_counter, sizeof(void*)); + return base::FastHash(base::as_bytes(base::make_span(&program_counter, 1))); } }; |