| 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 "bindings/core/v8/V8Binding.h" | 8 #include "bindings/core/v8/V8Binding.h" |
| 8 #include "bindings/core/v8/V8GCController.h" | 9 #include "bindings/core/v8/V8GCController.h" |
| 9 #include "bindings/core/v8/V8IdleTaskRunner.h" | 10 #include "bindings/core/v8/V8IdleTaskRunner.h" |
| 10 #include "bindings/core/v8/V8Initializer.h" | 11 #include "bindings/core/v8/V8Initializer.h" |
| 11 #include "bindings/core/v8/V8PerIsolateData.h" | 12 #include "bindings/core/v8/V8PerIsolateData.h" |
| 12 #include "core/inspector/WorkerThreadDebugger.h" | 13 #include "core/inspector/WorkerThreadDebugger.h" |
| 13 #include "platform/CrossThreadFunctional.h" | 14 #include "platform/CrossThreadFunctional.h" |
| 14 #include "platform/RuntimeEnabledFeatures.h" | 15 #include "platform/RuntimeEnabledFeatures.h" |
| 15 #include "platform/WebThreadSupportingGC.h" | 16 #include "platform/WebThreadSupportingGC.h" |
| 16 #include "public/platform/Platform.h" | 17 #include "public/platform/Platform.h" |
| 17 #include "public/platform/WebTraceLocation.h" | 18 #include "public/platform/WebTraceLocation.h" |
| 18 #include "wtf/PtrUtil.h" | 19 #include "wtf/PtrUtil.h" |
| 19 #include <memory> | |
| 20 | 20 |
| 21 namespace blink { | 21 namespace blink { |
| 22 | 22 |
| 23 #define DEFINE_STATIC_LOCAL_WITH_LOCK(type, name, arguments) \ | 23 #define DEFINE_STATIC_LOCAL_WITH_LOCK(type, name, arguments) \ |
| 24 ASSERT(isolatesMutex().locked()); \ | 24 ASSERT(isolatesMutex().locked()); \ |
| 25 static type& name = *new type arguments | 25 static type& name = *new type arguments |
| 26 | 26 |
| 27 static Mutex& isolatesMutex() { | 27 static Mutex& isolatesMutex() { |
| 28 DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex); | 28 DEFINE_THREAD_SAFE_STATIC_LOCAL(Mutex, mutex, new Mutex); |
| 29 return mutex; | 29 return mutex; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 // static | 109 // static |
| 110 void WorkerBackingThread::setRAILModeOnWorkerThreadIsolates( | 110 void WorkerBackingThread::setRAILModeOnWorkerThreadIsolates( |
| 111 v8::RAILMode railMode) { | 111 v8::RAILMode railMode) { |
| 112 MutexLocker lock(isolatesMutex()); | 112 MutexLocker lock(isolatesMutex()); |
| 113 for (v8::Isolate* isolate : isolates()) | 113 for (v8::Isolate* isolate : isolates()) |
| 114 isolate->SetRAILMode(railMode); | 114 isolate->SetRAILMode(railMode); |
| 115 } | 115 } |
| 116 | 116 |
| 117 } // namespace blink | 117 } // namespace blink |
| OLD | NEW |