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

Unified Diff: third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/WebThreadSupportingGC.cpp
diff --git a/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp b/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp
index 070b2cf9ea7dbe28414da02a321ef22e1e92a763..a18ad05d34487a14f0589724ffb44ccfb7ff5c2b 100644
--- a/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp
+++ b/third_party/WebKit/Source/platform/WebThreadSupportingGC.cpp
@@ -10,18 +10,19 @@
namespace blink {
-PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::create(const char* name)
+PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::create(const char* name, ThreadState::PerThreadHeapState perThreadHeapState)
{
- return adoptPtr(new WebThreadSupportingGC(name, nullptr));
+ return adoptPtr(new WebThreadSupportingGC(name, nullptr, perThreadHeapState));
}
-PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::createForThread(WebThread* thread)
+PassOwnPtr<WebThreadSupportingGC> WebThreadSupportingGC::createForThread(WebThread* thread, ThreadState::PerThreadHeapState perThreadHeapState)
{
- return adoptPtr(new WebThreadSupportingGC(nullptr, thread));
+ return adoptPtr(new WebThreadSupportingGC(nullptr, thread, perThreadHeapState));
}
-WebThreadSupportingGC::WebThreadSupportingGC(const char* name, WebThread* thread)
+WebThreadSupportingGC::WebThreadSupportingGC(const char* name, WebThread* thread, ThreadState::PerThreadHeapState perThreadHeapState)
haraken 2016/01/07 08:06:21 Can we move the parameter from the constructor to
: m_thread(thread)
+ , m_perThreadHeapEnabled(perThreadHeapState == ThreadState::PerThreadHeapEnabled)
{
#if ENABLE(ASSERT)
ASSERT(!name || !thread);
@@ -47,7 +48,7 @@ WebThreadSupportingGC::~WebThreadSupportingGC()
void WebThreadSupportingGC::initialize()
{
- ThreadState::attach();
+ ThreadState::attach(m_perThreadHeapEnabled ? ThreadState::PerThreadHeapEnabled : ThreadState::PerThreadHeapDisabled);
m_gcTaskRunner = adoptPtr(new GCTaskRunner(m_thread));
}

Powered by Google App Engine
This is Rietveld 408576698