Commit 9685f973 authored by Jose Dapena Paz's avatar Jose Dapena Paz Committed by Commit Bot

GCC: avoid GCC getting confused with wrong using resolution in CrossThreadPersistent

In the method to assign a CrossThreadWeakPersistent<U> to a CrossThreadPersistent<T>,
there is a call to the parent class implementation of Get. It uses Parent, that is,
in CrossThreadPersistent<T> an alias to its parent. GCC resolves it as that, but
that's wrong, and it should resolve to the parent of CrossThreadWeakPersistent<U>.

To avoid the problem, we define in that method ParentU resolving to the right
parent, and use a static cast to it.

Bug: 819294
Change-Id: I0152dac92d4a28eb1f1abbc56473204b62f33797
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2412138Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: José Dapena Paz <jdapena@igalia.com>
Cr-Commit-Position: refs/heads/master@{#807452}
parent a4b1a473
......@@ -784,7 +784,9 @@ template <typename U>
CrossThreadPersistent<T>& CrossThreadPersistent<T>::operator=(
const CrossThreadWeakPersistent<U>& other) {
MutexLocker locker(ProcessHeap::CrossThreadPersistentMutex());
this->AssignUnsafe(other.Parent::Get());
using ParentU = PersistentBase<U, kWeakPersistentConfiguration,
kCrossThreadPersistentConfiguration>;
this->AssignUnsafe(static_cast<const ParentU&>(other).Get());
return *this;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment