| 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)(Isolate* isolate, Local<Value> source, |
| 5958 bool as_promise); |
| 5959 |
| 5960 typedef bool (*AllowWasmInstantiateCallback)(Isolate* isolate, |
| 5961 Local<Value> module_or_bytes, |
| 5962 MaybeLocal<Value> ffi, |
| 5963 bool as_promise); |
| 5964 |
| 5950 // --- Garbage Collection Callbacks --- | 5965 // --- Garbage Collection Callbacks --- |
| 5951 | 5966 |
| 5952 /** | 5967 /** |
| 5953 * Applications can register callback functions which will be called before and | 5968 * Applications can register callback functions which will be called before and |
| 5954 * after certain garbage collection operations. Allocations are not allowed in | 5969 * after certain garbage collection operations. Allocations are not allowed in |
| 5955 * the callback functions, you therefore cannot manipulate objects (set or | 5970 * the callback functions, you therefore cannot manipulate objects (set or |
| 5956 * delete properties for example) since it is possible such operations will | 5971 * delete properties for example) since it is possible such operations will |
| 5957 * result in the allocation of objects. | 5972 * result in the allocation of objects. |
| 5958 */ | 5973 */ |
| 5959 enum GCType { | 5974 enum GCType { |
| (...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7194 void SetOOMErrorHandler(OOMErrorCallback that); | 7209 void SetOOMErrorHandler(OOMErrorCallback that); |
| 7195 | 7210 |
| 7196 /** | 7211 /** |
| 7197 * Set the callback to invoke to check if code generation from | 7212 * Set the callback to invoke to check if code generation from |
| 7198 * strings should be allowed. | 7213 * strings should be allowed. |
| 7199 */ | 7214 */ |
| 7200 void SetAllowCodeGenerationFromStringsCallback( | 7215 void SetAllowCodeGenerationFromStringsCallback( |
| 7201 AllowCodeGenerationFromStringsCallback callback); | 7216 AllowCodeGenerationFromStringsCallback callback); |
| 7202 | 7217 |
| 7203 /** | 7218 /** |
| 7219 * Set the callback to invoke to check if wasm compilation from |
| 7220 * the specified object is allowed. By default, wasm compilation |
| 7221 * is allowed. |
| 7222 * |
| 7223 * Similar for instantiate. |
| 7224 */ |
| 7225 void SetAllowWasmCompileCallback(AllowWasmCompileCallback callback); |
| 7226 void SetAllowWasmInstantiateCallback(AllowWasmInstantiateCallback callback); |
| 7227 |
| 7228 /** |
| 7204 * Check if V8 is dead and therefore unusable. This is the case after | 7229 * Check if V8 is dead and therefore unusable. This is the case after |
| 7205 * fatal errors such as out-of-memory situations. | 7230 * fatal errors such as out-of-memory situations. |
| 7206 */ | 7231 */ |
| 7207 bool IsDead(); | 7232 bool IsDead(); |
| 7208 | 7233 |
| 7209 /** | 7234 /** |
| 7210 * Adds a message listener (errors only). | 7235 * Adds a message listener (errors only). |
| 7211 * | 7236 * |
| 7212 * The same message listener can be added more than once and in that | 7237 * 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. | 7238 * 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 */ | 9893 */ |
| 9869 | 9894 |
| 9870 | 9895 |
| 9871 } // namespace v8 | 9896 } // namespace v8 |
| 9872 | 9897 |
| 9873 | 9898 |
| 9874 #undef TYPE_CHECK | 9899 #undef TYPE_CHECK |
| 9875 | 9900 |
| 9876 | 9901 |
| 9877 #endif // INCLUDE_V8_H_ | 9902 #endif // INCLUDE_V8_H_ |
| OLD | NEW |