morrita | 1b52e4c | 2015-02-06 09:58:30 +0900 | [diff] [blame] | 1 | // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
amistry | 6555e69 | 2016-06-23 16:52:37 +0900 | [diff] [blame] | 5 | #include "ipc/ipc_mojo_handle_attachment.h" |
morrita | 1b52e4c | 2015-02-06 09:58:30 +0900 | [diff] [blame] | 6 | |
dcheng | 6c1ffcf | 2015-12-28 11:24:50 +0900 | [diff] [blame] | 7 | #include <utility> |
| 8 | |
avi | 42ebda4 | 2015-12-22 11:39:04 +0900 | [diff] [blame] | 9 | #include "build/build_config.h" |
morrita | 1b52e4c | 2015-02-06 09:58:30 +0900 | [diff] [blame] | 10 | |
| 11 | namespace IPC { |
| 12 | namespace internal { |
| 13 | |
| 14 | MojoHandleAttachment::MojoHandleAttachment(mojo::ScopedHandle handle) |
dcheng | 6c1ffcf | 2015-12-28 11:24:50 +0900 | [diff] [blame] | 15 | : handle_(std::move(handle)) {} |
morrita | 1b52e4c | 2015-02-06 09:58:30 +0900 | [diff] [blame] | 16 | |
| 17 | MojoHandleAttachment::~MojoHandleAttachment() { |
| 18 | } |
| 19 | |
| 20 | MessageAttachment::Type MojoHandleAttachment::GetType() const { |
sammc | 1458336 | 2016-11-23 12:17:35 +0900 | [diff] [blame] | 21 | return Type::MOJO_HANDLE; |
morrita | 1b52e4c | 2015-02-06 09:58:30 +0900 | [diff] [blame] | 22 | } |
| 23 | |
morrita | 1b52e4c | 2015-02-06 09:58:30 +0900 | [diff] [blame] | 24 | mojo::ScopedHandle MojoHandleAttachment::TakeHandle() { |
dcheng | 6c1ffcf | 2015-12-28 11:24:50 +0900 | [diff] [blame] | 25 | return std::move(handle_); |
morrita | 1b52e4c | 2015-02-06 09:58:30 +0900 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | } // namespace internal |
| 29 | } // namespace IPC |