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 DCHECK(m_backingThread); | 58 DCHECK(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 | |
67 private: | 64 private: |
68 WorkerBackingThread(const char* name, bool shouldCallGCOnShutdown); | 65 WorkerBackingThread(const char* name, bool shouldCallGCOnShutdown); |
69 WorkerBackingThread(WebThread*, bool shouldCallGCOnSHutdown); | 66 WorkerBackingThread(WebThread*, bool shouldCallGCOnSHutdown); |
70 void initialize(); | 67 void initialize(); |
71 void shutdown(); | 68 void shutdown(); |
72 | 69 |
73 // Protects |m_workerScriptCount|. | 70 // Protects |m_workerScriptCount|. |
74 Mutex m_mutex; | 71 Mutex m_mutex; |
75 OwnPtr<WebThreadSupportingGC> m_backingThread; | 72 OwnPtr<WebThreadSupportingGC> m_backingThread; |
76 v8::Isolate* m_isolate = nullptr; | 73 v8::Isolate* m_isolate = nullptr; |
77 unsigned m_workerScriptCount = 0; | 74 unsigned m_workerScriptCount = 0; |
78 bool m_isOwningThread; | 75 bool m_isOwningThread; |
79 bool m_shouldCallGCOnShutdown; | 76 bool m_shouldCallGCOnShutdown; |
80 }; | 77 }; |
81 | 78 |
82 } // namespace blink | 79 } // namespace blink |
83 | 80 |
84 #endif // WorkerBackingThread_h | 81 #endif // WorkerBackingThread_h |
OLD | NEW |