OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project 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 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 5929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5940 Local<Value> data); | 5940 Local<Value> data); |
5941 | 5941 |
5942 // --- AllowCodeGenerationFromStrings callbacks --- | 5942 // --- AllowCodeGenerationFromStrings callbacks --- |
5943 | 5943 |
5944 /** | 5944 /** |
5945 * Callback to check if code generation from strings is allowed. See | 5945 * Callback to check if code generation from strings is allowed. See |
5946 * Context::AllowCodeGenerationFromStrings. | 5946 * Context::AllowCodeGenerationFromStrings. |
5947 */ | 5947 */ |
5948 typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context); | 5948 typedef bool (*AllowCodeGenerationFromStringsCallback)(Local<Context> context); |
5949 | 5949 |
| 5950 // --- WASM compilation callbacks --- |
| 5951 |
| 5952 /** |
| 5953 * Callback to check if a buffer source may be compiled to WASM, given |
| 5954 * the compilation is attempted as a promise or not. |
| 5955 */ |
| 5956 |
| 5957 typedef bool (*AllowWasmCompileCallback)(Local<Value> source, bool as_promise); |
| 5958 |
| 5959 typedef bool (*AllowWasmInstantiateCallback)(Local<WasmCompiledModule> module, |
| 5960 Local<Value> ffi, bool as_promise); |
| 5961 |
5950 // --- Garbage Collection Callbacks --- | 5962 // --- Garbage Collection Callbacks --- |
5951 | 5963 |
5952 /** | 5964 /** |
5953 * Applications can register callback functions which will be called before and | 5965 * Applications can register callback functions which will be called before and |
5954 * after certain garbage collection operations. Allocations are not allowed in | 5966 * after certain garbage collection operations. Allocations are not allowed in |
5955 * the callback functions, you therefore cannot manipulate objects (set or | 5967 * the callback functions, you therefore cannot manipulate objects (set or |
5956 * delete properties for example) since it is possible such operations will | 5968 * delete properties for example) since it is possible such operations will |
5957 * result in the allocation of objects. | 5969 * result in the allocation of objects. |
5958 */ | 5970 */ |
5959 enum GCType { | 5971 enum GCType { |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7194 void SetOOMErrorHandler(OOMErrorCallback that); | 7206 void SetOOMErrorHandler(OOMErrorCallback that); |
7195 | 7207 |
7196 /** | 7208 /** |
7197 * Set the callback to invoke to check if code generation from | 7209 * Set the callback to invoke to check if code generation from |
7198 * strings should be allowed. | 7210 * strings should be allowed. |
7199 */ | 7211 */ |
7200 void SetAllowCodeGenerationFromStringsCallback( | 7212 void SetAllowCodeGenerationFromStringsCallback( |
7201 AllowCodeGenerationFromStringsCallback callback); | 7213 AllowCodeGenerationFromStringsCallback callback); |
7202 | 7214 |
7203 /** | 7215 /** |
| 7216 * Set the callback to invoke to check if wasm compilation from |
| 7217 * the specified object is allowed. By default, wasm compilation |
| 7218 * is allowed. |
| 7219 * |
| 7220 * Similar for instantiate. |
| 7221 */ |
| 7222 void SetAllowWasmCompileCallback(AllowWasmCompileCallback callback); |
| 7223 void SetAllowWasmInstantiateCallback(AllowWasmInstantiateCallback callback); |
| 7224 |
| 7225 /** |
7204 * Check if V8 is dead and therefore unusable. This is the case after | 7226 * Check if V8 is dead and therefore unusable. This is the case after |
7205 * fatal errors such as out-of-memory situations. | 7227 * fatal errors such as out-of-memory situations. |
7206 */ | 7228 */ |
7207 bool IsDead(); | 7229 bool IsDead(); |
7208 | 7230 |
7209 /** | 7231 /** |
7210 * Adds a message listener (errors only). | 7232 * Adds a message listener (errors only). |
7211 * | 7233 * |
7212 * The same message listener can be added more than once and in that | 7234 * The same message listener can be added more than once and in that |
7213 * case it will be called more than once for each message. | 7235 * case it will be called more than once for each message. |
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9868 */ | 9890 */ |
9869 | 9891 |
9870 | 9892 |
9871 } // namespace v8 | 9893 } // namespace v8 |
9872 | 9894 |
9873 | 9895 |
9874 #undef TYPE_CHECK | 9896 #undef TYPE_CHECK |
9875 | 9897 |
9876 | 9898 |
9877 #endif // INCLUDE_V8_H_ | 9899 #endif // INCLUDE_V8_H_ |
OLD | NEW |