summaryrefslogtreecommitdiff
path: root/chromium/gin/public/cppgc.h
blob: 8844f948ec0724c15b338549c7a3ac60b8301224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef GIN_PUBLIC_CPPGC_H_
#define GIN_PUBLIC_CPPGC_H_

#include "gin/gin_export.h"

namespace gin {

// A wrapper around `cppgc::InitializeProcess()` which helps to guarantee that
// cppgc is initialized only once when there are multiple users of cppgc in same
// process.
GIN_EXPORT void InitializeCppgcFromV8Platform();

// Calls `cppgc::ShutdownProcess()` only after being called as many times as
// `InitializeCppgcFromV8Platform()`. Helps to guarantee that cppgc is shutdown
// only after all users in the same process are done using it. Number of calls
// cannot exceed that of `InitializeCppgcFromV8Platform()`.
GIN_EXPORT void MaybeShutdownCppgc();

}  // namespace gin

#endif  // GIN_PUBLIC_CPPGC_H_