Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Unified Diff: include/v8.h

Issue 263933002: Introduce a microtask suppression scope and move microtask methods to isolate (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 684b2c292ed9448a739e46b8358bb0339eb69d43..6a91140a4d04b682b75070c55955e824a209f8b1 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:
+ 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);
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698