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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerBackingThread.h

Issue 1749073002: Do V8 GC ASAP if system memory is pressured (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update in WorkerBackingThread Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WorkerBackingThread_h 5 #ifndef WorkerBackingThread_h
6 #define WorkerBackingThread_h 6 #define WorkerBackingThread_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "wtf/Forward.h" 9 #include "wtf/Forward.h"
10 #include "wtf/OwnPtr.h" 10 #include "wtf/OwnPtr.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 } 54 }
55 55
56 WebThreadSupportingGC& backingThread() 56 WebThreadSupportingGC& backingThread()
57 { 57 {
58 ASSERT(m_backingThread); 58 ASSERT(m_backingThread);
59 return *m_backingThread; 59 return *m_backingThread;
60 } 60 }
61 61
62 v8::Isolate* isolate() { return m_isolate; } 62 v8::Isolate* isolate() { return m_isolate; }
63 63
64 static void MemoryPressureNotificationToWorkerThreadIsolates(
65 v8::MemoryPressureLevel);
66
64 private: 67 private:
65 WorkerBackingThread(const char* name, bool shouldCallGCOnShutdown); 68 WorkerBackingThread(const char* name, bool shouldCallGCOnShutdown);
66 WorkerBackingThread(WebThread*, bool shouldCallGCOnSHutdown); 69 WorkerBackingThread(WebThread*, bool shouldCallGCOnSHutdown);
67 void initialize(); 70 void initialize();
68 void shutdown(); 71 void shutdown();
69 72
70 // Protects |m_workerScriptCount|. 73 // Protects |m_workerScriptCount|.
71 Mutex m_mutex; 74 Mutex m_mutex;
72 OwnPtr<WebThreadSupportingGC> m_backingThread; 75 OwnPtr<WebThreadSupportingGC> m_backingThread;
73 v8::Isolate* m_isolate = nullptr; 76 v8::Isolate* m_isolate = nullptr;
74 unsigned m_workerScriptCount = 0; 77 unsigned m_workerScriptCount = 0;
75 bool m_isOwningThread; 78 bool m_isOwningThread;
76 bool m_shouldCallGCOnShutdown; 79 bool m_shouldCallGCOnShutdown;
77 }; 80 };
78 81
79 } // namespace blink 82 } // namespace blink
80 83
81 #endif // WorkerBackingThread_h 84 #endif // WorkerBackingThread_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698