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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_IPC_SURFACE_REFERENCE_STRUCT_TRAITS_H_
6 #define CC_IPC_SURFACE_REFERENCE_STRUCT_TRAITS_H_
7
8 #include "cc/ipc/surface_id_struct_traits.h"
9 #include "cc/ipc/surface_reference.mojom-shared.h"
10 #include "cc/surfaces/surface_id.h"
11 #include "cc/surfaces/surface_reference.h"
12
13 namespace mojo {
14
15 template <>
16 struct StructTraits<cc::mojom::SurfaceReferenceDataView, cc::SurfaceReference> {
17 static const cc::SurfaceId& parent_id(const cc::SurfaceReference& ref) {
18 return ref.parent_id();
19 }
20
21 static const cc::SurfaceId& child_id(const cc::SurfaceReference& ref) {
22 return ref.child_id();
23 }
24
25 static bool Read(cc::mojom::SurfaceReferenceDataView data,
26 cc::SurfaceReference* out) {
27 return data.ReadParentId(&out->parent_id_) &&
28 data.ReadChildId(&out->child_id_);
29 }
30 };
31
32 } // namespace mojo
33
34 #endif // CC_IPC_SURFACE_REFERENCE_STRUCT_TRAITS_H_
OLDNEW
« 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