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

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

Issue 2680843006: Tidy DEFINE_(THREAD_SAFE_)STATIC_LOCAL() implementations. (Closed)
Patch Set: explain safety of HTMLTableSectionElement singletons 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/ThreadState.h
diff --git a/third_party/WebKit/Source/platform/heap/ThreadState.h b/third_party/WebKit/Source/platform/heap/ThreadState.h
index 74edd20aefa36099c945f6add4484aa9731d6139..93a2c8596cfed1f87c0334aba4673dee01a239cf 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.h
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.h
@@ -301,6 +301,15 @@ class PLATFORM_EXPORT ThreadState {
ThreadState* const m_threadState;
};
+#if DCHECK_IS_ON()
+ bool canAllocateScriptWrappable() const { return !m_noScriptWrappableCount; }
+ void enterNoScriptWrappableScope() { m_noScriptWrappableCount++; }
+ void leaveNoScriptWrappableScope() {
+ DCHECK(m_noScriptWrappableCount);
+ m_noScriptWrappableCount--;
+ }
+#endif
+
void flushHeapDoesNotContainCacheIfNeeded();
// Safepoint related functionality.
@@ -652,6 +661,10 @@ class PLATFORM_EXPORT ThreadState {
size_t m_noAllocationCount;
size_t m_gcForbiddenCount;
size_t m_mixinsBeingConstructedCount;
+#if DCHECK_IS_ON()
+ size_t m_noScriptWrappableCount;
+#endif
+
double m_accumulatedSweepingTime;
BaseArena* m_arenas[BlinkGC::NumberOfArenas];

Powered by Google App Engine
This is Rietveld 408576698