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

Unified Diff: cc/ipc/surface_reference_struct_traits.h

Issue 2537343004: Add SurfaceReference class. (Closed)
Patch Set: Fixes. Created 4 years 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
« no previous file with comments | « cc/ipc/surface_reference.typemap ('k') | cc/ipc/traits_test_service.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/ipc/surface_reference_struct_traits.h
diff --git a/cc/ipc/surface_reference_struct_traits.h b/cc/ipc/surface_reference_struct_traits.h
new file mode 100644
index 0000000000000000000000000000000000000000..209f1b34dd7554624575cf7cffee28e450c3dcca
--- /dev/null
+++ b/cc/ipc/surface_reference_struct_traits.h
@@ -0,0 +1,34 @@
+// Copyright 2016 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.
+
+#ifndef CC_IPC_SURFACE_REFERENCE_STRUCT_TRAITS_H_
+#define CC_IPC_SURFACE_REFERENCE_STRUCT_TRAITS_H_
+
+#include "cc/ipc/surface_id_struct_traits.h"
+#include "cc/ipc/surface_reference.mojom-shared.h"
+#include "cc/surfaces/surface_id.h"
+#include "cc/surfaces/surface_reference.h"
+
+namespace mojo {
+
+template <>
+struct StructTraits<cc::mojom::SurfaceReferenceDataView, cc::SurfaceReference> {
+ static const cc::SurfaceId& parent_id(const cc::SurfaceReference& ref) {
+ return ref.parent_id();
+ }
+
+ static const cc::SurfaceId& child_id(const cc::SurfaceReference& ref) {
+ return ref.child_id();
+ }
+
+ static bool Read(cc::mojom::SurfaceReferenceDataView data,
+ cc::SurfaceReference* out) {
+ return data.ReadParentId(&out->parent_id_) &&
+ data.ReadChildId(&out->child_id_);
+ }
+};
+
+} // namespace mojo
+
+#endif // CC_IPC_SURFACE_REFERENCE_STRUCT_TRAITS_H_
« no previous file with comments | « cc/ipc/surface_reference.typemap ('k') | cc/ipc/traits_test_service.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698