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

Side by Side Diff: gin/public/isolate_holder.h

Issue 2841443005: [Bindings] Create and use V8 context snapshots (Closed)
Patch Set: Rebase Created 3 years, 4 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
« no previous file with comments | « gin/isolate_holder.cc ('k') | gin/v8_initializer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef GIN_PUBLIC_ISOLATE_HOLDER_H_ 5 #ifndef GIN_PUBLIC_ISOLATE_HOLDER_H_
6 #define GIN_PUBLIC_ISOLATE_HOLDER_H_ 6 #define GIN_PUBLIC_ISOLATE_HOLDER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 kStableV8Extras, 52 kStableV8Extras,
53 kStableAndExperimentalV8Extras, 53 kStableAndExperimentalV8Extras,
54 }; 54 };
55 55
56 explicit IsolateHolder( 56 explicit IsolateHolder(
57 scoped_refptr<base::SingleThreadTaskRunner> task_runner); 57 scoped_refptr<base::SingleThreadTaskRunner> task_runner);
58 IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, 58 IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
59 AccessMode access_mode); 59 AccessMode access_mode);
60 IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, 60 IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
61 AccessMode access_mode, 61 AccessMode access_mode,
62 AllowAtomicsWaitMode atomics_wait_mode); 62 AllowAtomicsWaitMode atomics_wait_mode,
63 intptr_t* reference_table,
64 v8::StartupData* startup_data);
63 65
64 // This constructor is to create V8 snapshot for Blink. 66 // This constructor is to create V8 snapshot for Blink.
65 // Note this constructor calls isolate->Enter() internally. 67 // Note this constructor calls isolate->Enter() internally.
66 IsolateHolder(intptr_t* reference_table, v8::StartupData* existing_blob); 68 IsolateHolder(intptr_t* reference_table, v8::StartupData* existing_blob);
67 69
68 ~IsolateHolder(); 70 ~IsolateHolder();
69 71
70 // Should be invoked once before creating IsolateHolder instances to 72 // Should be invoked once before creating IsolateHolder instances to
71 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is 73 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is
72 // defined, V8's initial natives should be loaded (by calling 74 // defined, V8's initial natives should be loaded (by calling
(...skipping 30 matching lines...) Expand all
103 void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner); 105 void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner);
104 106
105 // This method returns V8IsolateMemoryDumpProvider of this isolate, used for 107 // This method returns V8IsolateMemoryDumpProvider of this isolate, used for
106 // testing. 108 // testing.
107 V8IsolateMemoryDumpProvider* isolate_memory_dump_provider_for_testing() 109 V8IsolateMemoryDumpProvider* isolate_memory_dump_provider_for_testing()
108 const { 110 const {
109 return isolate_memory_dump_provider_.get(); 111 return isolate_memory_dump_provider_.get();
110 } 112 }
111 113
112 private: 114 private:
115 void SetUp(scoped_refptr<base::SingleThreadTaskRunner> task_runner);
116
117 std::unique_ptr<v8::SnapshotCreator> snapshot_creator_;
113 v8::Isolate* isolate_; 118 v8::Isolate* isolate_;
114 std::unique_ptr<PerIsolateData> isolate_data_; 119 std::unique_ptr<PerIsolateData> isolate_data_;
115 std::unique_ptr<RunMicrotasksObserver> task_observer_; 120 std::unique_ptr<RunMicrotasksObserver> task_observer_;
116 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; 121 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_;
117 std::unique_ptr<v8::SnapshotCreator> snapshot_creator_;
118 AccessMode access_mode_; 122 AccessMode access_mode_;
119 123
120 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); 124 DISALLOW_COPY_AND_ASSIGN(IsolateHolder);
121 }; 125 };
122 126
123 } // namespace gin 127 } // namespace gin
124 128
125 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ 129 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_
OLDNEW
« no previous file with comments | « gin/isolate_holder.cc ('k') | gin/v8_initializer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698