ipc_mojo_message_helper.h 938 B

1234567891011121314151617181920212223242526272829
  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. #ifndef IPC_IPC_MOJO_MESSAGE_HELPER_H_
  5. #define IPC_IPC_MOJO_MESSAGE_HELPER_H_
  6. #include "ipc/ipc_message.h"
  7. #include "ipc/ipc_message_support_export.h"
  8. #include "mojo/public/cpp/system/message_pipe.h"
  9. namespace IPC {
  10. // Reads and writes |mojo::MessagePipe| from/to |Message|.
  11. class IPC_MESSAGE_SUPPORT_EXPORT MojoMessageHelper {
  12. public:
  13. static bool WriteMessagePipeTo(base::Pickle* message,
  14. mojo::ScopedMessagePipeHandle handle);
  15. static bool ReadMessagePipeFrom(const base::Pickle* message,
  16. base::PickleIterator* iter,
  17. mojo::ScopedMessagePipeHandle* handle);
  18. private:
  19. MojoMessageHelper();
  20. };
  21. } // namespace IPC
  22. #endif // IPC_IPC_MOJO_MESSAGE_HELPER_H_