Index: cc/ipc/begin_frame_args_struct_traits.h |
diff --git a/cc/ipc/begin_frame_args_struct_traits.h b/cc/ipc/begin_frame_args_struct_traits.h |
index bf3c5a802ed6c61ee718e5cf3e3b1515125f4d27..e287d4922a7cdbc05d79f6b5cc33624702418f03 100644 |
--- a/cc/ipc/begin_frame_args_struct_traits.h |
+++ b/cc/ipc/begin_frame_args_struct_traits.h |
@@ -12,6 +12,14 @@ namespace mojo { |
template <> |
struct StructTraits<cc::mojom::BeginFrameArgsDataView, cc::BeginFrameArgs> { |
+ static uint64_t source_id(const cc::BeginFrameArgs& args) { |
+ return args.source_id; |
+ } |
+ |
+ static uint64_t sequence_number(const cc::BeginFrameArgs& args) { |
+ return args.sequence_number; |
+ } |
+ |
static base::TimeTicks frame_time(const cc::BeginFrameArgs& args) { |
return args.frame_time; |
} |
@@ -39,6 +47,8 @@ struct StructTraits<cc::mojom::BeginFrameArgsDataView, cc::BeginFrameArgs> { |
!data.ReadInterval(&out->interval)) { |
return false; |
} |
+ out->source_id = data.source_id(); |
+ out->sequence_number = data.sequence_number(); |
out->type = |
static_cast<cc::BeginFrameArgs::BeginFrameArgsType>(data.type()); |
out->on_critical_path = data.on_critical_path(); |
@@ -46,6 +56,39 @@ struct StructTraits<cc::mojom::BeginFrameArgsDataView, cc::BeginFrameArgs> { |
} |
}; |
+template <> |
+struct StructTraits<cc::mojom::BeginFrameAckDataView, cc::BeginFrameAck> { |
+ static uint64_t source_id(const cc::BeginFrameAck& ack) { |
+ return ack.source_id; |
+ } |
+ |
+ static uint64_t sequence_number(const cc::BeginFrameAck& ack) { |
+ return ack.sequence_number; |
+ } |
+ |
+ static uint64_t latest_confirmed_frame(const cc::BeginFrameAck& ack) { |
+ return ack.latest_confirmed_frame; |
+ } |
+ |
+ static uint32_t remaining_frames(const cc::BeginFrameAck& ack) { |
+ return ack.remaining_frames; |
+ } |
+ |
+ static bool has_damage(const cc::BeginFrameAck& ack) { |
+ return ack.has_damage; |
+ } |
+ |
+ static bool Read(cc::mojom::BeginFrameAckDataView data, |
+ cc::BeginFrameAck* out) { |
+ out->source_id = data.source_id(); |
+ out->sequence_number = data.sequence_number(); |
+ out->latest_confirmed_frame = data.latest_confirmed_frame(); |
+ out->remaining_frames = data.remaining_frames(); |
+ out->has_damage = data.has_damage(); |
+ return true; |
+ } |
+}; |
+ |
} // namespace mojo |
#endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ |