Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Side by Side Diff: third_party/WebKit/Source/controller/BlinkInitializer.cpp

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Work for comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698