Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: cc/ipc/begin_frame_args_struct_traits.h

Issue 2740833005: [cc] Pass on BeginFrameAcks from CompositorEBFS through RWHVAura, DFH. (Closed)
Patch Set: address security comments Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 23 matching lines...) Expand all
34 34
35 static cc::mojom::BeginFrameArgsType type(const cc::BeginFrameArgs& args) { 35 static cc::mojom::BeginFrameArgsType type(const cc::BeginFrameArgs& args) {
36 return static_cast<cc::mojom::BeginFrameArgsType>(args.type); 36 return static_cast<cc::mojom::BeginFrameArgsType>(args.type);
37 } 37 }
38 38
39 static bool on_critical_path(const cc::BeginFrameArgs& args) { 39 static bool on_critical_path(const cc::BeginFrameArgs& args) {
40 return args.on_critical_path; 40 return args.on_critical_path;
41 } 41 }
42 42
43 static bool Read(cc::mojom::BeginFrameArgsDataView data, 43 static bool Read(cc::mojom::BeginFrameArgsDataView data,
44 cc::BeginFrameArgs* out) { 44 cc::BeginFrameArgs* out);
45 if (!data.ReadFrameTime(&out->frame_time) || 45 };
46 !data.ReadDeadline(&out->deadline) || 46
47 !data.ReadInterval(&out->interval)) { 47 template <>
48 return false; 48 struct StructTraits<cc::mojom::BeginFrameAckDataView, cc::BeginFrameAck> {
49 } 49 static uint64_t sequence_number(const cc::BeginFrameAck& ack) {
50 out->source_id = data.source_id(); 50 return ack.sequence_number;
51 out->sequence_number = data.sequence_number();
52 out->type =
53 static_cast<cc::BeginFrameArgs::BeginFrameArgsType>(data.type());
54 out->on_critical_path = data.on_critical_path();
55 return true;
56 } 51 }
52
53 static uint64_t latest_confirmed_sequence_number(
54 const cc::BeginFrameAck& ack) {
55 return ack.latest_confirmed_sequence_number;
56 }
57
58 static uint32_t source_id(const cc::BeginFrameAck& ack) {
59 return ack.source_id;
60 }
61
62 static bool Read(cc::mojom::BeginFrameAckDataView data,
63 cc::BeginFrameAck* out);
57 }; 64 };
58 65
59 } // namespace mojo 66 } // namespace mojo
60 67
61 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_ 68 #endif // CC_IPC_BEGIN_FRAME_ARGS_STRUCT_TRAITS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698