summaryrefslogtreecommitdiffstats
path: root/remoting/host/chromoting_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 /remoting/host/chromoting_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 'remoting/host/chromoting_param_traits.h')
-rw-r--r--remoting/host/chromoting_param_traits.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/remoting/host/chromoting_param_traits.h b/remoting/host/chromoting_param_traits.h
index 9da88f8..b13bc82 100644
--- a/remoting/host/chromoting_param_traits.h
+++ b/remoting/host/chromoting_param_traits.h
@@ -17,40 +17,50 @@ namespace IPC {
template <>
struct ParamTraits<webrtc::DesktopVector> {
typedef webrtc::DesktopVector 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 ParamTraits<webrtc::DesktopSize> {
typedef webrtc::DesktopSize 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 ParamTraits<webrtc::DesktopRect> {
typedef webrtc::DesktopRect 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 ParamTraits<webrtc::MouseCursor> {
typedef webrtc::MouseCursor 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 ParamTraits<remoting::ScreenResolution> {
typedef remoting::ScreenResolution 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);
};