| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "public/web/WebKit.h" | 31 #include "public/web/WebKit.h" |
| 32 | 32 |
| 33 #include <memory> | 33 #include <memory> |
| 34 | |
| 35 #include "bindings/core/v8/Microtask.h" | 34 #include "bindings/core/v8/Microtask.h" |
| 36 #include "bindings/core/v8/V8BindingForCore.h" | 35 #include "bindings/core/v8/V8BindingForCore.h" |
| 37 #include "bindings/core/v8/V8GCController.h" | 36 #include "bindings/core/v8/V8GCController.h" |
| 38 #include "bindings/core/v8/V8Initializer.h" | 37 #include "bindings/core/v8/V8Initializer.h" |
| 38 #include "bindings/modules/v8/V8SnapshotReference.h" |
| 39 #include "core/animation/AnimationClock.h" | 39 #include "core/animation/AnimationClock.h" |
| 40 #include "core/layout/LayoutTheme.h" | 40 #include "core/layout/LayoutTheme.h" |
| 41 #include "core/page/Page.h" | 41 #include "core/page/Page.h" |
| 42 #include "core/workers/WorkerBackingThread.h" | 42 #include "core/workers/WorkerBackingThread.h" |
| 43 #include "gin/public/v8_platform.h" | 43 #include "gin/public/v8_platform.h" |
| 44 #include "modules/ModulesInitializer.h" | 44 #include "modules/ModulesInitializer.h" |
| 45 #include "platform/LayoutTestSupport.h" | 45 #include "platform/LayoutTestSupport.h" |
| 46 #include "platform/heap/Heap.h" | 46 #include "platform/heap/Heap.h" |
| 47 #include "platform/wtf/Assertions.h" | 47 #include "platform/wtf/Assertions.h" |
| 48 #include "platform/wtf/PtrUtil.h" | 48 #include "platform/wtf/PtrUtil.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 73 | 73 |
| 74 static ModulesInitializer& GetModulesInitializer() { | 74 static ModulesInitializer& GetModulesInitializer() { |
| 75 DEFINE_STATIC_LOCAL(std::unique_ptr<ModulesInitializer>, initializer, | 75 DEFINE_STATIC_LOCAL(std::unique_ptr<ModulesInitializer>, initializer, |
| 76 (WTF::WrapUnique(new ModulesInitializer))); | 76 (WTF::WrapUnique(new ModulesInitializer))); |
| 77 return *initializer; | 77 return *initializer; |
| 78 } | 78 } |
| 79 | 79 |
| 80 void Initialize(Platform* platform) { | 80 void Initialize(Platform* platform) { |
| 81 Platform::Initialize(platform); | 81 Platform::Initialize(platform); |
| 82 | 82 |
| 83 V8Initializer::InitializeMainThread(); | 83 V8Initializer::InitializeMainThread( |
| 84 V8SnapshotReference::getExternalReferences()); |
| 84 | 85 |
| 85 GetModulesInitializer().Initialize(); | 86 GetModulesInitializer().Initialize(); |
| 86 | 87 |
| 87 // currentThread is null if we are running on a thread without a message loop. | 88 // currentThread is null if we are running on a thread without a message loop. |
| 88 if (WebThread* current_thread = platform->CurrentThread()) { | 89 if (WebThread* current_thread = platform->CurrentThread()) { |
| 89 DCHECK(!g_end_of_task_runner); | 90 DCHECK(!g_end_of_task_runner); |
| 90 g_end_of_task_runner = new EndOfTaskRunner; | 91 g_end_of_task_runner = new EndOfTaskRunner; |
| 91 current_thread->AddTaskObserver(g_end_of_task_runner); | 92 current_thread->AddTaskObserver(g_end_of_task_runner); |
| 92 } | 93 } |
| 93 } | 94 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void MemoryPressureNotificationToWorkerThreadIsolates( | 133 void MemoryPressureNotificationToWorkerThreadIsolates( |
| 133 v8::MemoryPressureLevel level) { | 134 v8::MemoryPressureLevel level) { |
| 134 WorkerBackingThread::MemoryPressureNotificationToWorkerThreadIsolates(level); | 135 WorkerBackingThread::MemoryPressureNotificationToWorkerThreadIsolates(level); |
| 135 } | 136 } |
| 136 | 137 |
| 137 void SetRAILModeOnWorkerThreadIsolates(v8::RAILMode rail_mode) { | 138 void SetRAILModeOnWorkerThreadIsolates(v8::RAILMode rail_mode) { |
| 138 WorkerBackingThread::SetRAILModeOnWorkerThreadIsolates(rail_mode); | 139 WorkerBackingThread::SetRAILModeOnWorkerThreadIsolates(rail_mode); |
| 139 } | 140 } |
| 140 | 141 |
| 141 } // namespace blink | 142 } // namespace blink |
| OLD | NEW |