summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppapi_param_traits.h
diff options
context:
space:
mode:
authorrockot <rockot@chromium.org>2016-02-03 12:20:16 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-03 20:21:49 +0000
commit502c94ff1a9f99b5c4ecfe700415cc4ed14228dd (patch)
tree260521d2640e580c11a54d24781ef0ebc32baee3 /ppapi/proxy/ppapi_param_traits.h
parent26c9117edc07280155c69c7fab04729af46a79eb (diff)
downloadchromium_src-502c94ff1a9f99b5c4ecfe700415cc4ed14228dd.zip
chromium_src-502c94ff1a9f99b5c4ecfe700415cc4ed14228dd.tar.gz
chromium_src-502c94ff1a9f99b5c4ecfe700415cc4ed14228dd.tar.bz2
IPC::Message -> base::Pickle
This changes consumers of IPC::Message to generally refer refer to base::Pickle instead when performing serialization and deserialization operations. The few specific instances where the IPC::Message interface (Read/WriteAttachent) is needed can safely be static_cast'd, as IPC::Message is the only public subclass of base::Pickle. The purpose of this change is to facilitate the transition to Mojo IPC, as we've trained the Mojo bindings layer to use existing ParamTraits<T> parameterized over base::Pickle. To support this base::Pickle has had some stub interfaces added for WriteAttachment and ReadAttachment, along with a Pickle::Attachment. A follow-up patch will add sizing traits to the standard IPC_STRUCT macros, enabling the majority of Chrome IPC structs to be carried over Mojo message pipes as-is. BUG=577685 R=jam@chromium.org Review URL: https://codereview.chromium.org/1659003003 Cr-Commit-Position: refs/heads/master@{#373323}
Diffstat (limited to 'ppapi/proxy/ppapi_param_traits.h')
-rw-r--r--ppapi/proxy/ppapi_param_traits.h108
1 files changed, 72 insertions, 36 deletions
diff --git a/ppapi/proxy/ppapi_param_traits.h b/ppapi/proxy/ppapi_param_traits.h
index e3638b8..6996547 100644
--- a/ppapi/proxy/ppapi_param_traits.h
+++ b/ppapi/proxy/ppapi_param_traits.h
@@ -49,24 +49,30 @@ namespace IPC {
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> {
typedef PP_Bool param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template <>
struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> {
typedef PP_NetAddress_Private param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* p);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* p);
static void Log(const param_type& p, std::string* l);
};
template <>
struct PPAPI_PROXY_EXPORT ParamTraits<PP_KeyInformation> {
typedef PP_KeyInformation param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* p);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* p);
static void Log(const param_type& p, std::string* l);
};
@@ -74,8 +80,10 @@ template<>
struct PPAPI_PROXY_EXPORT ParamTraits<
ppapi::proxy::PPBFlash_DrawGlyphs_Params> {
typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
@@ -83,24 +91,30 @@ template<>
struct PPAPI_PROXY_EXPORT ParamTraits<
ppapi::proxy::PPBURLLoader_UpdateProgress_Params> {
typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedDirEntry> {
typedef ppapi::proxy::SerializedDirEntry param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFontDescription> {
typedef ppapi::proxy::SerializedFontDescription param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
@@ -108,32 +122,40 @@ template<>
struct PPAPI_PROXY_EXPORT
ParamTraits<ppapi::proxy::SerializedTrueTypeFontDesc> {
typedef ppapi::proxy::SerializedTrueTypeFontDesc param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedHandle> {
typedef ppapi::proxy::SerializedHandle param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> {
typedef ppapi::HostResource param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedVar> {
typedef ppapi::proxy::SerializedVar param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
@@ -141,16 +163,20 @@ template<>
struct PPAPI_PROXY_EXPORT ParamTraits<
std::vector<ppapi::proxy::SerializedVar> > {
typedef std::vector<ppapi::proxy::SerializedVar> param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> {
typedef ppapi::PpapiPermissions param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
@@ -158,16 +184,20 @@ struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> {
template <>
struct ParamTraits<ppapi::PepperFilePath> {
typedef ppapi::PepperFilePath param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* p);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* p);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> {
typedef ppapi::proxy::SerializedFlashMenu param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
#endif // !defined(OS_NACL) && !defined(NACL_WIN64)
@@ -175,24 +205,30 @@ struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> {
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_X509Certificate_Fields> {
typedef ppapi::PPB_X509Certificate_Fields param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> {
typedef ppapi::SocketOptionData param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};
template<>
struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::CompositorLayerData::Transform> {
typedef ppapi::CompositorLayerData::Transform param_type;
- static void Write(Message* m, const param_type& p);
- static bool Read(const Message* m, base::PickleIterator* iter, param_type* r);
+ static void Write(base::Pickle* m, const param_type& p);
+ static bool Read(const base::Pickle* m,
+ base::PickleIterator* iter,
+ param_type* r);
static void Log(const param_type& p, std::string* l);
};