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

Unified Diff: src/isolate.h

Issue 2752043002: [promises] Add %WaitForPromise runtime call to allow tests to reliably wait for promises to be fini… (Closed)
Patch Set: Strip it down to %IncrementWaitCount and %DecrementWaitCount Created 3 years, 9 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
« src/d8.cc ('K') | « src/d8.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.h
diff --git a/src/isolate.h b/src/isolate.h
index c94ace2dd612dcf20c5849b05746a2440924a5f8..d705f40fbbfd12026d17a169bbebcd33c7f93863 100644
--- a/src/isolate.h
+++ b/src/isolate.h
@@ -1243,6 +1243,11 @@ class Isolate {
// reset to nullptr.
void UnregisterFromReleaseAtTeardown(ManagedObjectFinalizer** finalizer_ptr);
+ // Can be used by tests to force d8 to wait for certain things to run.
+ inline void IncrementWaitCount() { wait_count_++; }
+ inline void DecrementWaitCount() { wait_count_--; }
+ inline int GetWaitCount() { return wait_count_; }
+
protected:
explicit Isolate(bool enable_serializer);
bool IsArrayOrObjectPrototype(Object* object);
@@ -1528,6 +1533,8 @@ class Isolate {
size_t total_regexp_code_generated_;
+ int wait_count_ = 0;
+
friend class ExecutionAccess;
friend class HandleScopeImplementer;
friend class HeapTester;
« src/d8.cc ('K') | « src/d8.cc ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698