mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
@@ -178,6 +178,8 @@ ui::ImeTextSpan::UnderlineStyle GetImeUnderlineStyle(
|
||||
return ui::ImeTextSpan::UnderlineStyle::kDash;
|
||||
case CEF_CUS_NONE:
|
||||
return ui::ImeTextSpan::UnderlineStyle::kNone;
|
||||
case CEF_CUS_NUM_VALUES:
|
||||
break;
|
||||
}
|
||||
|
||||
DCHECK(false);
|
||||
@@ -1474,7 +1476,7 @@ void CefRenderWidgetHostViewOSR::OnUpdateTextInputStateCalled(
|
||||
CefRenderHandler::TextInputMode mode = CEF_TEXT_INPUT_MODE_NONE;
|
||||
if (state && state->type != ui::TEXT_INPUT_TYPE_NONE) {
|
||||
static_assert(
|
||||
static_cast<int>(CEF_TEXT_INPUT_MODE_MAX) ==
|
||||
static_cast<int>(CEF_TEXT_INPUT_MODE_NUM_VALUES) - 1 ==
|
||||
static_cast<int>(ui::TEXT_INPUT_MODE_MAX),
|
||||
"Enum values in cef_text_input_mode_t must match ui::TextInputMode");
|
||||
mode = static_cast<CefRenderHandler::TextInputMode>(state->mode);
|
||||
|
@@ -137,7 +137,8 @@ void CefVideoConsumerOSR::OnFrameCaptured(
|
||||
: CEF_COLOR_TYPE_BGRA_8888;
|
||||
|
||||
// Build extra common info.
|
||||
cef_accelerated_paint_info_common_t extra = {};
|
||||
cef_accelerated_paint_info_common_t extra = {
|
||||
sizeof(cef_accelerated_paint_info_common_t)};
|
||||
extra.timestamp = info->timestamp.InMicroseconds();
|
||||
extra.coded_size = {info->coded_size.width(), info->coded_size.height()};
|
||||
extra.visible_rect = {info->visible_rect.x(), info->visible_rect.y(),
|
||||
|
Reference in New Issue
Block a user