| Index: mojo/common/common_custom_types_struct_traits_win.h
|
| diff --git a/mojo/common/common_custom_types_struct_traits_win.h b/mojo/common/common_custom_types_struct_traits_win.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..317bfda1cf36af13079ce1c0286f797a9fe170dd
|
| --- /dev/null
|
| +++ b/mojo/common/common_custom_types_struct_traits_win.h
|
| @@ -0,0 +1,32 @@
|
| +// 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_WIN_H_
|
| +#define MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_WIN_H_
|
| +
|
| +#include "base/win/scoped_handle.h"
|
| +#include "mojo/common/mojo_common_export.h"
|
| +#include "mojo/common/platform_handle.mojom-shared.h"
|
| +
|
| +namespace mojo {
|
| +
|
| +template <>
|
| +struct StructTraits<common::mojom::WindowsHandleDataView,
|
| + base::win::ScopedHandle> {
|
| + static bool IsNull(const base::win::ScopedHandle& handle) {
|
| + return !handle.IsValid();
|
| + }
|
| +
|
| + static void SetToNull(base::win::ScopedHandle* handle) {
|
| + *handle = base::win::ScopedHandle();
|
| + }
|
| +
|
| + static mojo::ScopedHandle wrapped_handle(base::win::ScopedHandle& handle);
|
| + static bool Read(common::mojom::WindowsHandleDataView data,
|
| + base::win::ScopedHandle* handle);
|
| +};
|
| +
|
| +} // namespace mojo
|
| +
|
| +#endif // MOJO_COMMON_COMMON_CUSTOM_TYPES_STRUCT_TRAITS_WIN_H_
|
|
|