| 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 11 matching lines...) Expand all Loading... |
| 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 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 "bindings/core/v8/V8Initializer.h" | 31 #include "bindings/core/v8/V8Initializer.h" |
| 32 #include "bindings/modules/v8/V8ContextSnapshotExternalReferences.h" |
| 32 #include "core/animation/AnimationClock.h" | 33 #include "core/animation/AnimationClock.h" |
| 33 #include "modules/ModulesInitializer.h" | 34 #include "modules/ModulesInitializer.h" |
| 34 #include "platform/bindings/Microtask.h" | 35 #include "platform/bindings/Microtask.h" |
| 35 #include "platform/bindings/V8PerIsolateData.h" | 36 #include "platform/bindings/V8PerIsolateData.h" |
| 36 #include "platform/heap/Heap.h" | 37 #include "platform/heap/Heap.h" |
| 37 #include "platform/wtf/Assertions.h" | 38 #include "platform/wtf/Assertions.h" |
| 38 #include "platform/wtf/PtrUtil.h" | 39 #include "platform/wtf/PtrUtil.h" |
| 39 #include "platform/wtf/WTF.h" | 40 #include "platform/wtf/WTF.h" |
| 40 #include "public/platform/Platform.h" | 41 #include "public/platform/Platform.h" |
| 41 #include "public/platform/WebThread.h" | 42 #include "public/platform/WebThread.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 62 | 63 |
| 63 static ModulesInitializer& GetModulesInitializer() { | 64 static ModulesInitializer& GetModulesInitializer() { |
| 64 DEFINE_STATIC_LOCAL(std::unique_ptr<ModulesInitializer>, initializer, | 65 DEFINE_STATIC_LOCAL(std::unique_ptr<ModulesInitializer>, initializer, |
| 65 (WTF::WrapUnique(new ModulesInitializer))); | 66 (WTF::WrapUnique(new ModulesInitializer))); |
| 66 return *initializer; | 67 return *initializer; |
| 67 } | 68 } |
| 68 | 69 |
| 69 void Initialize(Platform* platform) { | 70 void Initialize(Platform* platform) { |
| 70 Platform::Initialize(platform); | 71 Platform::Initialize(platform); |
| 71 | 72 |
| 72 V8Initializer::InitializeMainThread(); | 73 V8Initializer::InitializeMainThread( |
| 73 | 74 V8ContextSnapshotExternalReferences::GetTable()); |
| 74 GetModulesInitializer().Initialize(); | 75 GetModulesInitializer().Initialize(); |
| 75 | 76 |
| 76 WebFactoryImpl::Initialize(); | 77 WebFactoryImpl::Initialize(); |
| 77 | 78 |
| 78 // currentThread is null if we are running on a thread without a message loop. | 79 // currentThread is null if we are running on a thread without a message loop. |
| 79 if (WebThread* current_thread = platform->CurrentThread()) { | 80 if (WebThread* current_thread = platform->CurrentThread()) { |
| 80 DCHECK(!g_end_of_task_runner); | 81 DCHECK(!g_end_of_task_runner); |
| 81 g_end_of_task_runner = new EndOfTaskRunner; | 82 g_end_of_task_runner = new EndOfTaskRunner; |
| 82 current_thread->AddTaskObserver(g_end_of_task_runner); | 83 current_thread->AddTaskObserver(g_end_of_task_runner); |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 | 86 |
| 86 } // namespace blink | 87 } // namespace blink |
| OLD | NEW |