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

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

Issue 2694173002: Remove thread-local weak processing (Closed)
Patch Set: temp Created 3 years, 10 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/Visitor.h
diff --git a/third_party/WebKit/Source/platform/heap/Visitor.h b/third_party/WebKit/Source/platform/heap/Visitor.h
index 1011efe62e0ea9dc2c9cb7d71c64266d2d21c05f..54b51fc9f8e1c4d6cac2894f50debaa80cabb479 100644
--- a/third_party/WebKit/Source/platform/heap/Visitor.h
+++ b/third_party/WebKit/Source/platform/heap/Visitor.h
@@ -220,7 +220,7 @@ class PLATFORM_EXPORT Visitor {
// threads are stopped during weak cell callbacks.
template <typename T>
void registerWeakCell(T** cell) {
- registerWeakCellWithCallback(
+ registerWeakCallback(
reinterpret_cast<void**>(
const_cast<typename std::remove_const<T>::type**>(cell)),
&handleWeakCell<T>);
@@ -228,12 +228,10 @@ class PLATFORM_EXPORT Visitor {
template <typename T, void (T::*method)(Visitor*)>
void registerWeakMembers(const T* obj) {
- registerWeakMembers(obj, &TraceMethodDelegate<T, method>::trampoline);
+ registerWeakCallback(const_cast<T*>(obj),
+ &TraceMethodDelegate<T, method>::trampoline);
}
- void registerWeakMembers(const void* object, WeakCallback callback) {
- registerWeakMembers(object, object, callback);
- }
inline void registerBackingStoreReference(void* slot);
@@ -270,17 +268,7 @@ class PLATFORM_EXPORT Visitor {
// that even removing things from HeapHashSet or HeapHashMap can cause
// an allocation if the backing store resizes, but these collections know
// how to remove WeakMember elements safely.
- //
- // The weak pointer callbacks are run on the thread that owns the
- // object and other threads are not stopped during the
- // callbacks. Since isAlive is used in the callback to determine
- // if objects pointed to are alive it is crucial that the object
- // pointed to belong to the same thread as the object receiving
- // the weak callback. Since other threads have been resumed the
- // mark bits are not valid for objects from other threads.
- inline void registerWeakMembers(const void* closure,
- const void* pointer,
- WeakCallback);
+ inline void registerWeakCallback(void* closure, WeakCallback);
inline void registerWeakTable(const void* closure,
EphemeronCallback iterationCallback,
@@ -292,8 +280,6 @@ class PLATFORM_EXPORT Visitor {
inline bool ensureMarked(const void* pointer);
- inline void registerWeakCellWithCallback(void** cell, WeakCallback);
-
inline void markNoTracing(const void* pointer) {
mark(pointer, reinterpret_cast<TraceCallback>(0));
}
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.cpp ('k') | third_party/WebKit/Source/platform/heap/VisitorImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698