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 | |
5962 // --- Garbage Collection Callbacks --- | 5950 // --- Garbage Collection Callbacks --- |
5963 | 5951 |
5964 /** | 5952 /** |
5965 * Applications can register callback functions which will be called before and | 5953 * Applications can register callback functions which will be called before and |
5966 * after certain garbage collection operations. Allocations are not allowed in | 5954 * after certain garbage collection operations. Allocations are not allowed in |
5967 * the callback functions, you therefore cannot manipulate objects (set or | 5955 * the callback functions, you therefore cannot manipulate objects (set or |
5968 * delete properties for example) since it is possible such operations will | 5956 * delete properties for example) since it is possible such operations will |
5969 * result in the allocation of objects. | 5957 * result in the allocation of objects. |
5970 */ | 5958 */ |
5971 enum GCType { | 5959 enum GCType { |
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7206 void SetOOMErrorHandler(OOMErrorCallback that); | 7194 void SetOOMErrorHandler(OOMErrorCallback that); |
7207 | 7195 |
7208 /** | 7196 /** |
7209 * Set the callback to invoke to check if code generation from | 7197 * Set the callback to invoke to check if code generation from |
7210 * strings should be allowed. | 7198 * strings should be allowed. |
7211 */ | 7199 */ |
7212 void SetAllowCodeGenerationFromStringsCallback( | 7200 void SetAllowCodeGenerationFromStringsCallback( |
7213 AllowCodeGenerationFromStringsCallback callback); | 7201 AllowCodeGenerationFromStringsCallback callback); |
7214 | 7202 |
7215 /** | 7203 /** |
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 /** | |
7226 * Check if V8 is dead and therefore unusable. This is the case after | 7204 * Check if V8 is dead and therefore unusable. This is the case after |
7227 * fatal errors such as out-of-memory situations. | 7205 * fatal errors such as out-of-memory situations. |
7228 */ | 7206 */ |
7229 bool IsDead(); | 7207 bool IsDead(); |
7230 | 7208 |
7231 /** | 7209 /** |
7232 * Adds a message listener (errors only). | 7210 * Adds a message listener (errors only). |
7233 * | 7211 * |
7234 * The same message listener can be added more than once and in that | 7212 * The same message listener can be added more than once and in that |
7235 * case it will be called more than once for each message. | 7213 * case it will be called more than once for each message. |
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9890 */ | 9868 */ |
9891 | 9869 |
9892 | 9870 |
9893 } // namespace v8 | 9871 } // namespace v8 |
9894 | 9872 |
9895 | 9873 |
9896 #undef TYPE_CHECK | 9874 #undef TYPE_CHECK |
9897 | 9875 |
9898 | 9876 |
9899 #endif // INCLUDE_V8_H_ | 9877 #endif // INCLUDE_V8_H_ |
OLD | NEW |