summaryrefslogtreecommitdiff
path: root/chromium/v8/include/v8-platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/v8/include/v8-platform.h')
-rw-r--r--chromium/v8/include/v8-platform.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/chromium/v8/include/v8-platform.h b/chromium/v8/include/v8-platform.h
index 7cfd18b5708..03be1c8cdd6 100644
--- a/chromium/v8/include/v8-platform.h
+++ b/chromium/v8/include/v8-platform.h
@@ -80,6 +80,14 @@ class TaskRunner {
* implementation takes ownership of |task|. The |task| cannot be nested
* within other task executions.
*
+ * Tasks which shouldn't be interleaved with JS execution must be posted with
+ * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the
+ * embedder may process tasks in a callback which is called during JS
+ * execution.
+ *
+ * In particular, tasks which execute JS must be non-nestable, since JS
+ * execution is not allowed to nest.
+ *
* Requires that |TaskRunner::NonNestableTasksEnabled()| is true.
*/
virtual void PostNonNestableTask(std::unique_ptr<Task> task) {}
@@ -98,6 +106,14 @@ class TaskRunner {
* implementation takes ownership of |task|. The |task| cannot be nested
* within other task executions.
*
+ * Tasks which shouldn't be interleaved with JS execution must be posted with
+ * |PostNonNestableTask| or |PostNonNestableDelayedTask|. This is because the
+ * embedder may process tasks in a callback which is called during JS
+ * execution.
+ *
+ * In particular, tasks which execute JS must be non-nestable, since JS
+ * execution is not allowed to nest.
+ *
* Requires that |TaskRunner::NonNestableDelayedTasksEnabled()| is true.
*/
virtual void PostNonNestableDelayedTask(std::unique_ptr<Task> task,
@@ -519,9 +535,8 @@ class Platform {
* libplatform looks like:
* std::unique_ptr<JobHandle> PostJob(
* TaskPriority priority, std::unique_ptr<JobTask> job_task) override {
- * return std::make_unique<DefaultJobHandle>(
- * std::make_shared<DefaultJobState>(
- * this, std::move(job_task), kNumThreads));
+ * return v8::platform::NewDefaultJobHandle(
+ * this, priority, std::move(job_task), NumberOfWorkerThreads());
* }
*/
virtual std::unique_ptr<JobHandle> PostJob(