Add NUM_VALUES for enums and size for structs (see #3836)

API versioning requires that enumerations end with a count value
(`*_NUM_VALUES`) and structs begin with a size value (`size_t size`).
Wrapper templates are updated to support structs with different size
values indicating different versions.

To test:
Run `ceftests --gtest_filter=ApiVersionTest.StructVersion*`
This commit is contained in:
Marshall Greenblatt
2025-01-09 19:14:53 -05:00
parent ee5cec12d2
commit 81a5005bc0
43 changed files with 777 additions and 228 deletions

View File

@ -379,18 +379,22 @@ void CefBrowserContentsDelegate::PrimaryMainFrameRenderProcessGone(
base::TerminationStatus status) {
static_assert(static_cast<int>(CEF_RESULT_CODE_CHROME_FIRST) ==
static_cast<int>(chrome::RESULT_CODE_CHROME_START),
"enum mismatch");
"CEF_RESULT_CODE_CHROME_FIRST must match "
"chrome::RESULT_CODE_CHROME_START");
static_assert(static_cast<int>(CEF_RESULT_CODE_CHROME_LAST) ==
static_cast<int>(chrome::RESULT_CODE_CHROME_LAST_CODE),
"enum mismatch");
"CEF_RESULT_CODE_CHROME_LAST must match "
"chrome::RESULT_CODE_CHROME_LAST_CODE");
#if defined(OS_WIN)
static_assert(static_cast<int>(CEF_RESULT_CODE_SANDBOX_FATAL_FIRST) ==
static_cast<int>(sandbox::SBOX_FATAL_INTEGRITY),
"enum mismatch");
static_assert(static_cast<int>(CEF_RESULT_CODE_SANDBOX_FATAL_LAST) ==
static_cast<int>(sandbox::SBOX_FATAL_LAST),
"enum mismatch");
"CEF_RESULT_CODE_SANDBOX_FATAL_FIRST must match "
"sandbox::SBOX_FATAL_INTEGRITY");
static_assert(
static_cast<int>(CEF_RESULT_CODE_SANDBOX_FATAL_LAST) ==
static_cast<int>(sandbox::SBOX_FATAL_LAST),
"CEF_RESULT_CODE_SANDBOX_FATAL_LAST must match sandbox::SBOX_FATAL_LAST");
#endif
cef_termination_status_t ts = TS_ABNORMAL_TERMINATION;