Chromium Code Reviews| 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 AllowAtomicsWaitMode atomics_wait_mode = kAllowAtomicsWait); | |
|
jochen (gone - plz use gerrit)
2017/02/01 04:34:19
no default arguments please
binji
2017/02/01 23:09:32
Done.
| |
| 54 ~IsolateHolder(); | 61 ~IsolateHolder(); |
| 55 | 62 |
| 56 // Should be invoked once before creating IsolateHolder instances to | 63 // Should be invoked once before creating IsolateHolder instances to |
| 57 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is | 64 // initialize V8 and Gin. In case V8_USE_EXTERNAL_STARTUP_DATA is |
| 58 // defined, V8's initial natives should be loaded (by calling | 65 // defined, V8's initial natives should be loaded (by calling |
| 59 // V8Initializer::LoadV8NativesFromFD or | 66 // V8Initializer::LoadV8NativesFromFD or |
| 60 // V8Initializer::LoadV8Natives) before calling this method. If the | 67 // V8Initializer::LoadV8Natives) before calling this method. If the |
| 61 // snapshot file is available, it should also be loaded (by calling | 68 // snapshot file is available, it should also be loaded (by calling |
| 62 // V8Initializer::LoadV8SnapshotFromFD or | 69 // V8Initializer::LoadV8SnapshotFromFD or |
| 63 // V8Initializer::LoadV8Snapshot) before calling this method. | 70 // 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_; | 104 std::unique_ptr<RunMicrotasksObserver> task_observer_; |
| 98 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; | 105 std::unique_ptr<V8IsolateMemoryDumpProvider> isolate_memory_dump_provider_; |
| 99 AccessMode access_mode_; | 106 AccessMode access_mode_; |
| 100 | 107 |
| 101 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); | 108 DISALLOW_COPY_AND_ASSIGN(IsolateHolder); |
| 102 }; | 109 }; |
| 103 | 110 |
| 104 } // namespace gin | 111 } // namespace gin |
| 105 | 112 |
| 106 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ | 113 #endif // GIN_PUBLIC_ISOLATE_HOLDER_H_ |
| OLD | NEW |