diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/base/threading/sequence_bound.h | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/threading/sequence_bound.h')
-rw-r--r-- | chromium/base/threading/sequence_bound.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/chromium/base/threading/sequence_bound.h b/chromium/base/threading/sequence_bound.h index b235fe221c3..3ee8ef6e4c9 100644 --- a/chromium/base/threading/sequence_bound.h +++ b/chromium/base/threading/sequence_bound.h @@ -94,26 +94,6 @@ namespace base { // SequenceBound<MyDerivedClass>(main_task_runner, ctor args); // auto c = new SomeConsumer(std::move(widget)); // upcasts to MyClass -namespace internal { - -// If we can't cast |Base*| into |Derived*|, then it's a virtual base if and -// only if |Base| is actually a base class of |Derived|. Otherwise (including -// unrelated types), it isn't. We default to Derived* so that the -// specialization below will apply when the cast to |Derived*| is valid. -template <typename Base, typename Derived, typename = Derived*> -struct is_virtual_base_of : public std::is_base_of<Base, Derived> {}; - -// If we can cast |Base*| into |Derived*|, then it's definitely not a virtual -// base. When this happens, we'll match the default third template argument. -template <typename Base, typename Derived> -struct is_virtual_base_of<Base, - Derived, - decltype(static_cast<Derived*>( - static_cast<Base*>(nullptr)))> : std::false_type { -}; - -} // namespace internal - template <typename T> class SequenceBound { public: @@ -134,7 +114,9 @@ class SequenceBound { Args&&... args) : impl_task_runner_(std::move(task_runner)) { // Allocate space for but do not construct an instance of |T|. - storage_ = AlignedAlloc(sizeof(T), alignof(T)); + // AlignedAlloc() requires alignment be a multiple of sizeof(void*). + storage_ = AlignedAlloc( + sizeof(T), sizeof(void*) > alignof(T) ? sizeof(void*) : alignof(T)); t_ = reinterpret_cast<T*>(storage_); // Post construction to the impl thread. |