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

Unified Diff: third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp

Issue 1953483002: Revert of Do V8 GC ASAP if system memory is pressured (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/workers/WorkerBackingThread.cpp
diff --git a/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp b/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
index 7267083c7053962b89296c7c05e654b6b6691cce..040ce92ea79208362ca3f48cfceb67291d092614 100644
--- a/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerBackingThread.cpp
@@ -16,34 +16,6 @@
#include "public/platform/WebTraceLocation.h"
namespace blink {
-
-#define DEFINE_STATIC_LOCAL_WITH_LOCK(type, name, arguments) \
- ASSERT(isolatesMutex().locked()); \
- static type& name = *new type arguments
-
-static Mutex& isolatesMutex()
-{
- DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex);
- return mutex;
-}
-
-static HashSet<v8::Isolate*>& isolates()
-{
- DEFINE_STATIC_LOCAL_WITH_LOCK(HashSet<v8::Isolate*>, isolates, ());
- return isolates;
-}
-
-static void addWorkerIsolate(v8::Isolate* isolate)
-{
- MutexLocker lock(isolatesMutex());
- isolates().add(isolate);
-}
-
-static void removeWorkerIsolate(v8::Isolate* isolate)
-{
- MutexLocker lock(isolatesMutex());
- isolates().remove(isolate);
-}
WorkerBackingThread::WorkerBackingThread(const char* name, bool shouldCallGCOnShutdown)
: m_backingThread(WebThreadSupportingGC::create(name))
@@ -91,7 +63,6 @@
{
DCHECK(!m_isolate);
m_isolate = V8PerIsolateData::initialize();
- addWorkerIsolate(m_isolate);
V8Initializer::initializeWorker(m_isolate);
m_backingThread->initialize();
@@ -118,17 +89,7 @@
m_backingThread->shutdown();
V8PerIsolateData::destroy(m_isolate);
- removeWorkerIsolate(m_isolate);
m_isolate = nullptr;
}
-// static
-void WorkerBackingThread::MemoryPressureNotificationToWorkerThreadIsolates(
- v8::MemoryPressureLevel level)
-{
- MutexLocker lock(isolatesMutex());
- for (v8::Isolate* isolate : isolates())
- isolate->MemoryPressureNotification(level);
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerBackingThread.h ('k') | third_party/WebKit/Source/web/WebKit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698