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

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

Issue 2355193002: Use enum for per thread heap enabled flag (Closed)
Patch Set: Created 4 years, 3 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 76fae9b74356c94dbe553c19fc4fcb2f21703836..0509a1c01235d87919e053fdcfd46a8389701798 100644
--- a/third_party/WebKit/Source/platform/heap/ThreadState.h
+++ b/third_party/WebKit/Source/platform/heap/ThreadState.h
@@ -116,6 +116,11 @@ static bool invokePreFinalizer(void* object) \
} \
using UsingPreFinalizerMacroNeedsTrailingSemiColon = char
+enum ThreadHeapMode {
haraken 2016/09/21 04:56:42 Move this to BlinkGC.h.
keishi 2016/09/21 07:06:37 Done.
+ MainThreadHeapMode,
+ PerThreadHeapMode,
+};
+
class PLATFORM_EXPORT ThreadState {
USING_FAST_MALLOC(ThreadState);
WTF_MAKE_NONCOPYABLE(ThreadState);
@@ -174,7 +179,7 @@ public:
void lockThreadAttachMutex();
void unlockThreadAttachMutex();
- bool perThreadHeapEnabled() const { return m_perThreadHeapEnabled; }
+ ThreadHeapMode threadHeapMode() const { return m_threadHeapMode; }
bool isTerminating() { return m_isTerminating; }
@@ -185,7 +190,7 @@ public:
// Associate ThreadState object with the current thread. After this
// call thread can start using the garbage collected heap infrastructure.
// It also has to periodically check for safepoints.
- static void attachCurrentThread(bool perThreadHeapEnabled);
+ static void attachCurrentThread(ThreadHeapMode);
// Disassociate attached ThreadState from the current thread. The thread
// can no longer use the garbage collected heap after this call.
@@ -540,7 +545,7 @@ private:
FreelistSnapshot
};
- ThreadState(bool perThreadHeapEnabled);
+ ThreadState(ThreadHeapMode);
nhiroki 2016/09/21 05:15:26 explicit
keishi 2016/09/21 07:06:37 Done.
~ThreadState();
NO_SANITIZE_ADDRESS void copyStackUntilSafePointScope();
@@ -650,7 +655,7 @@ private:
size_t m_arenaAges[BlinkGC::NumberOfArenas];
size_t m_currentArenaAges;
- bool m_perThreadHeapEnabled;
+ ThreadHeapMode m_threadHeapMode;
nhiroki 2016/09/21 05:15:26 const?
keishi 2016/09/21 07:06:37 Done.
bool m_isTerminating;
GarbageCollectedMixinConstructorMarker* m_gcMixinMarker;

Powered by Google App Engine
This is Rietveld 408576698