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

Unified Diff: third_party/WebKit/Source/core/dom/WeakIdentifierMap.h

Issue 1855203002: Revert of Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/core/dom/WeakIdentifierMap.h
diff --git a/third_party/WebKit/Source/core/dom/WeakIdentifierMap.h b/third_party/WebKit/Source/core/dom/WeakIdentifierMap.h
index 07599c6ef06dcd7670197596f24c57b9e0f0cb06..b62279eb3188dc5f99aa19004198b217c2039163 100644
--- a/third_party/WebKit/Source/core/dom/WeakIdentifierMap.h
+++ b/third_party/WebKit/Source/core/dom/WeakIdentifierMap.h
@@ -39,6 +39,7 @@
USING_FAST_MALLOC(WeakIdentifierMap);
public:
using IdentifierType = typename Generator::IdentifierType;
+ using ReferenceType = RawPtr<WeakIdentifierMap<T, Generator, Traits, false>>;
static IdentifierType identifier(T* object)
{
@@ -92,6 +93,7 @@
: public GarbageCollected<WeakIdentifierMap<T, Generator, Traits, true>> {
public:
using IdentifierType = typename Generator::IdentifierType;
+ using ReferenceType = Persistent<WeakIdentifierMap<T, Generator, Traits, true>>;
static IdentifierType identifier(T* object)
{
@@ -144,15 +146,14 @@
template<> WeakIdentifierMap<T, ##__VA_ARGS__>& WeakIdentifierMap<T, ##__VA_ARGS__>::instance(); \
extern template class WeakIdentifierMap<T, ##__VA_ARGS__>;
-#define DEFINE_WEAK_IDENTIFIER_MAP(T, ...) \
+#define DEFINE_WEAK_IDENTIFIER_MAP(T, ...) \
template class WeakIdentifierMap<T, ##__VA_ARGS__>; \
template<> WeakIdentifierMap<T, ##__VA_ARGS__>& WeakIdentifierMap<T, ##__VA_ARGS__>::instance() \
{ \
- using RefType = WeakIdentifierMap<T, ##__VA_ARGS__>; \
+ using RefType = WeakIdentifierMap<T, ##__VA_ARGS__>::ReferenceType; \
DEFINE_STATIC_LOCAL(RefType, mapInstance, (new WeakIdentifierMap<T, ##__VA_ARGS__>())); \
- return mapInstance; \
+ return *mapInstance; \
}
-
} // namespace blink
#endif // WeakIdentifierMap_h

Powered by Google App Engine
This is Rietveld 408576698