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 #include "core/workers/WorkerBackingThread.h" | 5 #include "core/workers/WorkerBackingThread.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
9 #include "bindings/core/v8/V8GCController.h" | 9 #include "bindings/core/v8/V8GCController.h" |
10 #include "bindings/core/v8/V8IdleTaskRunner.h" | 10 #include "bindings/core/v8/V8IdleTaskRunner.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 m_backingThread->platformThread().getWebTaskRunner()); | 65 m_backingThread->platformThread().getWebTaskRunner()); |
66 addWorkerIsolate(m_isolate); | 66 addWorkerIsolate(m_isolate); |
67 V8Initializer::initializeWorker(m_isolate); | 67 V8Initializer::initializeWorker(m_isolate); |
68 | 68 |
69 ThreadState::current()->registerTraceDOMWrappers( | 69 ThreadState::current()->registerTraceDOMWrappers( |
70 m_isolate, V8GCController::traceDOMWrappers, | 70 m_isolate, V8GCController::traceDOMWrappers, |
71 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque, | 71 ScriptWrappableVisitor::invalidateDeadObjectsInMarkingDeque, |
72 ScriptWrappableVisitor::performCleanup); | 72 ScriptWrappableVisitor::performCleanup); |
73 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) | 73 if (RuntimeEnabledFeatures::v8IdleTasksEnabled()) |
74 V8PerIsolateData::enableIdleTasks( | 74 V8PerIsolateData::enableIdleTasks( |
75 m_isolate, WTF::wrapUnique(new V8IdleTaskRunner( | 75 m_isolate, |
76 backingThread().platformThread().scheduler()))); | 76 WTF::wrapUnique(new V8IdleTaskRunner( |
| 77 backingThread().platformThread().scheduler()))); |
77 if (m_isOwningThread) | 78 if (m_isOwningThread) |
78 Platform::current()->didStartWorkerThread(); | 79 Platform::current()->didStartWorkerThread(); |
79 | 80 |
80 V8PerIsolateData::from(m_isolate)->setThreadDebugger( | 81 V8PerIsolateData::from(m_isolate)->setThreadDebugger( |
81 WTF::makeUnique<WorkerThreadDebugger>(m_isolate)); | 82 WTF::makeUnique<WorkerThreadDebugger>(m_isolate)); |
82 } | 83 } |
83 | 84 |
84 void WorkerBackingThread::shutdown() { | 85 void WorkerBackingThread::shutdown() { |
85 if (m_isOwningThread) | 86 if (m_isOwningThread) |
86 Platform::current()->willStopWorkerThread(); | 87 Platform::current()->willStopWorkerThread(); |
(...skipping 21 matching lines...) Expand all Loading... |
108 | 109 |
109 // static | 110 // static |
110 void WorkerBackingThread::setRAILModeOnWorkerThreadIsolates( | 111 void WorkerBackingThread::setRAILModeOnWorkerThreadIsolates( |
111 v8::RAILMode railMode) { | 112 v8::RAILMode railMode) { |
112 MutexLocker lock(isolatesMutex()); | 113 MutexLocker lock(isolatesMutex()); |
113 for (v8::Isolate* isolate : isolates()) | 114 for (v8::Isolate* isolate : isolates()) |
114 isolate->SetRAILMode(railMode); | 115 isolate->SetRAILMode(railMode); |
115 } | 116 } |
116 | 117 |
117 } // namespace blink | 118 } // namespace blink |
OLD | NEW |