Commit aa4d8e06 authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Use built-in kMaxValue enumerator for LatencyInfo mojo enums.

There's no need to define _LAST enumerators, since Mojo provides these
automatically.

Bug: 742517
Change-Id: Ibafea09dd000cf14db4033790bef6a860b5030e6
Reviewed-on: https://chromium-review.googlesource.com/1159263Reviewed-by: default avatarTimothy Dresser <tdresser@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#580245}
parent 069f15c9
......@@ -56,8 +56,6 @@ enum LatencyComponentType {
// Timestamp when the frame is swapped (i.e. when the rendering caused by
// input event actually takes effect).
INPUT_EVENT_LATENCY_FRAME_SWAP_COMPONENT,
LATENCY_COMPONENT_TYPE_LAST =
INPUT_EVENT_LATENCY_FRAME_SWAP_COMPONENT,
};
enum SourceEventType {
......@@ -70,7 +68,6 @@ enum SourceEventType {
TOUCHPAD,
FRAME,
OTHER,
SOURCE_EVENT_TYPE_LAST = OTHER,
};
// See ui/latency/latency_info.h
......
......@@ -201,7 +201,7 @@ EnumTraits<ui::mojom::LatencyComponentType, ui::LatencyComponentType>::ToMojom(
INPUT_EVENT_LATENCY_FRAME_SWAP_COMPONENT;
}
NOTREACHED();
return ui::mojom::LatencyComponentType::LATENCY_COMPONENT_TYPE_LAST;
return ui::mojom::LatencyComponentType::kMaxValue;
}
// static
......
......@@ -11,16 +11,13 @@
namespace mojo {
static_assert(
static_cast<int>(
ui::mojom::LatencyComponentType::LATENCY_COMPONENT_TYPE_LAST) ==
static_cast<int>(ui::LATENCY_COMPONENT_TYPE_LAST),
"Enum size mismatch");
static_assert(static_cast<int>(ui::mojom::LatencyComponentType::kMaxValue) ==
static_cast<int>(ui::LATENCY_COMPONENT_TYPE_LAST),
"Enum size mismatch");
static_assert(
static_cast<int>(ui::mojom::SourceEventType::SOURCE_EVENT_TYPE_LAST) ==
static_cast<int>(ui::SOURCE_EVENT_TYPE_LAST),
"Enum size mismatch");
static_assert(static_cast<int>(ui::mojom::SourceEventType::kMaxValue) ==
static_cast<int>(ui::SOURCE_EVENT_TYPE_LAST),
"Enum size mismatch");
template <>
struct ArrayTraits<ui::LatencyInfo::LatencyMap> {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment