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/third_party/blink/renderer/platform/wtf/hash_map.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/third_party/blink/renderer/platform/wtf/hash_map.h')
-rw-r--r-- | chromium/third_party/blink/renderer/platform/wtf/hash_map.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chromium/third_party/blink/renderer/platform/wtf/hash_map.h b/chromium/third_party/blink/renderer/platform/wtf/hash_map.h index 46b39e0697f..88fc20f0ea1 100644 --- a/chromium/third_party/blink/renderer/platform/wtf/hash_map.h +++ b/chromium/third_party/blink/renderer/platform/wtf/hash_map.h @@ -22,6 +22,7 @@ #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_WTF_HASH_MAP_H_ #include <initializer_list> +#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h" #include "third_party/blink/renderer/platform/wtf/allocator/partition_allocator.h" #include "third_party/blink/renderer/platform/wtf/construct_traits.h" #include "third_party/blink/renderer/platform/wtf/hash_table.h" @@ -43,6 +44,12 @@ struct KeyValuePairKeyExtractor { static const typename T::KeyType& Extract(const T& p) { return p.key; } + // Assumes out points to a buffer of size at least sizeof(T::KeyType). + template <typename T> + static const typename T::KeyType& ExtractSafe(const T& p, void* out) { + AtomicReadMemcpy<sizeof(typename T::KeyType)>(out, &p.key); + return *reinterpret_cast<typename T::KeyType*>(out); + } }; // Note: empty or deleted key values are not allowed, using them may lead to @@ -202,7 +209,8 @@ class HashMap { static bool IsValidKey(const IncomingKeyType&); template <typename VisitorDispatcher, typename A = Allocator> - std::enable_if_t<A::kIsGarbageCollected> Trace(VisitorDispatcher visitor) { + std::enable_if_t<A::kIsGarbageCollected> Trace( + VisitorDispatcher visitor) const { impl_.Trace(visitor); } |