blob: 4a71b5c96cd4c53332a5be17586c305e02f362d5 [file] [log] [blame]
morrita1b52e4c2015-02-06 09:58:30 +09001// 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
amistry6555e692016-06-23 16:52:37 +09005#ifndef IPC_IPC_MOJO_MESSAGE_HELPER_H_
6#define IPC_IPC_MOJO_MESSAGE_HELPER_H_
morrita1b52e4c2015-02-06 09:58:30 +09007
8#include "ipc/ipc_export.h"
9#include "ipc/ipc_message.h"
rockotaf32acb2015-11-13 10:33:59 +090010#include "mojo/public/cpp/system/message_pipe.h"
morrita1b52e4c2015-02-06 09:58:30 +090011
12namespace IPC {
13
14// Reads and writes |mojo::MessagePipe| from/to |Message|.
amistry6555e692016-06-23 16:52:37 +090015class IPC_EXPORT MojoMessageHelper {
morrita1b52e4c2015-02-06 09:58:30 +090016 public:
rockot6dbfea52016-02-04 05:20:16 +090017 static bool WriteMessagePipeTo(base::Pickle* message,
morrita1b52e4c2015-02-06 09:58:30 +090018 mojo::ScopedMessagePipeHandle handle);
rockot6dbfea52016-02-04 05:20:16 +090019 static bool ReadMessagePipeFrom(const base::Pickle* message,
brettwa4879472015-06-02 16:02:47 +090020 base::PickleIterator* iter,
morrita1b52e4c2015-02-06 09:58:30 +090021 mojo::ScopedMessagePipeHandle* handle);
22
23 private:
24 MojoMessageHelper();
25};
26
27} // namespace IPC
28
amistry6555e692016-06-23 16:52:37 +090029#endif // IPC_IPC_MOJO_MESSAGE_HELPER_H_