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

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

Issue 2019963002: Remove get from CrossThreadPersistent to avoid accidental use Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months 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
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 62ae0943988b600eeec328b449920b31dc98c31e..52133f20b1ece8bbe0fadfe3de405bfc12ac2f3d 100644
--- a/third_party/WebKit/Source/platform/heap/Persistent.h
+++ b/third_party/WebKit/Source/platform/heap/Persistent.h
@@ -383,7 +383,7 @@ public:
CrossThreadPersistent(const Member<U>& other) : Parent(other) { }
CrossThreadPersistent(WTF::HashTableDeletedValueType x) : Parent(x) { }
- T* atomicGet() { return Parent::atomicGet(); }
+ T* unsafeGet() const { return Parent::get(); }
template<typename U>
CrossThreadPersistent& operator=(U* other)
@@ -417,6 +417,13 @@ public:
Parent::operator=(other);
return *this;
}
+
+protected:
+ friend class CrossThreadPersistentRegion;
+ friend struct WTF::PointerParamStorageTraits<T*, true>;
+
+ T* get() const { return Parent::get(); }
sof 2016/06/02 07:00:12 Could you add a comment (here or next to unsafeGet
+ T* atomicGet() { return Parent::atomicGet(); }
};
// Combines the behavior of CrossThreadPersistent and WeakPersistent.
@@ -677,6 +684,12 @@ CrossThreadPersistent<T> wrapCrossThreadPersistent(T* value)
return CrossThreadPersistent<T>(value);
}
+template <typename T>
+CrossThreadPersistent<T> wrapCrossThreadPersistent(CrossThreadPersistent<T> value)
+{
+ return CrossThreadPersistent<T>(value);
+}
+
// Comparison operators between (Weak)Members, Persistents, and UntracedMembers.
template<typename T, typename U> inline bool operator==(const Member<T>& a, const Member<U>& b) { return a.get() == b.get(); }
template<typename T, typename U> inline bool operator!=(const Member<T>& a, const Member<U>& b) { return a.get() != b.get(); }

Powered by Google App Engine
This is Rietveld 408576698