| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file is used to define IPC::ParamTraits<> specializations for a number | 5 // This file is used to define IPC::ParamTraits<> specializations for a number |
| 6 // of WebKit types so that they can be serialized over IPC. IPC::ParamTraits<> | 6 // of WebKit types so that they can be serialized over IPC. IPC::ParamTraits<> |
| 7 // specializations for basic types (like int and std::string) and types in the | 7 // specializations for basic types (like int and std::string) and types in the |
| 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains | 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains |
| 9 // specializations for types that are used by the content code, and which need | 9 // specializations for types that are used by the content code, and which need |
| 10 // manual serialization code. This is usually because they're not structs with | 10 // manual serialization code. This is usually because they're not structs with |
| 11 // public members. | 11 // public members. |
| 12 | 12 |
| 13 #ifndef CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ | 13 #ifndef CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ |
| 14 #define CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ | 14 #define CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ |
| 15 | 15 |
| 16 #include <string> | 16 #include <string> |
| 17 | 17 |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 20 #include "ipc/ipc_message_utils.h" | 20 #include "ipc/ipc_message_utils.h" |
| 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" | 21 #include "third_party/WebKit/Source/Platform/chromium/public/WebData.h" |
| 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" |
| 22 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa
trix.h" | 23 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa
trix.h" |
| 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" |
| 25 #include "webkit/blob/blob_data.h" | 26 #include "webkit/blob/blob_data.h" |
| 26 #include "webkit/glue/npruntime_util.h" | 27 #include "webkit/glue/npruntime_util.h" |
| 27 #include "webkit/glue/resource_type.h" | 28 #include "webkit/glue/resource_type.h" |
| 28 #include "webkit/glue/webcursor.h" | 29 #include "webkit/glue/webcursor.h" |
| 29 #include "webkit/glue/window_open_disposition.h" | 30 #include "webkit/glue/window_open_disposition.h" |
| 30 #include "webkit/plugins/webplugininfo.h" | 31 #include "webkit/plugins/webplugininfo.h" |
| 31 | 32 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 90 |
| 90 template <> | 91 template <> |
| 91 struct ParamTraits<WebKit::WebTransformationMatrix> { | 92 struct ParamTraits<WebKit::WebTransformationMatrix> { |
| 92 typedef WebKit::WebTransformationMatrix param_type; | 93 typedef WebKit::WebTransformationMatrix param_type; |
| 93 static void Write(Message* m, const param_type& p); | 94 static void Write(Message* m, const param_type& p); |
| 94 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 95 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 95 static void Log(const param_type& p, std::string* l); | 96 static void Log(const param_type& p, std::string* l); |
| 96 }; | 97 }; |
| 97 | 98 |
| 98 template <> | 99 template <> |
| 100 struct ParamTraits<WebKit::WebPoint> { |
| 101 typedef WebKit::WebPoint param_type; |
| 102 static void Write(Message* m, const param_type& p); |
| 103 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 104 static void Log(const param_type& p, std::string* l); |
| 105 }; |
| 106 |
| 107 template <> |
| 108 struct ParamTraits<WebKit::WebRect> { |
| 109 typedef WebKit::WebRect param_type; |
| 110 static void Write(Message* m, const param_type& p); |
| 111 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 112 static void Log(const param_type& p, std::string* l); |
| 113 }; |
| 114 |
| 115 template <> |
| 116 struct ParamTraits<WebKit::WebFilterOperations> { |
| 117 typedef WebKit::WebFilterOperations param_type; |
| 118 static void Write(Message* m, const param_type& p); |
| 119 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 120 static void Log(const param_type& p, std::string* l); |
| 121 }; |
| 122 |
| 123 template <> |
| 124 struct ParamTraits<WebKit::WebFilterOperation> { |
| 125 typedef WebKit::WebFilterOperation param_type; |
| 126 static void Write(Message* m, const param_type& p); |
| 127 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 128 static void Log(const param_type& p, std::string* l); |
| 129 }; |
| 130 |
| 131 template <> |
| 99 struct ParamTraits<webkit_glue::ResourceLoadTimingInfo> { | 132 struct ParamTraits<webkit_glue::ResourceLoadTimingInfo> { |
| 100 typedef webkit_glue::ResourceLoadTimingInfo param_type; | 133 typedef webkit_glue::ResourceLoadTimingInfo param_type; |
| 101 static void Write(Message* m, const param_type& p); | 134 static void Write(Message* m, const param_type& p); |
| 102 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 135 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 103 static void Log(const param_type& p, std::string* l); | 136 static void Log(const param_type& p, std::string* l); |
| 104 }; | 137 }; |
| 105 | 138 |
| 106 template <> | 139 template <> |
| 107 struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > { | 140 struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > { |
| 108 typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type; | 141 typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 struct CONTENT_EXPORT ParamTraits<webkit::forms::PasswordForm> { | 295 struct CONTENT_EXPORT ParamTraits<webkit::forms::PasswordForm> { |
| 263 typedef webkit::forms::PasswordForm param_type; | 296 typedef webkit::forms::PasswordForm param_type; |
| 264 static void Write(Message* m, const param_type& p); | 297 static void Write(Message* m, const param_type& p); |
| 265 static bool Read(const Message* m, PickleIterator* iter, param_type* p); | 298 static bool Read(const Message* m, PickleIterator* iter, param_type* p); |
| 266 static void Log(const param_type& p, std::string* l); | 299 static void Log(const param_type& p, std::string* l); |
| 267 }; | 300 }; |
| 268 | 301 |
| 269 } // namespace IPC | 302 } // namespace IPC |
| 270 | 303 |
| 271 #endif // CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ | 304 #endif // CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ |
| OLD | NEW |