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:
@@ -120,6 +120,12 @@ class CefRegistrationImpl : public CefRegistration,
|
||||
|
||||
static CefMediaObserver::ConnectionState ToConnectionState(
|
||||
blink::mojom::PresentationConnectionState state) {
|
||||
static_assert(static_cast<int>(CEF_MRCS_NUM_VALUES) - 1 ==
|
||||
static_cast<int>(
|
||||
blink::mojom::PresentationConnectionState::kMaxValue),
|
||||
"Enum values in cef_media_route_connection_state_t must "
|
||||
"match blink::mojom::PresentationConnectionState");
|
||||
|
||||
switch (state) {
|
||||
case blink::mojom::PresentationConnectionState::CONNECTING:
|
||||
return CEF_MRCS_CONNECTING;
|
||||
@@ -284,6 +290,12 @@ void CefMediaRouterImpl::NotifyCurrentRoutesInternal() {
|
||||
void CefMediaRouterImpl::CreateRouteCallback(
|
||||
CefRefPtr<CefMediaRouteCreateCallback> callback,
|
||||
const media_router::RouteRequestResult& result) {
|
||||
static_assert(static_cast<int>(CEF_MRCR_NUM_VALUES) - 1 ==
|
||||
static_cast<int>(
|
||||
media_router::mojom::RouteRequestResultCode::kMaxValue),
|
||||
"Enum values in cef_media_route_create_result_t must match "
|
||||
"media_router::mojom::RouteRequestResultCode");
|
||||
|
||||
DCHECK(ValidContext());
|
||||
|
||||
if (result.result_code() != media_router::mojom::RouteRequestResultCode::OK) {
|
||||
|
Reference in New Issue
Block a user