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:
@ -240,7 +240,7 @@ struct CefMenuModelImpl::Item {
|
||||
bool ctrl_pressed_ = false;
|
||||
bool alt_pressed_ = false;
|
||||
|
||||
cef_color_t colors_[CEF_MENU_COLOR_COUNT] = {0};
|
||||
cef_color_t colors_[CEF_MENU_COLOR_NUM_VALUES] = {0};
|
||||
gfx::FontList font_list_;
|
||||
bool has_font_list_ = false;
|
||||
};
|
||||
@ -744,7 +744,7 @@ bool CefMenuModelImpl::SetColorAt(int index,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (color_type < 0 || color_type >= CEF_MENU_COLOR_COUNT) {
|
||||
if (color_type < 0 || color_type >= CEF_MENU_COLOR_NUM_VALUES) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ bool CefMenuModelImpl::GetColorAt(int index,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (color_type < 0 || color_type >= CEF_MENU_COLOR_COUNT) {
|
||||
if (color_type < 0 || color_type >= CEF_MENU_COLOR_NUM_VALUES) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user