OLD | NEW |
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 Loading... |
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 |
OLD | NEW |