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

Unified Diff: Source/platform/heap/GCInfo.h

Issue 1287963002: Fix race at blink::GCInfoAtBase<T>::index (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@oilpan_1
Patch Set: Nits. Created 5 years, 4 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
« no previous file with comments | « no previous file | Source/platform/heap/Visitor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/GCInfo.h
diff --git a/Source/platform/heap/GCInfo.h b/Source/platform/heap/GCInfo.h
index 3ff9cc60c0b2d4765e0f752eb793cfe237383eb6..01339238aef976baa4d587638f32d237b25eea7f 100644
--- a/Source/platform/heap/GCInfo.h
+++ b/Source/platform/heap/GCInfo.h
@@ -111,15 +111,16 @@ extern PLATFORM_EXPORT GCInfo const** s_gcInfoTable;
// reachable. There is a GCInfo struct for each class that directly
// inherits from GarbageCollected or GarbageCollectedFinalized.
struct GCInfo {
+ using GetClassNameCallback = const String& (*)();
+
bool hasFinalizer() const { return m_nonTrivialFinalizer; }
bool hasVTable() const { return m_hasVTable; }
- const String& className() const { return m_className; }
+ const String& className() const { return m_classNameGetter(); }
TraceCallback m_trace;
FinalizationCallback m_finalize;
bool m_nonTrivialFinalizer;
bool m_hasVTable;
- // |m_className| is held as a reference to prevent dtor being called at exit.
- const String& m_className;
+ GetClassNameCallback m_classNameGetter;
};
#if ENABLE(ASSERT)
@@ -171,7 +172,7 @@ struct GCInfoAtBase {
FinalizerTrait<T>::finalize,
FinalizerTrait<T>::nonTrivialFinalizer,
WTF::IsPolymorphic<T>::value,
- TypenameStringTrait<T>::get()
+ TypenameStringTrait<T>::get
};
RETURN_GCINFO_INDEX();
}
« no previous file with comments | « no previous file | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698