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

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

Issue 1850413002: Improve DEFINE_STATIC_LOCAL()'s handling of Blink GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address compilation failure 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 b62279eb3188dc5f99aa19004198b217c2039163..07599c6ef06dcd7670197596f24c57b9e0f0cb06 100644
--- a/third_party/WebKit/Source/core/dom/WeakIdentifierMap.h
+++ b/third_party/WebKit/Source/core/dom/WeakIdentifierMap.h
@@ -39,7 +39,6 @@ template<typename T, typename Generator, typename Traits> class WeakIdentifierMa
USING_FAST_MALLOC(WeakIdentifierMap);
public:
using IdentifierType = typename Generator::IdentifierType;
- using ReferenceType = RawPtr<WeakIdentifierMap<T, Generator, Traits, false>>;
static IdentifierType identifier(T* object)
{
@@ -93,7 +92,6 @@ template<typename T, typename Generator, typename Traits> class WeakIdentifierMa
: 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)
{
@@ -146,14 +144,15 @@ private:
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__>::ReferenceType; \
+ using RefType = WeakIdentifierMap<T, ##__VA_ARGS__>; \
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