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 23 matching lines...) Expand all Loading... |
34 kNonStrictMode, | 34 kNonStrictMode, |
35 kStrictMode | 35 kStrictMode |
36 }; | 36 }; |
37 | 37 |
38 // Stores whether the client uses v8::Locker to access the isolate. | 38 // Stores whether the client uses v8::Locker to access the isolate. |
39 enum AccessMode { | 39 enum AccessMode { |
40 kSingleThread, | 40 kSingleThread, |
41 kUseLocker | 41 kUseLocker |
42 }; | 42 }; |
43 | 43 |
| 44 // Whether Atomics.wait can be called on this isolate. |
| 45 enum AllowAtomicsWaitMode { |
| 46 kDisallowAtomicsWait, |
| 47 kAllowAtomicsWait |
| 48 }; |
| 49 |
44 // Indicates whether V8 works with stable or experimental v8 extras. | 50 // Indicates whether V8 works with stable or experimental v8 extras. |
45 enum V8ExtrasMode { | 51 enum V8ExtrasMode { |
46 kStableV8Extras, | 52 kStableV8Extras, |
47 kStableAndExperimentalV8Extras, | 53 kStableAndExperimentalV8Extras, |
48 }; | 54 }; |
49 | 55 |
50 explicit IsolateHolder( | 56 explicit IsolateHolder( |
51 scoped_refptr<base::SingleThreadTaskRunner> task_runner); | 57 scoped_refptr<base::SingleThreadTaskRunner> task_runner); |
52 IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 58 IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
53 AccessMode access_mode); | 59 AccessMode access_mode); |
| 60 IsolateHolder(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
| 61 AccessMode access_mode, |
| 62 AllowAtomicsWaitMode atomics_wait_mode); |
54 ~IsolateHolder(); | 63 ~IsolateHolder(); |
55 | 64 |
56 // Should be invoked once before creating IsolateHolder instances to | 65 // Should be invoked once before creating IsolateHolder instances to |
57 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is | 66 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is |
58 // defined, V8's initial natives should be loaded (by calling | 67 // defined, V8's initial natives should be loaded (by calling |
59 // V8Initializer::LoadV8NativesFromFD or | 68 // V8Initializer::LoadV8NativesFromFD or |
60 // V8Initializer::LoadV8Natives) before calling this method. If the | 69 // V8Initializer::LoadV8Natives) before calling this method. If the |
61 // snapshot file is available, it should also be loaded (by calling | 70 // snapshot file is available, it should also be loaded (by calling |
62 // V8Initializer::LoadV8SnapshotFromFD or | 71 // V8Initializer::LoadV8SnapshotFromFD or |
63 // V8Initializer::LoadV8Snapshot) before calling this method. | 72 // V8Initializer::LoadV8Snapshot) before calling this method. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 std::unique_ptr<RunMicrotasksObserver> task_observer_; | 106 std::unique_ptr<RunMicrotasksObserver> task_observer_; |
98 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; | 107 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; |
99 AccessMode access_mode_; | 108 AccessMode access_mode_; |
100 | 109 |
101 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); | 110 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); |
102 }; | 111 }; |
103 | 112 |
104 } // namespace gin | 113 } // namespace gin |
105 | 114 |
106 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ | 115 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ |
OLD | NEW |