Michael Lippautz | ca27947 | 2021-04-23 16:13:52 +0000 | [diff] [blame] | 1 | // Copyright 2021 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "gin/public/cppgc.h" |
| 6 | #include "gin/public/v8_platform.h" |
| 7 | #include "v8/include/cppgc/platform.h" |
| 8 | |
| 9 | namespace gin { |
| 10 | |
| 11 | void InitializeCppgcFromV8Platform() { |
| 12 | static bool cppgc_is_initialized = false; |
| 13 | if (cppgc_is_initialized) |
| 14 | return; |
| 15 | |
| 16 | cppgc::InitializeProcess(gin::V8Platform::Get()->GetPageAllocator()); |
| 17 | |
| 18 | cppgc_is_initialized = true; |
| 19 | } |
| 20 | |
| 21 | } // namespace gin |