#ifndef CONTENT_CHILD_PLUGIN_PARAM_TRAITS_H_
#define CONTENT_CHILD_PLUGIN_PARAM_TRAITS_H_
#include <string>
#include "content/child/npapi/npruntime_util.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_param_traits.h"
namespace content {
enum NPVariant_ParamEnum {
NPVARIANT_PARAM_VOID,
NPVARIANT_PARAM_NULL,
NPVARIANT_PARAM_BOOL,
NPVARIANT_PARAM_INT,
NPVARIANT_PARAM_DOUBLE,
NPVARIANT_PARAM_STRING,
NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID,
NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID,
};
struct NPVariant_Param {
NPVariant_Param();
~NPVariant_Param();
NPVariant_ParamEnum type;
bool bool_value;
int int_value;
double double_value;
std::string string_value;
int npobject_routing_id;
int npobject_owner_id;
};
struct NPIdentifier_Param {
NPIdentifier_Param();
~NPIdentifier_Param();
NPIdentifier identifier;
};
}
namespace IPC {
template <>
struct ParamTraits<content::NPVariant_Param> {
typedef content::NPVariant_Param param_type;
static void Write(Message* m, const param_type& p);
static bool Read(const Message* m, PickleIterator* iter, param_type* r);
static void Log(const param_type& p, std::string* l);
};
template <>
struct ParamTraits<content::NPIdentifier_Param> {
typedef content::NPIdentifier_Param param_type;
static void Write(Message* m, const param_type& p);
static bool Read(const Message* m, PickleIterator* iter, param_type* r);
static void Log(const param_type& p, std::string* l);
};
}
#endif