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

Unified Diff: cc/ipc/begin_frame_args_struct_traits.cc

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 side-by-side diff with in-line comments
Download patch
Index: cc/ipc/begin_frame_args_struct_traits.cc
diff --git a/cc/ipc/begin_frame_args_struct_traits.cc b/cc/ipc/begin_frame_args_struct_traits.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8ba827dbe1b4d6b4c0e719cd93c6346b13169fb8
--- /dev/null
+++ b/cc/ipc/begin_frame_args_struct_traits.cc
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/ipc/begin_frame_args_struct_traits.h"
+#include "ipc/ipc_message_utils.h"
+#include "mojo/common/common_custom_types_struct_traits.h"
+
+namespace mojo {
+
+// static
+bool StructTraits<cc::mojom::BeginFrameArgsDataView, cc::BeginFrameArgs>::Read(
+ cc::mojom::BeginFrameArgsDataView data,
+ cc::BeginFrameArgs* out) {
+ if (!data.ReadFrameTime(&out->frame_time) ||
+ !data.ReadDeadline(&out->deadline) ||
+ !data.ReadInterval(&out->interval)) {
+ return false;
+ }
+ out->source_id = data.source_id();
+ out->sequence_number = data.sequence_number();
+ // TODO(eseckler): Use EnumTraits for |type|.
+ out->type = static_cast<cc::BeginFrameArgs::BeginFrameArgsType>(data.type());
+ out->on_critical_path = data.on_critical_path();
+ return true;
+}
+
+// static
+bool StructTraits<cc::mojom::BeginFrameAckDataView, cc::BeginFrameAck>::Read(
+ cc::mojom::BeginFrameAckDataView data,
+ cc::BeginFrameAck* out) {
+ out->source_id = data.source_id();
+ out->sequence_number = data.sequence_number();
+ out->latest_confirmed_sequence_number =
+ data.latest_confirmed_sequence_number();
+ return true;
+}
+
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698