Commit 648dc8df authored by mfomitchev's avatar mfomitchev Committed by Commit bot

Adding static asserts to LatencyInfo struct traits.

Asserts ensure that the number of items in corresponding ui and mojom enums matches each other.

BUG=NONE

Review-Url: https://codereview.chromium.org/2856623002
Cr-Commit-Position: refs/heads/master@{#468408}
parent 4540a3e7
...@@ -11,6 +11,17 @@ ...@@ -11,6 +11,17 @@
namespace mojo { 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::SourceEventType::SOURCE_EVENT_TYPE_LAST) ==
static_cast<int>(ui::SOURCE_EVENT_TYPE_LAST),
"Enum size mismatch");
template <> template <>
struct ArrayTraits<ui::LatencyInfo::LatencyMap> { struct ArrayTraits<ui::LatencyInfo::LatencyMap> {
using Element = ui::LatencyInfo::LatencyMap::value_type; using Element = ui::LatencyInfo::LatencyMap::value_type;
......
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