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 "controller/BlinkInitializer.h" | 31 #include "controller/BlinkInitializer.h" |
32 | 32 |
33 #include "bindings/core/v8/V8Initializer.h" | 33 #include "bindings/core/v8/V8Initializer.h" |
34 #include "bindings/modules/v8/V8ContextSnapshotExternalReferences.h" | |
34 #include "core/animation/AnimationClock.h" | 35 #include "core/animation/AnimationClock.h" |
35 #include "modules/ModulesInitializer.h" | 36 #include "modules/ModulesInitializer.h" |
36 #include "platform/bindings/Microtask.h" | 37 #include "platform/bindings/Microtask.h" |
37 #include "platform/bindings/V8PerIsolateData.h" | 38 #include "platform/bindings/V8PerIsolateData.h" |
38 #include "platform/heap/Heap.h" | 39 #include "platform/heap/Heap.h" |
39 #include "platform/wtf/Assertions.h" | 40 #include "platform/wtf/Assertions.h" |
40 #include "platform/wtf/PtrUtil.h" | 41 #include "platform/wtf/PtrUtil.h" |
41 #include "platform/wtf/WTF.h" | 42 #include "platform/wtf/WTF.h" |
42 #include "public/platform/Platform.h" | 43 #include "public/platform/Platform.h" |
43 #include "public/platform/WebThread.h" | 44 #include "public/platform/WebThread.h" |
(...skipping 18 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 InitializeBlink(Platform* platform) { | 70 void InitializeBlink(Platform* platform) { |
70 Platform::Initialize(platform); | 71 Platform::Initialize(platform); |
71 | 72 |
72 V8Initializer::InitializeMainThread(); | 73 // Refernce table must be updated before creating an isolate. |
haraken
2017/07/10 06:52:09
reference
We could drop this comment because now
peria
2017/07/10 10:18:43
Done.
| |
73 | 74 V8Initializer::InitializeMainThread( |
75 V8ContextSnapshotExternalReferences::GetTable()); | |
74 GetModulesInitializer().Initialize(); | 76 GetModulesInitializer().Initialize(); |
75 | 77 |
76 // currentThread is null if we are running on a thread without a message loop. | 78 // currentThread is null if we are running on a thread without a message loop. |
77 if (WebThread* current_thread = platform->CurrentThread()) { | 79 if (WebThread* current_thread = platform->CurrentThread()) { |
78 DCHECK(!g_end_of_task_runner); | 80 DCHECK(!g_end_of_task_runner); |
79 g_end_of_task_runner = new EndOfTaskRunner; | 81 g_end_of_task_runner = new EndOfTaskRunner; |
80 current_thread->AddTaskObserver(g_end_of_task_runner); | 82 current_thread->AddTaskObserver(g_end_of_task_runner); |
81 } | 83 } |
82 } | 84 } |
83 | 85 |
84 } // namespace blink | 86 } // namespace blink |
OLD | NEW |