Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 2f3c77600745b4b20482617f32995d3b20569557..6dbc8671f57cbc4a1c3594aa0db5da50a25ee5f6 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -1070,6 +1070,19 @@ class V8_EXPORT Module { |
| * Returns the completion value. |
| */ |
| V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); |
| + |
| + /** |
| + * Resolves the promise with the namespace object of the given |
| + * module. |
| + */ |
| + static V8_WARN_UNUSED_RESULT bool FinishDynamicImportSuccess( |
| + Local<Context> context, Local<Promise> promise, Local<Module> module); |
| + |
| + /** |
| + * Rejects the promise with the given exception. |
| + */ |
| + static V8_WARN_UNUSED_RESULT bool FinishDynamicImportFailure( |
| + Local<Context> context, Local<Promise> promise, Local<Value> exception); |
| }; |
| /** |
| @@ -5789,6 +5802,11 @@ typedef void (*BeforeCallEnteredCallback)(Isolate*); |
| typedef void (*CallCompletedCallback)(Isolate*); |
| typedef void (*DeprecatedCallCompletedCallback)(); |
| +typedef void (*HostImportModuleDynamicallyCallback)(Isolate* isolate, |
| + Local<String> referrer, |
| + Local<String> specifier, |
| + Local<Promise> promise); |
|
gsathya
2017/03/22 03:08:34
Jochen --
The embedder should not tamper with the
|
| + |
| /** |
| * PromiseHook with type kInit is called when a new promise is |
| * created. When a new promise is created as part of the chain in the |
| @@ -6342,7 +6360,8 @@ class V8_EXPORT Isolate { |
| add_histogram_sample_callback(nullptr), |
| array_buffer_allocator(nullptr), |
| external_references(nullptr), |
| - allow_atomics_wait(true) {} |
| + allow_atomics_wait(true), |
| + host_import_module_dynamically_callback_(nullptr) {} |
| /** |
| * The optional entry_hook allows the host application to provide the |
| @@ -6405,6 +6424,16 @@ class V8_EXPORT Isolate { |
| * this isolate. |
| */ |
| bool allow_atomics_wait; |
| + |
| + /** |
| + * This is an unfinished experimental feature, and is only exposed |
| + * here for internal testing purposes. DO NOT USE. |
| + * |
| + * This specifies the callback called by the upcoming dynamic |
| + * import() language feature to load modules. |
| + */ |
| + HostImportModuleDynamicallyCallback |
| + host_import_module_dynamically_callback_; |
| }; |