xref: /aosp_15_r20/external/cronet/ipc/ipc_mojo_handle_attachment.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2015 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "ipc/ipc_mojo_handle_attachment.h"
6 
7 #include <utility>
8 
9 #include "build/build_config.h"
10 
11 namespace IPC {
12 namespace internal {
13 
MojoHandleAttachment(mojo::ScopedHandle handle)14 MojoHandleAttachment::MojoHandleAttachment(mojo::ScopedHandle handle)
15     : handle_(std::move(handle)) {}
16 
17 MojoHandleAttachment::~MojoHandleAttachment() = default;
18 
GetType() const19 MessageAttachment::Type MojoHandleAttachment::GetType() const {
20   return Type::MOJO_HANDLE;
21 }
22 
TakeHandle()23 mojo::ScopedHandle MojoHandleAttachment::TakeHandle() {
24   return std::move(handle_);
25 }
26 
27 }  // namespace internal
28 }  // namespace IPC
29