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

Side by Side Diff: third_party/WebKit/Source/web/WebKit.cpp

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Disable on ChromeOS and reduce size of table 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 17 matching lines...) Expand all
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 34
35 #include "bindings/core/v8/V8BindingForCore.h" 35 #include "bindings/core/v8/V8BindingForCore.h"
36 #include "bindings/core/v8/V8GCController.h" 36 #include "bindings/core/v8/V8GCController.h"
37 #include "bindings/core/v8/V8Initializer.h" 37 #include "bindings/core/v8/V8Initializer.h"
38 #include "bindings/core/v8/V8SnapshotUtil.h"
39 #include "bindings/modules/v8/V8SnapshotExternalReferences.h"
38 #include "core/animation/AnimationClock.h" 40 #include "core/animation/AnimationClock.h"
39 #include "core/layout/LayoutTheme.h" 41 #include "core/layout/LayoutTheme.h"
40 #include "core/page/Page.h" 42 #include "core/page/Page.h"
41 #include "core/workers/WorkerBackingThread.h" 43 #include "core/workers/WorkerBackingThread.h"
42 #include "gin/public/v8_platform.h" 44 #include "gin/public/v8_platform.h"
43 #include "modules/ModulesInitializer.h" 45 #include "modules/ModulesInitializer.h"
44 #include "platform/LayoutTestSupport.h" 46 #include "platform/LayoutTestSupport.h"
45 #include "platform/bindings/Microtask.h" 47 #include "platform/bindings/Microtask.h"
46 #include "platform/heap/Heap.h" 48 #include "platform/heap/Heap.h"
47 #include "platform/wtf/Assertions.h" 49 #include "platform/wtf/Assertions.h"
(...skipping 26 matching lines...) Expand all
74 76
75 static ModulesInitializer& GetModulesInitializer() { 77 static ModulesInitializer& GetModulesInitializer() {
76 DEFINE_STATIC_LOCAL(std::unique_ptr<ModulesInitializer>, initializer, 78 DEFINE_STATIC_LOCAL(std::unique_ptr<ModulesInitializer>, initializer,
77 (WTF::WrapUnique(new ModulesInitializer))); 79 (WTF::WrapUnique(new ModulesInitializer)));
78 return *initializer; 80 return *initializer;
79 } 81 }
80 82
81 void Initialize(Platform* platform) { 83 void Initialize(Platform* platform) {
82 Platform::Initialize(platform); 84 Platform::Initialize(platform);
83 85
86 // Refernce table must be updated before creating isolates.
haraken 2017/07/04 15:04:20 creating an isolate.
peria 2017/07/07 06:22:04 Done.
87 V8SnapshotUtil::SetReferenceTable(V8SnapshotExternalReferences::GetTable());
84 V8Initializer::InitializeMainThread(); 88 V8Initializer::InitializeMainThread();
haraken 2017/07/04 15:04:20 Would it be possible to pass in V8SnapshotExternal
peria 2017/07/07 06:22:04 Done.
85 89
86 GetModulesInitializer().Initialize(); 90 GetModulesInitializer().Initialize();
87 91
88 WebFactoryImpl::Initialize(); 92 WebFactoryImpl::Initialize();
89 93
90 // currentThread is null if we are running on a thread without a message loop. 94 // currentThread is null if we are running on a thread without a message loop.
91 if (WebThread* current_thread = platform->CurrentThread()) { 95 if (WebThread* current_thread = platform->CurrentThread()) {
92 DCHECK(!g_end_of_task_runner); 96 DCHECK(!g_end_of_task_runner);
93 g_end_of_task_runner = new EndOfTaskRunner; 97 g_end_of_task_runner = new EndOfTaskRunner;
94 current_thread->AddTaskObserver(g_end_of_task_runner); 98 current_thread->AddTaskObserver(g_end_of_task_runner);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 WorkerBackingThread::SetRAILModeOnWorkerThreadIsolates(rail_mode); 145 WorkerBackingThread::SetRAILModeOnWorkerThreadIsolates(rail_mode);
142 } 146 }
143 147
144 void LogRuntimeCallStats() { 148 void LogRuntimeCallStats() {
145 LOG(INFO) 149 LOG(INFO)
146 << "\n" 150 << "\n"
147 << RuntimeCallStats::From(MainThreadIsolate())->ToString().Utf8().data(); 151 << RuntimeCallStats::From(MainThreadIsolate())->ToString().Utf8().data();
148 } 152 }
149 153
150 } // namespace blink 154 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698