Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1411)

Unified Diff: third_party/WebKit/Source/platform/heap/Persistent.h

Issue 2521213003: Make Oilpan's Persistent handle work with const types. (Closed)
Patch Set: add typename Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Persistent.h
diff --git a/third_party/WebKit/Source/platform/heap/Persistent.h b/third_party/WebKit/Source/platform/heap/Persistent.h
index d885e5dec7722f6e944f4fbbe1dd56d0a30133fb..08a293e316d5c5de9a692a8227184f66e7d2f322 100644
--- a/third_party/WebKit/Source/platform/heap/Persistent.h
+++ b/third_party/WebKit/Source/platform/heap/Persistent.h
@@ -167,17 +167,21 @@ class PersistentBase {
protected:
NO_SANITIZE_ADDRESS
T* atomicGet() {
- return reinterpret_cast<T*>(
- acquireLoad(reinterpret_cast<void* volatile*>(&m_raw)));
+ return reinterpret_cast<T*>(acquireLoad(reinterpret_cast<void* volatile*>(
+ const_cast<typename std::remove_const<T>::type**>(&m_raw))));
}
private:
NO_SANITIZE_ADDRESS
void assign(T* ptr) {
- if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration)
- releaseStore(reinterpret_cast<void* volatile*>(&m_raw), ptr);
- else
+ if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) {
+ releaseStore(
+ reinterpret_cast<void* volatile*>(
+ const_cast<typename std::remove_const<T>::type**>(&m_raw)),
+ const_cast<typename std::remove_const<T>::type*>(ptr));
+ } else {
m_raw = ptr;
+ }
checkPointer();
if (m_raw) {
if (!m_persistentNode)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698