blob: 5907befd008f56139b110ce27b24408ca7a7ce57 [file] [log] [blame]
morrita438a2ee2015-04-03 05:28:211// Copyright 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
amistryd4aa70d2016-06-23 07:52:375#ifndef IPC_IPC_MOJO_PARAM_TRAITS_H_
6#define IPC_IPC_MOJO_PARAM_TRAITS_H_
morrita438a2ee2015-04-03 05:28:217
8#include <string>
9
Ken Rockot3044d212018-01-23 02:44:3910#include "base/component_export.h"
morrita438a2ee2015-04-03 05:28:2111#include "ipc/ipc_param_traits.h"
scottmgefb697302017-04-12 22:37:3012#include "mojo/public/cpp/system/data_pipe.h"
rockot85dce0862015-11-13 01:33:5913#include "mojo/public/cpp/system/message_pipe.h"
morrita438a2ee2015-04-03 05:28:2114
brettw05cfd8ddb2015-06-02 07:02:4715namespace base {
amistry36182522016-06-27 06:34:4216class Pickle;
morrita438a2ee2015-04-03 05:28:2117class PickleIterator;
brettw05cfd8ddb2015-06-02 07:02:4718}
morrita438a2ee2015-04-03 05:28:2119
20namespace IPC {
21
morrita438a2ee2015-04-03 05:28:2122template <>
Ken Rockot3044d212018-01-23 02:44:3923struct COMPONENT_EXPORT(IPC) ParamTraits<mojo::MessagePipeHandle> {
morrita438a2ee2015-04-03 05:28:2124 typedef mojo::MessagePipeHandle param_type;
amistry36182522016-06-27 06:34:4225 static void Write(base::Pickle* m, const param_type& p);
26 static bool Read(const base::Pickle* m, base::PickleIterator* iter,
27 param_type* r);
morrita438a2ee2015-04-03 05:28:2128 static void Log(const param_type& p, std::string* l);
29};
30
scottmgefb697302017-04-12 22:37:3031template <>
Ken Rockot3044d212018-01-23 02:44:3932struct COMPONENT_EXPORT(IPC) ParamTraits<mojo::DataPipeConsumerHandle> {
scottmgefb697302017-04-12 22:37:3033 typedef mojo::DataPipeConsumerHandle param_type;
scottmgefb697302017-04-12 22:37:3034 static void Write(base::Pickle* m, const param_type& p);
35 static bool Read(const base::Pickle* m,
36 base::PickleIterator* iter,
37 param_type* r);
38 static void Log(const param_type& p, std::string* l);
39};
40
morrita438a2ee2015-04-03 05:28:2141} // namespace IPC
42
amistryd4aa70d2016-06-23 07:52:3743#endif // IPC_IPC_MOJO_PARAM_TRAITS_H_