Commit 3490fb77 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[gin] Do not create a new object on every background task posted from v8.

Bug: 817330
Change-Id: Ifb402ed997f4c2b4d96e1b4124ee518b8700f69a
Reviewed-on: https://chromium-review.googlesource.com/940140Reviewed-by: default avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539823}
parent 8bcf9a26
......@@ -327,7 +327,9 @@ std::shared_ptr<v8::TaskRunner> V8Platform::GetForegroundTaskRunner(
std::shared_ptr<v8::TaskRunner> V8Platform::GetBackgroundTaskRunner(
v8::Isolate* isolate) {
return std::make_shared<V8BackgroundTaskRunner>();
static std::shared_ptr<v8::TaskRunner> v8_background_task_runner =
std::make_shared<V8BackgroundTaskRunner>();
return v8_background_task_runner;
}
size_t V8Platform::NumberOfAvailableBackgroundThreads() {
......
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