OLD | NEW |
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 Loading... |
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); | |
65 | 63 |
66 // This constructor is to create V8 snapshot for Blink. | 64 // This constructor is to create V8 snapshot for Blink. |
67 // Note this constructor calls isolate->Enter() internally. | 65 // Note this constructor calls isolate->Enter() internally. |
68 IsolateHolder(intptr_t* reference_table, v8::StartupData* existing_blob); | 66 IsolateHolder(intptr_t* reference_table, v8::StartupData* existing_blob); |
69 | 67 |
70 ~IsolateHolder(); | 68 ~IsolateHolder(); |
71 | 69 |
72 // Should be invoked once before creating IsolateHolder instances to | 70 // Should be invoked once before creating IsolateHolder instances to |
73 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is | 71 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is |
74 // defined, V8's initial natives should be loaded (by calling | 72 // defined, V8's initial natives should be loaded (by calling |
(...skipping 30 matching lines...) Expand all Loading... |
105 void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner); | 103 void EnableIdleTasks(std::unique_ptr<V8IdleTaskRunner> idle_task_runner); |
106 | 104 |
107 // This method returns V8IsolateMemoryDumpProvider of this isolate, used for | 105 // This method returns V8IsolateMemoryDumpProvider of this isolate, used for |
108 // testing. | 106 // testing. |
109 V8IsolateMemoryDumpProvider* isolate_memory_dump_provider_for_testing() | 107 V8IsolateMemoryDumpProvider* isolate_memory_dump_provider_for_testing() |
110 const { | 108 const { |
111 return isolate_memory_dump_provider_.get(); | 109 return isolate_memory_dump_provider_.get(); |
112 } | 110 } |
113 | 111 |
114 private: | 112 private: |
115 void SetUp(scoped_refptr<base::SingleThreadTaskRunner> task_runner); | |
116 | |
117 std::unique_ptr<v8::SnapshotCreator> snapshot_creator_; | |
118 v8::Isolate* isolate_; | 113 v8::Isolate* isolate_; |
119 std::unique_ptr<PerIsolateData> isolate_data_; | 114 std::unique_ptr<PerIsolateData> isolate_data_; |
120 std::unique_ptr<RunMicrotasksObserver> task_observer_; | 115 std::unique_ptr<RunMicrotasksObserver> task_observer_; |
121 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; | 116 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; |
| 117 std::unique_ptr<v8::SnapshotCreator> snapshot_creator_; |
122 AccessMode access_mode_; | 118 AccessMode access_mode_; |
123 | 119 |
124 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); | 120 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); |
125 }; | 121 }; |
126 | 122 |
127 } // namespace gin | 123 } // namespace gin |
128 | 124 |
129 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ | 125 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ |
OLD | NEW |