Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index 684b2c292ed9448a739e46b8358bb0339eb69d43..922bd6459daab7199d133b87ce2e5811a810ca5c 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -4113,6 +4113,24 @@ class V8_EXPORT Isolate { |
| }; |
| /** |
| + * Do not run microtasks while this scope is active, even if microtasks are |
| + * automatically executed otherwise. |
| + */ |
| + class V8_EXPORT SuppressMicrotaskExecutionScope { |
| + public: |
| + explicit SuppressMicrotaskExecutionScope(Isolate* isolate); |
| + ~SuppressMicrotaskExecutionScope(); |
| + |
| + private: |
| + void* internal_; |
|
adamk
2014/05/02 19:16:53
This can just be "v8::internal::Isolate* isolate_"
|
| + |
| + // Prevent copying of Scope objects. |
| + SuppressMicrotaskExecutionScope(const SuppressMicrotaskExecutionScope&); |
| + SuppressMicrotaskExecutionScope& operator=( |
| + const SuppressMicrotaskExecutionScope&); |
| + }; |
| + |
| + /** |
| * Types of garbage collections that can be requested via |
| * RequestGarbageCollectionForTesting. |
| */ |
| @@ -4361,6 +4379,22 @@ class V8_EXPORT Isolate { |
| */ |
| void RemoveCallCompletedCallback(CallCompletedCallback callback); |
| + /** |
| + * Experimental: Runs the Microtask Work Queue until empty |
| + */ |
| + void RunMicrotasks(); |
| + |
| + /** |
| + * Experimental: Enqueues the callback to the Microtask Work Queue |
| + */ |
| + void EnqueueMicrotask(Handle<Function> microtask); |
| + |
| + /** |
| + * Experimental: Controls whether the Microtask Work Queue is automatically |
| + * run when the script call depth decrements to zero. |
| + */ |
| + void SetAutorunMicrotasks(bool autorun); |
| + |
| private: |
| template<class K, class V, class Traits> friend class PersistentValueMap; |
| @@ -4724,17 +4758,23 @@ class V8_EXPORT V8 { |
| /** |
| * Experimental: Runs the Microtask Work Queue until empty |
| + * |
| + * Deprecated: Use methods on Isolate instead. |
| */ |
| static void RunMicrotasks(Isolate* isolate); |
| /** |
| * Experimental: Enqueues the callback to the Microtask Work Queue |
| + * |
| + * Deprecated: Use methods on Isolate instead. |
| */ |
| static void EnqueueMicrotask(Isolate* isolate, Handle<Function> microtask); |
| /** |
| * Experimental: Controls whether the Microtask Work Queue is automatically |
| * run when the script call depth decrements to zero. |
| + * |
| + * Deprecated: Use methods on Isolate instead. |
| */ |
| static void SetAutorunMicrotasks(Isolate *source, bool autorun); |