Commit 1a7558e3 authored by Jeremy Roman's avatar Jeremy Roman Committed by Commit Bot

Remove blink::PersistentBase::AtomicGet.

Writes to cross-thread persistents are no longer atomic (release) stores, so
this is not more safe than a non-atomic access -- its correctness depends on
external synchronization, which at the sole call site is provided by
ProcessHeap::CrossThreadPersistentMutex(), which also guards all writes to
PersistentBase::raw_ for cross-thread handles.

Bug: 736037
Change-Id: Ic47ef65b731030cdf9897f2d7dd48899514eea5e
Reviewed-on: https://chromium-review.googlesource.com/c/1351567Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611486}
parent f835280f
...@@ -197,13 +197,6 @@ class PersistentBase { ...@@ -197,13 +197,6 @@ class PersistentBase {
region.FreePersistentNode(persistent_node_); region.FreePersistentNode(persistent_node_);
} }
protected:
NO_SANITIZE_ADDRESS
T* AtomicGet() {
return reinterpret_cast<T*>(AcquireLoad(reinterpret_cast<void* volatile*>(
const_cast<typename std::remove_const<T>::type**>(&raw_))));
}
private: private:
NO_SANITIZE_ADDRESS NO_SANITIZE_ADDRESS
void Assign(T* ptr) { void Assign(T* ptr) {
...@@ -511,8 +504,6 @@ class CrossThreadPersistent ...@@ -511,8 +504,6 @@ class CrossThreadPersistent
CrossThreadPersistent(const Member<U>& other) : Parent(other) {} CrossThreadPersistent(const Member<U>& other) : Parent(other) {}
CrossThreadPersistent(WTF::HashTableDeletedValueType x) : Parent(x) {} CrossThreadPersistent(WTF::HashTableDeletedValueType x) : Parent(x) {}
T* AtomicGet() { return Parent::AtomicGet(); }
// Instead of using release(), assign then clear() instead. // Instead of using release(), assign then clear() instead.
// Using release() with per thread heap enabled can cause the object to be // Using release() with per thread heap enabled can cause the object to be
// destroyed before assigning it to a new handle. // destroyed before assigning it to a new handle.
......
...@@ -182,7 +182,7 @@ void CrossThreadPersistentRegion::PrepareForThreadStateTermination( ...@@ -182,7 +182,7 @@ void CrossThreadPersistentRegion::PrepareForThreadStateTermination(
reinterpret_cast<CrossThreadPersistent<DummyGCBase>*>( reinterpret_cast<CrossThreadPersistent<DummyGCBase>*>(
slots->slot_[i].Self()); slots->slot_[i].Self());
DCHECK(persistent); DCHECK(persistent);
void* raw_object = persistent->AtomicGet(); void* raw_object = persistent->Get();
if (!raw_object) if (!raw_object)
continue; continue;
BasePage* page = PageFromObject(raw_object); BasePage* page = PageFromObject(raw_object);
......
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