| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ | 5 #ifndef REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ |
| 6 #define REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ | 6 #define REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ |
| 7 | 7 |
| 8 #include "ipc/ipc_message.h" | 8 #include "ipc/ipc_message.h" |
| 9 #include "ipc/ipc_param_traits.h" | 9 #include "ipc/ipc_param_traits.h" |
| 10 #include "net/base/ip_address.h" | 10 #include "net/base/ip_address.h" |
| 11 #include "net/base/ip_endpoint.h" | 11 #include "net/base/ip_endpoint.h" |
| 12 #include "remoting/host/screen_resolution.h" | 12 #include "remoting/host/screen_resolution.h" |
| 13 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" | 13 #include "third_party/webrtc/modules/desktop_capture/desktop_frame.h" |
| 14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 14 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 15 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h" | 15 #include "third_party/webrtc/modules/desktop_capture/mouse_cursor.h" |
| 16 | 16 |
| 17 namespace IPC { | 17 namespace IPC { |
| 18 | 18 |
| 19 template <> | 19 template <> |
| 20 struct ParamTraits<webrtc::DesktopVector> { | 20 struct ParamTraits<webrtc::DesktopVector> { |
| 21 typedef webrtc::DesktopVector param_type; | 21 typedef webrtc::DesktopVector param_type; |
| 22 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 22 static void Write(base::Pickle* m, const param_type& p); | 23 static void Write(base::Pickle* m, const param_type& p); |
| 23 static bool Read(const base::Pickle* m, | 24 static bool Read(const base::Pickle* m, |
| 24 base::PickleIterator* iter, | 25 base::PickleIterator* iter, |
| 25 param_type* r); | 26 param_type* r); |
| 26 static void Log(const param_type& p, std::string* l); | 27 static void Log(const param_type& p, std::string* l); |
| 27 }; | 28 }; |
| 28 | 29 |
| 29 template <> | 30 template <> |
| 30 struct ParamTraits<webrtc::DesktopSize> { | 31 struct ParamTraits<webrtc::DesktopSize> { |
| 31 typedef webrtc::DesktopSize param_type; | 32 typedef webrtc::DesktopSize param_type; |
| 33 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 32 static void Write(base::Pickle* m, const param_type& p); | 34 static void Write(base::Pickle* m, const param_type& p); |
| 33 static bool Read(const base::Pickle* m, | 35 static bool Read(const base::Pickle* m, |
| 34 base::PickleIterator* iter, | 36 base::PickleIterator* iter, |
| 35 param_type* r); | 37 param_type* r); |
| 36 static void Log(const param_type& p, std::string* l); | 38 static void Log(const param_type& p, std::string* l); |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 template <> | 41 template <> |
| 40 struct ParamTraits<webrtc::DesktopRect> { | 42 struct ParamTraits<webrtc::DesktopRect> { |
| 41 typedef webrtc::DesktopRect param_type; | 43 typedef webrtc::DesktopRect param_type; |
| 44 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 42 static void Write(base::Pickle* m, const param_type& p); | 45 static void Write(base::Pickle* m, const param_type& p); |
| 43 static bool Read(const base::Pickle* m, | 46 static bool Read(const base::Pickle* m, |
| 44 base::PickleIterator* iter, | 47 base::PickleIterator* iter, |
| 45 param_type* r); | 48 param_type* r); |
| 46 static void Log(const param_type& p, std::string* l); | 49 static void Log(const param_type& p, std::string* l); |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 template <> | 52 template <> |
| 50 struct ParamTraits<webrtc::MouseCursor> { | 53 struct ParamTraits<webrtc::MouseCursor> { |
| 51 typedef webrtc::MouseCursor param_type; | 54 typedef webrtc::MouseCursor param_type; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 static void Write(base::Pickle* m, const param_type& p); | 65 static void Write(base::Pickle* m, const param_type& p); |
| 63 static bool Read(const base::Pickle* m, | 66 static bool Read(const base::Pickle* m, |
| 64 base::PickleIterator* iter, | 67 base::PickleIterator* iter, |
| 65 param_type* r); | 68 param_type* r); |
| 66 static void Log(const param_type& p, std::string* l); | 69 static void Log(const param_type& p, std::string* l); |
| 67 }; | 70 }; |
| 68 | 71 |
| 69 template <> | 72 template <> |
| 70 struct ParamTraits<net::IPAddress> { | 73 struct ParamTraits<net::IPAddress> { |
| 71 typedef net::IPAddress param_type; | 74 typedef net::IPAddress param_type; |
| 75 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 72 static void Write(base::Pickle* m, const param_type& p); | 76 static void Write(base::Pickle* m, const param_type& p); |
| 73 static bool Read(const base::Pickle* m, | 77 static bool Read(const base::Pickle* m, |
| 74 base::PickleIterator* iter, | 78 base::PickleIterator* iter, |
| 75 param_type* p); | 79 param_type* p); |
| 76 static void Log(const param_type& p, std::string* l); | 80 static void Log(const param_type& p, std::string* l); |
| 77 }; | 81 }; |
| 78 | 82 |
| 79 template <> | 83 template <> |
| 80 struct ParamTraits<net::IPEndPoint> { | 84 struct ParamTraits<net::IPEndPoint> { |
| 81 typedef net::IPEndPoint param_type; | 85 typedef net::IPEndPoint param_type; |
| 86 static void GetSize(base::PickleSizer* s, const param_type& p); |
| 82 static void Write(base::Pickle* m, const param_type& p); | 87 static void Write(base::Pickle* m, const param_type& p); |
| 83 static bool Read(const base::Pickle* m, | 88 static bool Read(const base::Pickle* m, |
| 84 base::PickleIterator* iter, | 89 base::PickleIterator* iter, |
| 85 param_type* p); | 90 param_type* p); |
| 86 static void Log(const param_type& p, std::string* l); | 91 static void Log(const param_type& p, std::string* l); |
| 87 }; | 92 }; |
| 88 | 93 |
| 89 } // namespace IPC | 94 } // namespace IPC |
| 90 | 95 |
| 91 #endif // REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ | 96 #endif // REMOTING_HOST_CHROMOTING_PARAM_TRAITS_H_ |
| OLD | NEW |