Chromium Code Reviews| 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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1064 */ | 1064 */ |
| 1065 V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context, | 1065 V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context, |
| 1066 ResolveCallback callback); | 1066 ResolveCallback callback); |
| 1067 | 1067 |
| 1068 /** | 1068 /** |
| 1069 * ModuleEvaluation | 1069 * ModuleEvaluation |
| 1070 * | 1070 * |
| 1071 * Returns the completion value. | 1071 * Returns the completion value. |
| 1072 */ | 1072 */ |
| 1073 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); | 1073 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); |
| 1074 | |
| 1075 static V8_WARN_UNUSED_RESULT bool FinishDynamicImportSuccess( | |
| 1076 Local<Context> context, Local<Promise> promise, Local<Module> module); | |
| 1077 | |
| 1078 static V8_WARN_UNUSED_RESULT bool FinishDynamicImportFailure( | |
| 1079 Local<Context> context, Local<Promise> promise, Local<Value> exception); | |
|
neis
2017/03/17 10:36:31
Please add a comment for these too.
gsathya
2017/03/17 21:47:59
Done.
| |
| 1074 }; | 1080 }; |
| 1075 | 1081 |
| 1076 /** | 1082 /** |
| 1077 * A compiled JavaScript script, tied to a Context which was active when the | 1083 * A compiled JavaScript script, tied to a Context which was active when the |
| 1078 * script was compiled. | 1084 * script was compiled. |
| 1079 */ | 1085 */ |
| 1080 class V8_EXPORT Script { | 1086 class V8_EXPORT Script { |
| 1081 public: | 1087 public: |
| 1082 /** | 1088 /** |
| 1083 * A shorthand for ScriptCompiler::Compile(). | 1089 * A shorthand for ScriptCompiler::Compile(). |
| (...skipping 4696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5780 kAllocationActionAllocate = 1 << 0, | 5786 kAllocationActionAllocate = 1 << 0, |
| 5781 kAllocationActionFree = 1 << 1, | 5787 kAllocationActionFree = 1 << 1, |
| 5782 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree | 5788 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree |
| 5783 }; | 5789 }; |
| 5784 | 5790 |
| 5785 // --- Enter/Leave Script Callback --- | 5791 // --- Enter/Leave Script Callback --- |
| 5786 typedef void (*BeforeCallEnteredCallback)(Isolate*); | 5792 typedef void (*BeforeCallEnteredCallback)(Isolate*); |
| 5787 typedef void (*CallCompletedCallback)(Isolate*); | 5793 typedef void (*CallCompletedCallback)(Isolate*); |
| 5788 typedef void (*DeprecatedCallCompletedCallback)(); | 5794 typedef void (*DeprecatedCallCompletedCallback)(); |
| 5789 | 5795 |
| 5796 typedef void (*HostImportModuleDynamicallyCallback)(Isolate* isolate, | |
| 5797 Local<String> referrer, | |
| 5798 Local<String> specifier, | |
| 5799 Local<Promise> promise); | |
| 5800 | |
| 5790 /** | 5801 /** |
| 5791 * PromiseHook with type kInit is called when a new promise is | 5802 * PromiseHook with type kInit is called when a new promise is |
| 5792 * created. When a new promise is created as part of the chain in the | 5803 * created. When a new promise is created as part of the chain in the |
| 5793 * case of Promise.then or in the intermediate promises created by | 5804 * case of Promise.then or in the intermediate promises created by |
| 5794 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise | 5805 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise |
| 5795 * otherwise we pass undefined. | 5806 * otherwise we pass undefined. |
| 5796 * | 5807 * |
| 5797 * PromiseHook with type kResolve is called at the beginning of | 5808 * PromiseHook with type kResolve is called at the beginning of |
| 5798 * resolve or reject function defined by CreateResolvingFunctions. | 5809 * resolve or reject function defined by CreateResolvingFunctions. |
| 5799 * | 5810 * |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6329 struct CreateParams { | 6340 struct CreateParams { |
| 6330 CreateParams() | 6341 CreateParams() |
| 6331 : entry_hook(nullptr), | 6342 : entry_hook(nullptr), |
| 6332 code_event_handler(nullptr), | 6343 code_event_handler(nullptr), |
| 6333 snapshot_blob(nullptr), | 6344 snapshot_blob(nullptr), |
| 6334 counter_lookup_callback(nullptr), | 6345 counter_lookup_callback(nullptr), |
| 6335 create_histogram_callback(nullptr), | 6346 create_histogram_callback(nullptr), |
| 6336 add_histogram_sample_callback(nullptr), | 6347 add_histogram_sample_callback(nullptr), |
| 6337 array_buffer_allocator(nullptr), | 6348 array_buffer_allocator(nullptr), |
| 6338 external_references(nullptr), | 6349 external_references(nullptr), |
| 6339 allow_atomics_wait(true) {} | 6350 allow_atomics_wait(true), |
| 6351 host_import_module_dynamically_callback_(nullptr) {} | |
| 6340 | 6352 |
| 6341 /** | 6353 /** |
| 6342 * The optional entry_hook allows the host application to provide the | 6354 * The optional entry_hook allows the host application to provide the |
| 6343 * address of a function that's invoked on entry to every V8-generated | 6355 * address of a function that's invoked on entry to every V8-generated |
| 6344 * function. Note that entry_hook is invoked at the very start of each | 6356 * function. Note that entry_hook is invoked at the very start of each |
| 6345 * generated function. | 6357 * generated function. |
| 6346 * An entry_hook can only be provided in no-snapshot builds; in snapshot | 6358 * An entry_hook can only be provided in no-snapshot builds; in snapshot |
| 6347 * builds it must be nullptr. | 6359 * builds it must be nullptr. |
| 6348 */ | 6360 */ |
| 6349 FunctionEntryHook entry_hook; | 6361 FunctionEntryHook entry_hook; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6392 * deserialization. This array and its content must stay valid for the | 6404 * deserialization. This array and its content must stay valid for the |
| 6393 * entire lifetime of the isolate. | 6405 * entire lifetime of the isolate. |
| 6394 */ | 6406 */ |
| 6395 intptr_t* external_references; | 6407 intptr_t* external_references; |
| 6396 | 6408 |
| 6397 /** | 6409 /** |
| 6398 * Whether calling Atomics.wait (a function that may block) is allowed in | 6410 * Whether calling Atomics.wait (a function that may block) is allowed in |
| 6399 * this isolate. | 6411 * this isolate. |
| 6400 */ | 6412 */ |
| 6401 bool allow_atomics_wait; | 6413 bool allow_atomics_wait; |
| 6414 | |
| 6415 /** | |
| 6416 * TODO(gsathya): Write doc | |
|
neis
2017/03/17 10:36:31
You could do that now :)
gsathya
2017/03/17 21:47:59
Done.
| |
| 6417 */ | |
| 6418 HostImportModuleDynamicallyCallback | |
| 6419 host_import_module_dynamically_callback_; | |
| 6402 }; | 6420 }; |
| 6403 | 6421 |
| 6404 | 6422 |
| 6405 /** | 6423 /** |
| 6406 * Stack-allocated class which sets the isolate for all operations | 6424 * Stack-allocated class which sets the isolate for all operations |
| 6407 * executed within a local scope. | 6425 * executed within a local scope. |
| 6408 */ | 6426 */ |
| 6409 class V8_EXPORT Scope { | 6427 class V8_EXPORT Scope { |
| 6410 public: | 6428 public: |
| 6411 explicit Scope(Isolate* isolate) : isolate_(isolate) { | 6429 explicit Scope(Isolate* isolate) : isolate_(isolate) { |
| (...skipping 3419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 9831 */ | 9849 */ |
| 9832 | 9850 |
| 9833 | 9851 |
| 9834 } // namespace v8 | 9852 } // namespace v8 |
| 9835 | 9853 |
| 9836 | 9854 |
| 9837 #undef TYPE_CHECK | 9855 #undef TYPE_CHECK |
| 9838 | 9856 |
| 9839 | 9857 |
| 9840 #endif // INCLUDE_V8_H_ | 9858 #endif // INCLUDE_V8_H_ |
| OLD | NEW |