Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ | 5 #ifndef CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ |
| 6 #define CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ | 6 #define CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ |
| 7 | 7 |
| 8 #include "cc/ipc/begin_frame_args.mojom-shared.h" | 8 #include "cc/ipc/begin_frame_args.mojom-shared.h" |
| 9 #include "cc/output/begin_frame_args.h" | 9 #include "cc/output/begin_frame_args.h" |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 } | 49 } |
| 50 out->source_id = data.source_id(); | 50 out->source_id = data.source_id(); |
| 51 out->sequence_number = data.sequence_number(); | 51 out->sequence_number = data.sequence_number(); |
| 52 out->type = | 52 out->type = |
| 53 static_cast<cc::BeginFrameArgs::BeginFrameArgsType>(data.type()); | 53 static_cast<cc::BeginFrameArgs::BeginFrameArgsType>(data.type()); |
| 54 out->on_critical_path = data.on_critical_path(); | 54 out->on_critical_path = data.on_critical_path(); |
| 55 return true; | 55 return true; |
| 56 } | 56 } |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 template <> | |
| 60 struct StructTraits<cc::mojom::BeginFrameAckDataView, cc::BeginFrameAck> { | |
| 61 static uint64_t sequence_number(const cc::BeginFrameAck& ack) { | |
| 62 return ack.sequence_number; | |
| 63 } | |
| 64 | |
| 65 static uint64_t latest_confirmed_sequence_number( | |
| 66 const cc::BeginFrameAck& ack) { | |
| 67 return ack.latest_confirmed_sequence_number; | |
| 68 } | |
| 69 | |
| 70 static uint32_t source_id(const cc::BeginFrameAck& ack) { | |
| 71 return ack.source_id; | |
| 72 } | |
| 73 | |
| 74 static uint32_t remaining_frames(const cc::BeginFrameAck& ack) { | |
| 75 return ack.remaining_frames; | |
| 76 } | |
| 77 | |
| 78 static bool has_damage(const cc::BeginFrameAck& ack) { | |
| 79 return ack.has_damage; | |
| 80 } | |
| 81 | |
| 82 static bool Read(cc::mojom::BeginFrameAckDataView data, | |
| 83 cc::BeginFrameAck* out) { | |
|
dcheng
2017/01/05 06:49:54
Nit: Read() methods should generally out-of-lined,
Eric Seckler
2017/01/06 16:08:51
will do when we add it back in a later CL :)
| |
| 84 out->source_id = data.source_id(); | |
| 85 out->sequence_number = data.sequence_number(); | |
| 86 out->latest_confirmed_sequence_number = | |
| 87 data.latest_confirmed_sequence_number(); | |
| 88 out->remaining_frames = data.remaining_frames(); | |
| 89 out->has_damage = data.has_damage(); | |
| 90 return true; | |
| 91 } | |
| 92 }; | |
| 93 | |
| 59 } // namespace mojo | 94 } // namespace mojo |
| 60 | 95 |
| 61 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ | 96 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ |
| OLD | NEW |