| Index: mojo/common/common_custom_types_struct_traits_posix.h
|
| diff --git a/mojo/common/common_custom_types_struct_traits_posix.h b/mojo/common/common_custom_types_struct_traits_posix.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ac7d95230d57e981df8607a9794f10d781d00349
|
| --- /dev/null
|
| +++ b/mojo/common/common_custom_types_struct_traits_posix.h
|
| @@ -0,0 +1,27 @@
|
| +// 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 MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_POSIX_H_
|
| +#define MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_POSIX_H_
|
| +
|
| +#include "base/files/scoped_file.h"
|
| +#include "mojo/common/mojo_common_export.h"
|
| +#include "mojo/common/platform_handle.mojom-shared.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +template <>
|
| +struct StructTraits<common::mojom::FileDescriptorDataView, base::ScopedFD> {
|
| + static bool IsNull(const base::ScopedFD& fd) { return !fd.is_valid(); }
|
| +
|
| + static void SetToNull(base::ScopedFD* fd) { *fd = base::ScopedFD(); }
|
| +
|
| + static mojo::ScopedHandle wrapped_handle(base::ScopedFD& fd);
|
| + static bool Read(common::mojom::FileDescriptorDataView data,
|
| + base::ScopedFD* fd);
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_POSIX_H_
|
|
|