Chromium Code Reviews| Index: components/arc/video_accelerator/video_accelerator_struct_traits.cc |
| diff --git a/components/arc/video_accelerator/video_accelerator_struct_traits.cc b/components/arc/video_accelerator/video_accelerator_struct_traits.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c9896cb6e630db30039f892fb00fd97dd3909afd |
| --- /dev/null |
| +++ b/components/arc/video_accelerator/video_accelerator_struct_traits.cc |
| @@ -0,0 +1,24 @@ |
| +// 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. |
| + |
| +#include "components/arc/video_accelerator/video_accelerator_struct_traits.h" |
| + |
| +namespace mojo { |
| + |
| +// static |
| +bool StructTraits<arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView, |
| + arc::ArcVideoAcceleratorDmabufPlane>:: |
| + Read(arc::mojom::ArcVideoAcceleratorDmabufPlaneDataView data, |
| + arc::ArcVideoAcceleratorDmabufPlane* out) { |
| + if (data.offset() < 0 || data.stride() < 0) { |
| + // Invalid offset/stride. |
|
Pawel Osciak
2016/12/14 08:53:14
Nit: this comment is probably unnecessary.
yoshiki
2016/12/14 14:18:04
Done.
|
| + return false; |
| + } |
| + |
| + out->offset = data.offset(); |
| + out->stride = data.stride(); |
| + return true; |
| +} |
| + |
| +} // namespace mojo |