WebCoreArgumentCoders.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. /*
  2. * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions
  6. * are met:
  7. * 1. Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * 2. Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. *
  13. * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
  14. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  15. * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  16. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
  17. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  18. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  19. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  20. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  21. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  22. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  23. * THE POSSIBILITY OF SUCH DAMAGE.
  24. */
  25. #ifndef WebCoreArgumentCoders_h
  26. #define WebCoreArgumentCoders_h
  27. #include "ArgumentCoders.h"
  28. namespace WebCore {
  29. class AffineTransform;
  30. class AuthenticationChallenge;
  31. class Color;
  32. class Credential;
  33. class Cursor;
  34. class DatabaseDetails;
  35. class FloatPoint;
  36. class FloatRect;
  37. class FloatSize;
  38. class HTTPHeaderMap;
  39. class IntPoint;
  40. class IntRect;
  41. class IntSize;
  42. class KeyframeValueList;
  43. class KURL;
  44. class Notification;
  45. class ProtectionSpace;
  46. class ResourceError;
  47. class ResourceRequest;
  48. class ResourceResponse;
  49. class TextCheckingRequestData;
  50. class UserStyleSheet;
  51. class UserScript;
  52. struct CompositionUnderline;
  53. struct Cookie;
  54. struct DictationAlternative;
  55. struct DragSession;
  56. struct FileChooserSettings;
  57. struct GrammarDetail;
  58. struct MimeClassInfo;
  59. struct PluginInfo;
  60. struct TextCheckingResult;
  61. struct ViewportAttributes;
  62. struct WindowFeatures;
  63. }
  64. #if PLATFORM(MAC)
  65. namespace WebCore {
  66. struct KeypressCommand;
  67. }
  68. #endif
  69. #if PLATFORM(MANX)
  70. namespace WebCore {
  71. struct GLMemoryInfo;
  72. }
  73. #endif
  74. namespace CoreIPC {
  75. template<> struct ArgumentCoder<WebCore::AffineTransform> {
  76. static void encode(ArgumentEncoder&, const WebCore::AffineTransform&);
  77. static bool decode(ArgumentDecoder&, WebCore::AffineTransform&);
  78. };
  79. template<> struct ArgumentCoder<WebCore::FloatPoint> {
  80. static void encode(ArgumentEncoder&, const WebCore::FloatPoint&);
  81. static bool decode(ArgumentDecoder&, WebCore::FloatPoint&);
  82. };
  83. template<> struct ArgumentCoder<WebCore::FloatRect> {
  84. static void encode(ArgumentEncoder&, const WebCore::FloatRect&);
  85. static bool decode(ArgumentDecoder&, WebCore::FloatRect&);
  86. };
  87. template<> struct ArgumentCoder<WebCore::FloatSize> {
  88. static void encode(ArgumentEncoder&, const WebCore::FloatSize&);
  89. static bool decode(ArgumentDecoder&, WebCore::FloatSize&);
  90. };
  91. template<> struct ArgumentCoder<WebCore::IntPoint> {
  92. static void encode(ArgumentEncoder&, const WebCore::IntPoint&);
  93. static bool decode(ArgumentDecoder&, WebCore::IntPoint&);
  94. };
  95. template<> struct ArgumentCoder<WebCore::IntRect> {
  96. static void encode(ArgumentEncoder&, const WebCore::IntRect&);
  97. static bool decode(ArgumentDecoder&, WebCore::IntRect&);
  98. };
  99. template<> struct ArgumentCoder<WebCore::IntSize> {
  100. static void encode(ArgumentEncoder&, const WebCore::IntSize&);
  101. static bool decode(ArgumentDecoder&, WebCore::IntSize&);
  102. };
  103. template<> struct ArgumentCoder<WebCore::ViewportAttributes> {
  104. static void encode(ArgumentEncoder&, const WebCore::ViewportAttributes&);
  105. static bool decode(ArgumentDecoder&, WebCore::ViewportAttributes&);
  106. };
  107. template<> struct ArgumentCoder<WebCore::MimeClassInfo> {
  108. static void encode(ArgumentEncoder&, const WebCore::MimeClassInfo&);
  109. static bool decode(ArgumentDecoder&, WebCore::MimeClassInfo&);
  110. };
  111. template<> struct ArgumentCoder<WebCore::PluginInfo> {
  112. static void encode(ArgumentEncoder&, const WebCore::PluginInfo&);
  113. static bool decode(ArgumentDecoder&, WebCore::PluginInfo&);
  114. };
  115. template<> struct ArgumentCoder<WebCore::HTTPHeaderMap> {
  116. static void encode(ArgumentEncoder&, const WebCore::HTTPHeaderMap&);
  117. static bool decode(ArgumentDecoder&, WebCore::HTTPHeaderMap&);
  118. };
  119. template<> struct ArgumentCoder<WebCore::AuthenticationChallenge> {
  120. static void encode(ArgumentEncoder&, const WebCore::AuthenticationChallenge&);
  121. static bool decode(ArgumentDecoder&, WebCore::AuthenticationChallenge&);
  122. };
  123. template<> struct ArgumentCoder<WebCore::ProtectionSpace> {
  124. static void encode(ArgumentEncoder&, const WebCore::ProtectionSpace&);
  125. static bool decode(ArgumentDecoder&, WebCore::ProtectionSpace&);
  126. };
  127. template<> struct ArgumentCoder<WebCore::Credential> {
  128. static void encode(ArgumentEncoder&, const WebCore::Credential&);
  129. static bool decode(ArgumentDecoder&, WebCore::Credential&);
  130. };
  131. template<> struct ArgumentCoder<WebCore::Cursor> {
  132. static void encode(ArgumentEncoder&, const WebCore::Cursor&);
  133. static bool decode(ArgumentDecoder&, WebCore::Cursor&);
  134. };
  135. template<> struct ArgumentCoder<WebCore::ResourceRequest> {
  136. #if PLATFORM(MAC)
  137. static const bool kShouldSerializeWebCoreData = false;
  138. #else
  139. static const bool kShouldSerializeWebCoreData = true;
  140. #endif
  141. static void encode(ArgumentEncoder&, const WebCore::ResourceRequest&);
  142. static bool decode(ArgumentDecoder&, WebCore::ResourceRequest&);
  143. static void encodePlatformData(ArgumentEncoder&, const WebCore::ResourceRequest&);
  144. static bool decodePlatformData(ArgumentDecoder&, WebCore::ResourceRequest&);
  145. };
  146. template<> struct ArgumentCoder<WebCore::ResourceResponse> {
  147. static void encode(ArgumentEncoder&, const WebCore::ResourceResponse&);
  148. static bool decode(ArgumentDecoder&, WebCore::ResourceResponse&);
  149. static void encodePlatformData(ArgumentEncoder&, const WebCore::ResourceResponse&);
  150. static bool decodePlatformData(ArgumentDecoder&, WebCore::ResourceResponse&);
  151. };
  152. template<> struct ArgumentCoder<WebCore::ResourceError> {
  153. #if PLATFORM(MAC)
  154. static const bool kShouldSerializeWebCoreData = false;
  155. #else
  156. static const bool kShouldSerializeWebCoreData = true;
  157. #endif
  158. static void encode(ArgumentEncoder&, const WebCore::ResourceError&);
  159. static bool decode(ArgumentDecoder&, WebCore::ResourceError&);
  160. static void encodePlatformData(ArgumentEncoder&, const WebCore::ResourceError&);
  161. static bool decodePlatformData(ArgumentDecoder&, WebCore::ResourceError&);
  162. };
  163. template<> struct ArgumentCoder<WebCore::WindowFeatures> {
  164. static void encode(ArgumentEncoder&, const WebCore::WindowFeatures&);
  165. static bool decode(ArgumentDecoder&, WebCore::WindowFeatures&);
  166. };
  167. template<> struct ArgumentCoder<WebCore::Color> {
  168. static void encode(ArgumentEncoder&, const WebCore::Color&);
  169. static bool decode(ArgumentDecoder&, WebCore::Color&);
  170. };
  171. #if PLATFORM(MAC)
  172. template<> struct ArgumentCoder<WebCore::KeypressCommand> {
  173. static void encode(ArgumentEncoder&, const WebCore::KeypressCommand&);
  174. static bool decode(ArgumentDecoder&, WebCore::KeypressCommand&);
  175. };
  176. #endif
  177. template<> struct ArgumentCoder<WebCore::CompositionUnderline> {
  178. static void encode(ArgumentEncoder&, const WebCore::CompositionUnderline&);
  179. static bool decode(ArgumentDecoder&, WebCore::CompositionUnderline&);
  180. };
  181. template<> struct ArgumentCoder<WebCore::Cookie> {
  182. static void encode(ArgumentEncoder&, const WebCore::Cookie&);
  183. static bool decode(ArgumentDecoder&, WebCore::Cookie&);
  184. };
  185. template<> struct ArgumentCoder<WebCore::DatabaseDetails> {
  186. static void encode(ArgumentEncoder&, const WebCore::DatabaseDetails&);
  187. static bool decode(ArgumentDecoder&, WebCore::DatabaseDetails&);
  188. };
  189. template<> struct ArgumentCoder<WebCore::DictationAlternative> {
  190. static void encode(ArgumentEncoder&, const WebCore::DictationAlternative&);
  191. static bool decode(ArgumentDecoder&, WebCore::DictationAlternative&);
  192. };
  193. template<> struct ArgumentCoder<WebCore::FileChooserSettings> {
  194. static void encode(ArgumentEncoder&, const WebCore::FileChooserSettings&);
  195. static bool decode(ArgumentDecoder&, WebCore::FileChooserSettings&);
  196. };
  197. template<> struct ArgumentCoder<WebCore::GrammarDetail> {
  198. static void encode(ArgumentEncoder&, const WebCore::GrammarDetail&);
  199. static bool decode(ArgumentDecoder&, WebCore::GrammarDetail&);
  200. };
  201. template<> struct ArgumentCoder<WebCore::TextCheckingRequestData> {
  202. static void encode(ArgumentEncoder&, const WebCore::TextCheckingRequestData&);
  203. static bool decode(ArgumentDecoder&, WebCore::TextCheckingRequestData&);
  204. };
  205. template<> struct ArgumentCoder<WebCore::TextCheckingResult> {
  206. static void encode(ArgumentEncoder&, const WebCore::TextCheckingResult&);
  207. static bool decode(ArgumentDecoder&, WebCore::TextCheckingResult&);
  208. };
  209. template<> struct ArgumentCoder<WebCore::DragSession> {
  210. static void encode(ArgumentEncoder&, const WebCore::DragSession&);
  211. static bool decode(ArgumentDecoder&, WebCore::DragSession&);
  212. };
  213. template<> struct ArgumentCoder<WebCore::KURL> {
  214. static void encode(ArgumentEncoder&, const WebCore::KURL&);
  215. static bool decode(ArgumentDecoder&, WebCore::KURL&);
  216. };
  217. template<> struct ArgumentCoder<WebCore::UserStyleSheet> {
  218. static void encode(ArgumentEncoder&, const WebCore::UserStyleSheet&);
  219. static bool decode(ArgumentDecoder&, WebCore::UserStyleSheet&);
  220. };
  221. template<> struct ArgumentCoder<WebCore::UserScript> {
  222. static void encode(ArgumentEncoder&, const WebCore::UserScript&);
  223. static bool decode(ArgumentDecoder&, WebCore::UserScript&);
  224. };
  225. #if PLATFORM(MANX)
  226. template<> struct ArgumentCoder<WebCore::GLMemoryInfo> {
  227. static void encode(ArgumentEncoder&, const WebCore::GLMemoryInfo&);
  228. static bool decode(ArgumentDecoder&, WebCore::GLMemoryInfo&);
  229. };
  230. #endif
  231. } // namespace CoreIPC
  232. #endif // WebCoreArgumentCoders_h