Commit 5bbb5ddd authored by Etienne Pierre-doray's avatar Etienne Pierre-doray Committed by Commit Bot

[Jobs API]: Implement new version of GetMaxConcurrency in V8PlatformTest.

It's necessary to temporarily implement both old and new versions
of GetMaxConcurrency() until v8-platform makes the old version optional.

Bug: 1114823
Change-Id: I284f97a36ffb8718c3b42c05a949cfc29f4f1678
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2375505Reviewed-by: default avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801793}
parent 25136eef
......@@ -74,7 +74,12 @@ TEST(V8PlatformTest, PostJobSimple) {
explicit Task(std::atomic_size_t* num_tasks_to_run)
: num_tasks_to_run(num_tasks_to_run) {}
void Run(v8::JobDelegate* delegate) override { --(*num_tasks_to_run); }
// TODO(1114823): Cleanup the old version once migration is complete.
size_t GetMaxConcurrency() const override { return *num_tasks_to_run; }
size_t GetMaxConcurrency(size_t /* worker_count*/) const override {
return GetMaxConcurrency();
}
std::atomic_size_t* num_tasks_to_run;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment