Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Side by Side Diff: content/public/common/webkit_param_traits.h

Issue 10948044: Pickling traits for more simple WebKit types. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove static_cast and initialize ptr to NULL Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/view_messages.h ('k') | content/public/common/webkit_param_traits.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
22 #include "third_party/WebKit/Source/Platform/chromium/public/WebTransformationMa trix.h"
21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 23 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
22 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h" 24 #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
23 #include "webkit/blob/blob_data.h" 25 #include "webkit/blob/blob_data.h"
24 #include "webkit/glue/npruntime_util.h" 26 #include "webkit/glue/npruntime_util.h"
25 #include "webkit/glue/resource_type.h" 27 #include "webkit/glue/resource_type.h"
26 #include "webkit/glue/webcursor.h" 28 #include "webkit/glue/webcursor.h"
27 #include "webkit/glue/window_open_disposition.h" 29 #include "webkit/glue/window_open_disposition.h"
28 #include "webkit/plugins/webplugininfo.h" 30 #include "webkit/plugins/webplugininfo.h"
29 31
30 namespace webkit { 32 namespace webkit {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 struct NPIdentifier_Param { 73 struct NPIdentifier_Param {
72 NPIdentifier_Param(); 74 NPIdentifier_Param();
73 ~NPIdentifier_Param(); 75 ~NPIdentifier_Param();
74 76
75 NPIdentifier identifier; 77 NPIdentifier identifier;
76 }; 78 };
77 79
78 namespace IPC { 80 namespace IPC {
79 81
80 template <> 82 template <>
83 struct ParamTraits<WebKit::WebData> {
84 typedef WebKit::WebData param_type;
85 static void Write(Message* m, const param_type& p);
86 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
87 static void Log(const param_type& p, std::string* l);
88 };
89
90 template <>
91 struct ParamTraits<WebKit::WebTransformationMatrix> {
92 typedef WebKit::WebTransformationMatrix param_type;
93 static void Write(Message* m, const param_type& p);
94 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
95 static void Log(const param_type& p, std::string* l);
96 };
97
98 template <>
81 struct ParamTraits<webkit_glue::ResourceLoadTimingInfo> { 99 struct ParamTraits<webkit_glue::ResourceLoadTimingInfo> {
82 typedef webkit_glue::ResourceLoadTimingInfo param_type; 100 typedef webkit_glue::ResourceLoadTimingInfo param_type;
83 static void Write(Message* m, const param_type& p); 101 static void Write(Message* m, const param_type& p);
84 static bool Read(const Message* m, PickleIterator* iter, param_type* r); 102 static bool Read(const Message* m, PickleIterator* iter, param_type* r);
85 static void Log(const param_type& p, std::string* l); 103 static void Log(const param_type& p, std::string* l);
86 }; 104 };
87 105
88 template <> 106 template <>
89 struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > { 107 struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > {
90 typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type; 108 typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type;
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 struct CONTENT_EXPORT ParamTraits<webkit::forms::PasswordForm> { 262 struct CONTENT_EXPORT ParamTraits<webkit::forms::PasswordForm> {
245 typedef webkit::forms::PasswordForm param_type; 263 typedef webkit::forms::PasswordForm param_type;
246 static void Write(Message* m, const param_type& p); 264 static void Write(Message* m, const param_type& p);
247 static bool Read(const Message* m, PickleIterator* iter, param_type* p); 265 static bool Read(const Message* m, PickleIterator* iter, param_type* p);
248 static void Log(const param_type& p, std::string* l); 266 static void Log(const param_type& p, std::string* l);
249 }; 267 };
250 268
251 } // namespace IPC 269 } // namespace IPC
252 270
253 #endif // CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_ 271 #endif // CONTENT_PUBLIC_COMMON_WEBKIT_PARAM_TRAITS_H_
OLDNEW
« no previous file with comments | « content/common/view_messages.h ('k') | content/public/common/webkit_param_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698