#include "ipc/ipc_message_attachment.h"
#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "build/build_config.h"
#include "ipc/ipc_mojo_handle_attachment.h"
#include "mojo/public/cpp/system/platform_handle.h"
#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
#include <unistd.h>
#include "base/posix/eintr_wrapper.h"
#include "ipc/ipc_platform_file_attachment_posix.h"
#endif
#if BUILDFLAG(IS_MAC)
#include "ipc/mach_port_attachment_mac.h"
#endif
#if BUILDFLAG(IS_WIN)
#include "ipc/handle_attachment_win.h"
#endif
#if BUILDFLAG(IS_FUCHSIA)
#include "ipc/handle_attachment_fuchsia.h"
#endif
namespace IPC {
namespace {
#if BUILDFLAG(IS_POSIX) || BUILDFLAG(IS_FUCHSIA)
base::ScopedFD TakeOrDupFile(internal::PlatformFileAttachment* attachment) { … }
#endif
}
MessageAttachment::MessageAttachment() = default;
MessageAttachment::~MessageAttachment() = default;
mojo::ScopedHandle MessageAttachment::TakeMojoHandle() { … }
scoped_refptr<MessageAttachment> MessageAttachment::CreateFromMojoHandle(
mojo::ScopedHandle handle,
Type type) { … }
}