1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "gin/public/cppgc.h"
7 #include "base/check_op.h"
8 #include "gin/public/v8_platform.h"
9 #include "v8/include/cppgc/platform.h"
19 void InitializeCppgcFromV8Platform() {
20 DCHECK_GE(g_init_count, 0);
21 if (g_init_count++ > 0)
24 cppgc::InitializeProcess(gin::V8Platform::Get()->GetPageAllocator());
27 void MaybeShutdownCppgc() {
28 DCHECK_GT(g_init_count, 0);
29 if (--g_init_count > 0)
32 cppgc::ShutdownProcess();