#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "mojo/public/cpp/base/file_path_mojom_traits.h"
#include "build/build_config.h"
namespace mojo {
bool StructTraits<mojo_base::mojom::FilePathDataView, base::FilePath>::Read(
mojo_base::mojom::FilePathDataView data,
base::FilePath* out) { … }
#if BUILDFLAG(IS_WIN)
base::span<const uint16_t>
StructTraits<mojo_base::mojom::RelativeFilePathDataView, base::FilePath>::path(
const base::FilePath& path) {
CHECK(!path.IsAbsolute());
CHECK(!path.ReferencesParent());
return base::make_span(reinterpret_cast<const uint16_t*>(path.value().data()),
path.value().size());
}
#else
const base::FilePath::StringType&
StructTraits<mojo_base::mojom::RelativeFilePathDataView, base::FilePath>::path(
const base::FilePath& path) { … }
#endif
bool StructTraits<mojo_base::mojom::RelativeFilePathDataView, base::FilePath>::
Read(mojo_base::mojom::RelativeFilePathDataView data, base::FilePath* out) { … }
}