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

Side by Side Diff: chrome/common/render_messages.h

Issue 3170020: Completely revert all my IPC work to see if this was what regressed the page cycler. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Rebase Created 10 years, 4 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
« no previous file with comments | « chrome/common/plugin_messages.cc ('k') | chrome/common/render_messages.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_COMMON_RENDER_MESSAGES_H_ 5 #ifndef CHROME_COMMON_RENDER_MESSAGES_H_
6 #define CHROME_COMMON_RENDER_MESSAGES_H_ 6 #define CHROME_COMMON_RENDER_MESSAGES_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 // TODO(erg): This list has been temporarily annotated by erg while doing work
13 // on which headers to pull out.
14 #include "app/clipboard/clipboard.h" 12 #include "app/clipboard/clipboard.h"
15 #include "app/surface/transport_dib.h" 13 #include "app/surface/transport_dib.h"
16 #include "base/basictypes.h" 14 #include "base/basictypes.h"
17 #include "base/platform_file.h" 15 #include "base/platform_file.h"
18 #include "base/ref_counted.h" 16 #include "base/ref_counted.h"
19 #include "base/shared_memory.h" 17 #include "base/shared_memory.h"
20 #include "base/string16.h" 18 #include "base/string16.h"
21 #include "chrome/common/common_param_traits.h" 19 #include "chrome/common/common_param_traits.h"
22 #include "chrome/common/css_colors.h" 20 #include "chrome/common/css_colors.h"
23 #include "chrome/common/dom_storage_common.h" 21 #include "chrome/common/dom_storage_common.h"
24 #include "chrome/common/extensions/extension_extent.h" // used in struct 22 #include "chrome/common/edit_command.h"
23 #include "chrome/common/extensions/extension_extent.h"
24 #include "chrome/common/extensions/url_pattern.h"
25 #include "chrome/common/font_descriptor_mac.h" 25 #include "chrome/common/font_descriptor_mac.h"
26 #include "chrome/common/indexed_db_key.h" // used in struct 26 #include "chrome/common/indexed_db_key.h"
27 #include "chrome/common/navigation_gesture.h" 27 #include "chrome/common/navigation_gesture.h"
28 #include "chrome/common/page_transition_types.h" 28 #include "chrome/common/page_transition_types.h"
29 #include "chrome/common/renderer_preferences.h" // used in struct 29 #include "chrome/common/renderer_preferences.h"
30 #include "chrome/common/resource_response.h" 30 #include "chrome/common/resource_response.h"
31 #include "chrome/common/translate_errors.h" 31 #include "chrome/common/translate_errors.h"
32 #include "chrome/common/view_types.h" 32 #include "chrome/common/view_types.h"
33 #include "chrome/common/serialized_script_value.h"
33 #include "chrome/common/webkit_param_traits.h" 34 #include "chrome/common/webkit_param_traits.h"
34 #include "chrome/common/window_container_type.h" 35 #include "chrome/common/window_container_type.h"
35 #include "gfx/native_widget_types.h" 36 #include "gfx/native_widget_types.h"
36 #include "gfx/rect.h"
37 #include "googleurl/src/gurl.h" 37 #include "googleurl/src/gurl.h"
38 #include "ipc/ipc_message_utils.h" 38 #include "ipc/ipc_message_utils.h"
39 #include "ipc/ipc_platform_file.h" 39 #include "ipc/ipc_platform_file.h"
40 #include "media/audio/audio_io.h" 40 #include "media/audio/audio_io.h"
41 #include "net/base/upload_data.h" 41 #include "net/base/upload_data.h"
42 #include "net/http/http_response_headers.h"
42 #include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h" 43 #include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h"
43 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h" 44 #include "third_party/WebKit/WebKit/chromium/public/WebTextDirection.h"
44 #include "webkit/appcache/appcache_interfaces.h" // enum appcache::Status 45 #include "webkit/appcache/appcache_interfaces.h"
45 #include "webkit/glue/password_form.h" // used in struct 46 #include "webkit/glue/context_menu.h"
47 #include "webkit/glue/form_data.h"
48 #include "webkit/glue/form_field.h"
49 #include "webkit/glue/password_form.h"
50 #include "webkit/glue/password_form_dom_manager.h"
46 #include "webkit/glue/plugins/webplugin.h" 51 #include "webkit/glue/plugins/webplugin.h"
52 #include "webkit/glue/plugins/webplugininfo.h"
47 #include "webkit/glue/resource_loader_bridge.h" 53 #include "webkit/glue/resource_loader_bridge.h"
54 #include "webkit/glue/webaccessibility.h"
55 #include "webkit/glue/webcookie.h"
56 #include "webkit/glue/webdropdata.h"
48 #include "webkit/glue/webmenuitem.h" 57 #include "webkit/glue/webmenuitem.h"
49 #include "webkit/glue/webpreferences.h" // used in struct 58 #include "webkit/glue/webpreferences.h"
50
51 namespace appcache {
52 struct AppCacheInfo;
53 struct AppCacheResourceInfo;
54 }
55 59
56 namespace base { 60 namespace base {
57 class Time; 61 class Time;
58 } 62 }
59 63
60 namespace net { 64 namespace net {
61 class HttpResponseHeaders; 65 class HttpResponseHeaders;
62 } 66 }
63 67
64 namespace webkit_glue { 68 namespace webkit_glue {
65 struct FormData; 69 struct FormData;
66 class FormField; 70 class FormField;
67 struct PasswordFormFillData; 71 struct PasswordFormFillData;
68 struct WebAccessibility; 72 struct WebAccessibility;
69 struct WebCookie; 73 struct WebCookie;
70 } 74 }
71 75
72 namespace webkit_glue { 76 namespace webkit_glue {
73 struct WebAccessibility; 77 struct WebAccessibility;
74 } 78 }
75 79
76 struct EditCommand; 80 struct EditCommand;
77 class ExtensionExtent; 81 class ExtensionExtent;
78 class IndexedDBKey; 82 class IndexedDBKey;
79 class SerializedScriptValue; 83 class SerializedScriptValue;
80 84
81 class SkBitmap; 85 class SkBitmap;
82 class URLPattern;
83 struct ContextMenuParams;
84 struct WebDropData;
85 struct WebPluginInfo;
86 struct WebPluginMimeType;
87 86
88 // Parameters structure for ViewMsg_Navigate, which has too many data 87 // Parameters structure for ViewMsg_Navigate, which has too many data
89 // parameters to be reasonably put in a predefined IPC message. 88 // parameters to be reasonably put in a predefined IPC message.
90 struct ViewMsg_Navigate_Params { 89 struct ViewMsg_Navigate_Params {
91 enum NavigationType { 90 enum NavigationType {
92 // Reload the page. 91 // Reload the page.
93 RELOAD, 92 RELOAD,
94 93
95 // Reload the page, ignoring any cache entries. 94 // Reload the page, ignoring any cache entries.
96 RELOAD_IGNORING_CACHE, 95 RELOAD_IGNORING_CACHE,
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 } 907 }
909 908
910 LogParam(type, l); 909 LogParam(type, l);
911 } 910 }
912 }; 911 };
913 912
914 // Traits for ViewMsg_Navigate_Params structure to pack/unpack. 913 // Traits for ViewMsg_Navigate_Params structure to pack/unpack.
915 template <> 914 template <>
916 struct ParamTraits<ViewMsg_Navigate_Params> { 915 struct ParamTraits<ViewMsg_Navigate_Params> {
917 typedef ViewMsg_Navigate_Params param_type; 916 typedef ViewMsg_Navigate_Params param_type;
918 static void Write(Message* m, const param_type& p); 917 static void Write(Message* m, const param_type& p) {
919 static bool Read(const Message* m, void** iter, param_type* p); 918 WriteParam(m, p.page_id);
920 static void Log(const param_type& p, std::wstring* l); 919 WriteParam(m, p.pending_history_list_offset);
920 WriteParam(m, p.current_history_list_offset);
921 WriteParam(m, p.current_history_list_length);
922 WriteParam(m, p.url);
923 WriteParam(m, p.referrer);
924 WriteParam(m, p.transition);
925 WriteParam(m, p.state);
926 WriteParam(m, p.navigation_type);
927 WriteParam(m, p.request_time);
928 }
929 static bool Read(const Message* m, void** iter, param_type* p) {
930 return
931 ReadParam(m, iter, &p->page_id) &&
932 ReadParam(m, iter, &p->pending_history_list_offset) &&
933 ReadParam(m, iter, &p->current_history_list_offset) &&
934 ReadParam(m, iter, &p->current_history_list_length) &&
935 ReadParam(m, iter, &p->url) &&
936 ReadParam(m, iter, &p->referrer) &&
937 ReadParam(m, iter, &p->transition) &&
938 ReadParam(m, iter, &p->state) &&
939 ReadParam(m, iter, &p->navigation_type) &&
940 ReadParam(m, iter, &p->request_time);
941 }
942 static void Log(const param_type& p, std::wstring* l) {
943 l->append(L"(");
944 LogParam(p.page_id, l);
945 l->append(L", ");
946 LogParam(p.url, l);
947 l->append(L", ");
948 LogParam(p.transition, l);
949 l->append(L", ");
950 LogParam(p.state, l);
951 l->append(L", ");
952 LogParam(p.navigation_type, l);
953 l->append(L", ");
954 LogParam(p.request_time, l);
955 l->append(L")");
956 }
921 }; 957 };
922 958
923 template<> 959 template<>
924 struct ParamTraits<ViewMsg_Navigate_Params::NavigationType> { 960 struct ParamTraits<ViewMsg_Navigate_Params::NavigationType> {
925 typedef ViewMsg_Navigate_Params::NavigationType param_type; 961 typedef ViewMsg_Navigate_Params::NavigationType param_type;
926 static void Write(Message* m, const param_type& p) { 962 static void Write(Message* m, const param_type& p) {
927 m->WriteInt(p); 963 m->WriteInt(p);
928 } 964 }
929 static bool Read(const Message* m, void** iter, param_type* p) { 965 static bool Read(const Message* m, void** iter, param_type* p) {
930 int type; 966 int type;
931 if (!m->ReadInt(iter, &type)) 967 if (!m->ReadInt(iter, &type))
932 return false; 968 return false;
933 *p = static_cast<ViewMsg_Navigate_Params::NavigationType>(type); 969 *p = static_cast<ViewMsg_Navigate_Params::NavigationType>(type);
934 return true; 970 return true;
935 } 971 }
936 static void Log(const param_type& p, std::wstring* l) { 972 static void Log(const param_type& p, std::wstring* l) {
937 std::wstring event; 973 std::wstring event;
938 switch (p) { 974 switch (p) {
939 case ViewMsg_Navigate_Params::RELOAD: 975 case ViewMsg_Navigate_Params::RELOAD:
940 event = L"NavigationType_RELOAD"; 976 event = L"NavigationType_RELOAD";
941 break; 977 break;
942 978
943 case ViewMsg_Navigate_Params::RELOAD_IGNORING_CACHE: 979 case ViewMsg_Navigate_Params::RELOAD_IGNORING_CACHE:
944 event = L"NavigationType_RELOAD_IGNORING_CACHE"; 980 event = L"NavigationType_RELOAD_IGNORING_CACHE";
945 break; 981 break;
946 982
947 case ViewMsg_Navigate_Params::RESTORE: 983 case ViewMsg_Navigate_Params::RESTORE:
948 event = L"NavigationType_RESTORE"; 984 event = L"NavigationType_RESTORE";
949 break; 985 break;
950 986
951 case ViewMsg_Navigate_Params::NORMAL: 987 case ViewMsg_Navigate_Params::NORMAL:
952 event = L"NavigationType_NORMAL"; 988 event = L"NavigationType_NORMAL";
953 break; 989 break;
954 990
955 default: 991 default:
956 event = L"NavigationType_UNKNOWN"; 992 event = L"NavigationType_UNKNOWN";
957 break; 993 break;
958 } 994 }
959 LogParam(event, l); 995 LogParam(event, l);
960 } 996 }
961 }; 997 };
962 998
963 // Traits for FormField_Params structure to pack/unpack. 999 // Traits for FormField_Params structure to pack/unpack.
964 template <> 1000 template <>
965 struct ParamTraits<webkit_glue::FormField> { 1001 struct ParamTraits<webkit_glue::FormField> {
966 typedef webkit_glue::FormField param_type; 1002 typedef webkit_glue::FormField param_type;
967 static void Write(Message* m, const param_type& p); 1003 static void Write(Message* m, const param_type& p) {
968 static bool Read(const Message* m, void** iter, param_type* p); 1004 WriteParam(m, p.label());
969 static void Log(const param_type& p, std::wstring* l); 1005 WriteParam(m, p.name());
1006 WriteParam(m, p.value());
1007 WriteParam(m, p.form_control_type());
1008 WriteParam(m, p.size());
1009 WriteParam(m, p.option_strings());
1010 }
1011 static bool Read(const Message* m, void** iter, param_type* p) {
1012 string16 label, name, value, form_control_type;
1013 int size = 0;
1014 std::vector<string16> options;
1015 bool result = ReadParam(m, iter, &label);
1016 result = result && ReadParam(m, iter, &name);
1017 result = result && ReadParam(m, iter, &value);
1018 result = result && ReadParam(m, iter, &form_control_type);
1019 result = result && ReadParam(m, iter, &size);
1020 result = result && ReadParam(m, iter, &options);
1021 if (!result)
1022 return false;
1023
1024 p->set_label(label);
1025 p->set_name(name);
1026 p->set_value(value);
1027 p->set_form_control_type(form_control_type);
1028 p->set_size(size);
1029 p->set_option_strings(options);
1030 return true;
1031 }
1032 static void Log(const param_type& p, std::wstring* l) {
1033 l->append(L"<FormField>");
1034 }
970 }; 1035 };
971 1036
972 // Traits for FontDescriptor structure to pack/unpack. 1037 // Traits for FontDescriptor structure to pack/unpack.
973 template <> 1038 template <>
974 struct ParamTraits<FontDescriptor> { 1039 struct ParamTraits<FontDescriptor> {
975 typedef FontDescriptor param_type; 1040 typedef FontDescriptor param_type;
976 static void Write(Message* m, const param_type& p) { 1041 static void Write(Message* m, const param_type& p) {
977 WriteParam(m, p.font_name); 1042 WriteParam(m, p.font_name);
978 WriteParam(m, p.font_point_size); 1043 WriteParam(m, p.font_point_size);
979 } 1044 }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 LogParam(p.is_content_filtered, l); 1165 LogParam(p.is_content_filtered, l);
1101 l->append(L", "); 1166 l->append(L", ");
1102 LogParam(p.http_status_code, l); 1167 LogParam(p.http_status_code, l);
1103 l->append(L")"); 1168 l->append(L")");
1104 } 1169 }
1105 }; 1170 };
1106 1171
1107 template <> 1172 template <>
1108 struct ParamTraits<ContextMenuParams> { 1173 struct ParamTraits<ContextMenuParams> {
1109 typedef ContextMenuParams param_type; 1174 typedef ContextMenuParams param_type;
1110 static void Write(Message* m, const param_type& p); 1175 static void Write(Message* m, const param_type& p) {
1111 static bool Read(const Message* m, void** iter, param_type* p); 1176 WriteParam(m, p.media_type);
1112 static void Log(const param_type& p, std::wstring* l); 1177 WriteParam(m, p.x);
1178 WriteParam(m, p.y);
1179 WriteParam(m, p.link_url);
1180 WriteParam(m, p.unfiltered_link_url);
1181 WriteParam(m, p.src_url);
1182 WriteParam(m, p.is_image_blocked);
1183 WriteParam(m, p.page_url);
1184 WriteParam(m, p.frame_url);
1185 WriteParam(m, p.media_flags);
1186 WriteParam(m, p.selection_text);
1187 WriteParam(m, p.misspelled_word);
1188 WriteParam(m, p.dictionary_suggestions);
1189 WriteParam(m, p.spellcheck_enabled);
1190 WriteParam(m, p.is_editable);
1191 #if defined(OS_MACOSX)
1192 WriteParam(m, p.writing_direction_default);
1193 WriteParam(m, p.writing_direction_left_to_right);
1194 WriteParam(m, p.writing_direction_right_to_left);
1195 #endif // OS_MACOSX
1196 WriteParam(m, p.edit_flags);
1197 WriteParam(m, p.security_info);
1198 WriteParam(m, p.frame_charset);
1199 WriteParam(m, p.custom_items);
1200 }
1201 static bool Read(const Message* m, void** iter, param_type* p) {
1202 return
1203 ReadParam(m, iter, &p->media_type) &&
1204 ReadParam(m, iter, &p->x) &&
1205 ReadParam(m, iter, &p->y) &&
1206 ReadParam(m, iter, &p->link_url) &&
1207 ReadParam(m, iter, &p->unfiltered_link_url) &&
1208 ReadParam(m, iter, &p->src_url) &&
1209 ReadParam(m, iter, &p->is_image_blocked) &&
1210 ReadParam(m, iter, &p->page_url) &&
1211 ReadParam(m, iter, &p->frame_url) &&
1212 ReadParam(m, iter, &p->media_flags) &&
1213 ReadParam(m, iter, &p->selection_text) &&
1214 ReadParam(m, iter, &p->misspelled_word) &&
1215 ReadParam(m, iter, &p->dictionary_suggestions) &&
1216 ReadParam(m, iter, &p->spellcheck_enabled) &&
1217 ReadParam(m, iter, &p->is_editable) &&
1218 #if defined(OS_MACOSX)
1219 ReadParam(m, iter, &p->writing_direction_default) &&
1220 ReadParam(m, iter, &p->writing_direction_left_to_right) &&
1221 ReadParam(m, iter, &p->writing_direction_right_to_left) &&
1222 #endif // OS_MACOSX
1223 ReadParam(m, iter, &p->edit_flags) &&
1224 ReadParam(m, iter, &p->security_info) &&
1225 ReadParam(m, iter, &p->frame_charset) &&
1226 ReadParam(m, iter, &p->custom_items);
1227 }
1228 static void Log(const param_type& p, std::wstring* l) {
1229 l->append(L"<ContextMenuParams>");
1230 }
1113 }; 1231 };
1114 1232
1115 // Traits for ViewHostMsg_UpdateRect_Params structure to pack/unpack. 1233 // Traits for ViewHostMsg_UpdateRect_Params structure to pack/unpack.
1116 template <> 1234 template <>
1117 struct ParamTraits<ViewHostMsg_UpdateRect_Params> { 1235 struct ParamTraits<ViewHostMsg_UpdateRect_Params> {
1118 typedef ViewHostMsg_UpdateRect_Params param_type; 1236 typedef ViewHostMsg_UpdateRect_Params param_type;
1119 static void Write(Message* m, const param_type& p); 1237 static void Write(Message* m, const param_type& p) {
1120 static bool Read(const Message* m, void** iter, param_type* p); 1238 WriteParam(m, p.bitmap);
1121 static void Log(const param_type& p, std::wstring* l); 1239 WriteParam(m, p.bitmap_rect);
1240 WriteParam(m, p.dx);
1241 WriteParam(m, p.dy);
1242 WriteParam(m, p.scroll_rect);
1243 WriteParam(m, p.copy_rects);
1244 WriteParam(m, p.view_size);
1245 WriteParam(m, p.plugin_window_moves);
1246 WriteParam(m, p.flags);
1247 }
1248 static bool Read(const Message* m, void** iter, param_type* p) {
1249 return
1250 ReadParam(m, iter, &p->bitmap) &&
1251 ReadParam(m, iter, &p->bitmap_rect) &&
1252 ReadParam(m, iter, &p->dx) &&
1253 ReadParam(m, iter, &p->dy) &&
1254 ReadParam(m, iter, &p->scroll_rect) &&
1255 ReadParam(m, iter, &p->copy_rects) &&
1256 ReadParam(m, iter, &p->view_size) &&
1257 ReadParam(m, iter, &p->plugin_window_moves) &&
1258 ReadParam(m, iter, &p->flags);
1259 }
1260 static void Log(const param_type& p, std::wstring* l) {
1261 l->append(L"(");
1262 LogParam(p.bitmap, l);
1263 l->append(L", ");
1264 LogParam(p.bitmap_rect, l);
1265 l->append(L", ");
1266 LogParam(p.dx, l);
1267 l->append(L", ");
1268 LogParam(p.dy, l);
1269 l->append(L", ");
1270 LogParam(p.scroll_rect, l);
1271 l->append(L", ");
1272 LogParam(p.copy_rects, l);
1273 l->append(L", ");
1274 LogParam(p.view_size, l);
1275 l->append(L", ");
1276 LogParam(p.plugin_window_moves, l);
1277 l->append(L", ");
1278 LogParam(p.flags, l);
1279 l->append(L")");
1280 }
1122 }; 1281 };
1123 1282
1124 template <> 1283 template <>
1125 struct ParamTraits<webkit_glue::WebPluginGeometry> { 1284 struct ParamTraits<webkit_glue::WebPluginGeometry> {
1126 typedef webkit_glue::WebPluginGeometry param_type; 1285 typedef webkit_glue::WebPluginGeometry param_type;
1127 static void Write(Message* m, const param_type& p); 1286 static void Write(Message* m, const param_type& p) {
1128 static bool Read(const Message* m, void** iter, param_type* p); 1287 WriteParam(m, p.window);
1129 static void Log(const param_type& p, std::wstring* l); 1288 WriteParam(m, p.window_rect);
1289 WriteParam(m, p.clip_rect);
1290 WriteParam(m, p.cutout_rects);
1291 WriteParam(m, p.rects_valid);
1292 WriteParam(m, p.visible);
1293 }
1294 static bool Read(const Message* m, void** iter, param_type* p) {
1295 return
1296 ReadParam(m, iter, &p->window) &&
1297 ReadParam(m, iter, &p->window_rect) &&
1298 ReadParam(m, iter, &p->clip_rect) &&
1299 ReadParam(m, iter, &p->cutout_rects) &&
1300 ReadParam(m, iter, &p->rects_valid) &&
1301 ReadParam(m, iter, &p->visible);
1302 }
1303 static void Log(const param_type& p, std::wstring* l) {
1304 l->append(L"(");
1305 LogParam(p.window, l);
1306 l->append(L", ");
1307 LogParam(p.window_rect, l);
1308 l->append(L", ");
1309 LogParam(p.clip_rect, l);
1310 l->append(L", ");
1311 LogParam(p.cutout_rects, l);
1312 l->append(L", ");
1313 LogParam(p.rects_valid, l);
1314 l->append(L", ");
1315 LogParam(p.visible, l);
1316 l->append(L")");
1317 }
1130 }; 1318 };
1131 1319
1132 // Traits for ViewMsg_GetPlugins_Reply structure to pack/unpack. 1320 // Traits for ViewMsg_GetPlugins_Reply structure to pack/unpack.
1133 template <> 1321 template <>
1134 struct ParamTraits<WebPluginMimeType> { 1322 struct ParamTraits<WebPluginMimeType> {
1135 typedef WebPluginMimeType param_type; 1323 typedef WebPluginMimeType param_type;
1136 static void Write(Message* m, const param_type& p); 1324 static void Write(Message* m, const param_type& p) {
1137 static bool Read(const Message* m, void** iter, param_type* r); 1325 WriteParam(m, p.mime_type);
1138 static void Log(const param_type& p, std::wstring* l); 1326 WriteParam(m, p.file_extensions);
1139 }; 1327 WriteParam(m, p.description);
1328 }
1329 static bool Read(const Message* m, void** iter, param_type* r) {
1330 return
1331 ReadParam(m, iter, &r->mime_type) &&
1332 ReadParam(m, iter, &r->file_extensions) &&
1333 ReadParam(m, iter, &r->description);
1334 }
1335 static void Log(const param_type& p, std::wstring* l) {
1336 l->append(L"(");
1337 LogParam(p.mime_type, l);
1338 l->append(L", ");
1339 LogParam(p.file_extensions, l);
1340 l->append(L", ");
1341 LogParam(p.description, l);
1342 l->append(L")");
1343 }
1344 };
1345
1140 1346
1141 template <> 1347 template <>
1142 struct ParamTraits<WebPluginInfo> { 1348 struct ParamTraits<WebPluginInfo> {
1143 typedef WebPluginInfo param_type; 1349 typedef WebPluginInfo param_type;
1144 static void Write(Message* m, const param_type& p); 1350 static void Write(Message* m, const param_type& p) {
1145 static bool Read(const Message* m, void** iter, param_type* r); 1351 WriteParam(m, p.name);
1146 static void Log(const param_type& p, std::wstring* l); 1352 WriteParam(m, p.path);
1353 WriteParam(m, p.version);
1354 WriteParam(m, p.desc);
1355 WriteParam(m, p.mime_types);
1356 WriteParam(m, p.enabled);
1357 }
1358 static bool Read(const Message* m, void** iter, param_type* r) {
1359 return
1360 ReadParam(m, iter, &r->name) &&
1361 ReadParam(m, iter, &r->path) &&
1362 ReadParam(m, iter, &r->version) &&
1363 ReadParam(m, iter, &r->desc) &&
1364 ReadParam(m, iter, &r->mime_types) &&
1365 ReadParam(m, iter, &r->enabled);
1366 }
1367 static void Log(const param_type& p, std::wstring* l) {
1368 l->append(L"(");
1369 LogParam(p.name, l);
1370 l->append(L", ");
1371 l->append(L", ");
1372 LogParam(p.path, l);
1373 l->append(L", ");
1374 LogParam(p.version, l);
1375 l->append(L", ");
1376 LogParam(p.desc, l);
1377 l->append(L", ");
1378 LogParam(p.mime_types, l);
1379 l->append(L", ");
1380 LogParam(p.enabled, l);
1381 l->append(L")");
1382 }
1147 }; 1383 };
1148 1384
1149 // Traits for webkit_glue::PasswordFormDomManager::FillData. 1385 // Traits for webkit_glue::PasswordFormDomManager::FillData.
1150 template <> 1386 template <>
1151 struct ParamTraits<webkit_glue::PasswordFormFillData> { 1387 struct ParamTraits<webkit_glue::PasswordFormFillData> {
1152 typedef webkit_glue::PasswordFormFillData param_type; 1388 typedef webkit_glue::PasswordFormFillData param_type;
1153 static void Write(Message* m, const param_type& p); 1389 static void Write(Message* m, const param_type& p) {
1154 static bool Read(const Message* m, void** iter, param_type* r); 1390 WriteParam(m, p.basic_data);
1155 static void Log(const param_type& p, std::wstring* l); 1391 WriteParam(m, p.additional_logins);
1392 WriteParam(m, p.wait_for_username);
1393 }
1394 static bool Read(const Message* m, void** iter, param_type* r) {
1395 return
1396 ReadParam(m, iter, &r->basic_data) &&
1397 ReadParam(m, iter, &r->additional_logins) &&
1398 ReadParam(m, iter, &r->wait_for_username);
1399 }
1400 static void Log(const param_type& p, std::wstring* l) {
1401 l->append(L"<PasswordFormFillData>");
1402 }
1156 }; 1403 };
1157 1404
1158 template<> 1405 template<>
1159 struct ParamTraits<NavigationGesture> { 1406 struct ParamTraits<NavigationGesture> {
1160 typedef NavigationGesture param_type; 1407 typedef NavigationGesture param_type;
1161 static void Write(Message* m, const param_type& p) { 1408 static void Write(Message* m, const param_type& p) {
1162 m->WriteInt(p); 1409 m->WriteInt(p);
1163 } 1410 }
1164 static bool Read(const Message* m, void** iter, param_type* p) { 1411 static bool Read(const Message* m, void** iter, param_type* p) {
1165 int type; 1412 int type;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 LogParam(p.host_renderer_id, l); 1535 LogParam(p.host_renderer_id, l);
1289 l->append(L", "); 1536 l->append(L", ");
1290 LogParam(p.host_render_view_id, l); 1537 LogParam(p.host_render_view_id, l);
1291 l->append(L")"); 1538 l->append(L")");
1292 } 1539 }
1293 }; 1540 };
1294 1541
1295 template <> 1542 template <>
1296 struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > { 1543 struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
1297 typedef scoped_refptr<net::HttpResponseHeaders> param_type; 1544 typedef scoped_refptr<net::HttpResponseHeaders> param_type;
1298 static void Write(Message* m, const param_type& p); 1545 static void Write(Message* m, const param_type& p) {
1299 static bool Read(const Message* m, void** iter, param_type* r); 1546 WriteParam(m, p.get() != NULL);
1300 static void Log(const param_type& p, std::wstring* l); 1547 if (p) {
1548 // Do not disclose Set-Cookie headers over IPC.
1549 p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES);
1550 }
1551 }
1552 static bool Read(const Message* m, void** iter, param_type* r) {
1553 bool has_object;
1554 if (!ReadParam(m, iter, &has_object))
1555 return false;
1556 if (has_object)
1557 *r = new net::HttpResponseHeaders(*m, iter);
1558 return true;
1559 }
1560 static void Log(const param_type& p, std::wstring* l) {
1561 l->append(L"<HttpResponseHeaders>");
1562 }
1301 }; 1563 };
1302 1564
1303 // Traits for webkit_glue::ResourceLoaderBridge::LoadTimingInfo 1565 // Traits for webkit_glue::ResourceLoaderBridge::LoadTimingInfo
1304 template <> 1566 template <>
1305 struct ParamTraits<webkit_glue::ResourceLoaderBridge::LoadTimingInfo> { 1567 struct ParamTraits<webkit_glue::ResourceLoaderBridge::LoadTimingInfo> {
1306 typedef webkit_glue::ResourceLoaderBridge::LoadTimingInfo param_type; 1568 typedef webkit_glue::ResourceLoaderBridge::LoadTimingInfo param_type;
1307 static void Write(Message* m, const param_type& p) { 1569 static void Write(Message* m, const param_type& p) {
1308 WriteParam(m, p.base_time.is_null()); 1570 WriteParam(m, p.base_time.is_null());
1309 if (p.base_time.is_null()) 1571 if (p.base_time.is_null())
1310 return; 1572 return;
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 } 1755 }
1494 static void Log(const param_type& p, std::wstring* l) { 1756 static void Log(const param_type& p, std::wstring* l) {
1495 // log more? 1757 // log more?
1496 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l); 1758 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
1497 } 1759 }
1498 }; 1760 };
1499 1761
1500 template <> 1762 template <>
1501 struct ParamTraits<SerializedScriptValue> { 1763 struct ParamTraits<SerializedScriptValue> {
1502 typedef SerializedScriptValue param_type; 1764 typedef SerializedScriptValue param_type;
1503 static void Write(Message* m, const param_type& p); 1765 static void Write(Message* m, const param_type& p) {
1504 static bool Read(const Message* m, void** iter, param_type* r); 1766 WriteParam(m, p.is_null());
1505 static void Log(const param_type& p, std::wstring* l); 1767 WriteParam(m, p.is_invalid());
1768 WriteParam(m, p.data());
1769 }
1770 static bool Read(const Message* m, void** iter, param_type* r) {
1771 bool is_null;
1772 bool is_invalid;
1773 string16 data;
1774 bool ok =
1775 ReadParam(m, iter, &is_null) &&
1776 ReadParam(m, iter, &is_invalid) &&
1777 ReadParam(m, iter, &data);
1778 if (!ok)
1779 return false;
1780 r->set_is_null(is_null);
1781 r->set_is_invalid(is_invalid);
1782 r->set_data(data);
1783 return true;
1784 }
1785 static void Log(const param_type& p, std::wstring* l) {
1786 l->append(L"<SerializedScriptValue>(");
1787 LogParam(p.is_null(), l);
1788 l->append(L", ");
1789 LogParam(p.is_invalid(), l);
1790 l->append(L", ");
1791 LogParam(p.data(), l);
1792 l->append(L")");
1793 }
1506 }; 1794 };
1507 1795
1508 template <> 1796 template <>
1509 struct ParamTraits<IndexedDBKey> { 1797 struct ParamTraits<IndexedDBKey> {
1510 typedef IndexedDBKey param_type; 1798 typedef IndexedDBKey param_type;
1511 static void Write(Message* m, const param_type& p); 1799 static void Write(Message* m, const param_type& p) {
1512 static bool Read(const Message* m, void** iter, param_type* r); 1800 WriteParam(m, int(p.type()));
1513 static void Log(const param_type& p, std::wstring* l); 1801 // TODO(jorlow): Technically, we only need to pack the type being used.
1802 WriteParam(m, p.string());
1803 WriteParam(m, p.number());
1804 }
1805 static bool Read(const Message* m, void** iter, param_type* r) {
1806 int type;
1807 string16 string;
1808 int32 number;
1809 bool ok =
1810 ReadParam(m, iter, &type) &&
1811 ReadParam(m, iter, &string) &&
1812 ReadParam(m, iter, &number);
1813 if (!ok)
1814 return false;
1815 switch (type) {
1816 case WebKit::WebIDBKey::NullType:
1817 r->SetNull();
1818 return true;
1819 case WebKit::WebIDBKey::StringType:
1820 r->Set(string);
1821 return true;
1822 case WebKit::WebIDBKey::NumberType:
1823 r->Set(number);
1824 return true;
1825 case WebKit::WebIDBKey::InvalidType:
1826 r->SetInvalid();
1827 return true;
1828 }
1829 NOTREACHED();
1830 return false;
1831 }
1832 static void Log(const param_type& p, std::wstring* l) {
1833 l->append(L"<IndexedDBKey>(");
1834 LogParam(int(p.type()), l);
1835 l->append(L", ");
1836 LogParam(p.string(), l);
1837 l->append(L", ");
1838 LogParam(p.number(), l);
1839 l->append(L")");
1840 }
1514 }; 1841 };
1515 1842
1516 // Traits for FormData structure to pack/unpack. 1843 // Traits for FormData structure to pack/unpack.
1517 template <> 1844 template <>
1518 struct ParamTraits<webkit_glue::FormData> { 1845 struct ParamTraits<webkit_glue::FormData> {
1519 typedef webkit_glue::FormData param_type; 1846 typedef webkit_glue::FormData param_type;
1520 static void Write(Message* m, const param_type& p); 1847 static void Write(Message* m, const param_type& p) {
1521 static bool Read(const Message* m, void** iter, param_type* p); 1848 WriteParam(m, p.name);
1522 static void Log(const param_type& p, std::wstring* l); 1849 WriteParam(m, p.method);
1850 WriteParam(m, p.origin);
1851 WriteParam(m, p.action);
1852 WriteParam(m, p.user_submitted);
1853 WriteParam(m, p.fields);
1854 }
1855 static bool Read(const Message* m, void** iter, param_type* p) {
1856 return
1857 ReadParam(m, iter, &p->name) &&
1858 ReadParam(m, iter, &p->method) &&
1859 ReadParam(m, iter, &p->origin) &&
1860 ReadParam(m, iter, &p->action) &&
1861 ReadParam(m, iter, &p->user_submitted) &&
1862 ReadParam(m, iter, &p->fields);
1863 }
1864 static void Log(const param_type& p, std::wstring* l) {
1865 l->append(L"<FormData>");
1866 }
1523 }; 1867 };
1524 1868
1525 // Traits for ViewMsg_Print_Params 1869 // Traits for ViewMsg_Print_Params
1526 template <> 1870 template <>
1527 struct ParamTraits<ViewMsg_Print_Params> { 1871 struct ParamTraits<ViewMsg_Print_Params> {
1528 typedef ViewMsg_Print_Params param_type; 1872 typedef ViewMsg_Print_Params param_type;
1529 static void Write(Message* m, const param_type& p) { 1873 static void Write(Message* m, const param_type& p) {
1530 WriteParam(m, p.page_size); 1874 WriteParam(m, p.page_size);
1531 WriteParam(m, p.printable_size); 1875 WriteParam(m, p.printable_size);
1532 WriteParam(m, p.margin_top); 1876 WriteParam(m, p.margin_top);
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
1631 static void Log(const param_type& p, std::wstring* l) { 1975 static void Log(const param_type& p, std::wstring* l) {
1632 l->append(L"<CSSColorName>"); 1976 l->append(L"<CSSColorName>");
1633 } 1977 }
1634 }; 1978 };
1635 1979
1636 1980
1637 // Traits for RendererPreferences structure to pack/unpack. 1981 // Traits for RendererPreferences structure to pack/unpack.
1638 template <> 1982 template <>
1639 struct ParamTraits<RendererPreferences> { 1983 struct ParamTraits<RendererPreferences> {
1640 typedef RendererPreferences param_type; 1984 typedef RendererPreferences param_type;
1641 static void Write(Message* m, const param_type& p); 1985 static void Write(Message* m, const param_type& p) {
1642 static bool Read(const Message* m, void** iter, param_type* p); 1986 WriteParam(m, p.can_accept_load_drops);
1643 static void Log(const param_type& p, std::wstring* l); 1987 WriteParam(m, p.should_antialias_text);
1988 WriteParam(m, static_cast<int>(p.hinting));
1989 WriteParam(m, static_cast<int>(p.subpixel_rendering));
1990 WriteParam(m, p.focus_ring_color);
1991 WriteParam(m, p.thumb_active_color);
1992 WriteParam(m, p.thumb_inactive_color);
1993 WriteParam(m, p.track_color);
1994 WriteParam(m, p.active_selection_bg_color);
1995 WriteParam(m, p.active_selection_fg_color);
1996 WriteParam(m, p.inactive_selection_bg_color);
1997 WriteParam(m, p.inactive_selection_fg_color);
1998 WriteParam(m, p.browser_handles_top_level_requests);
1999 WriteParam(m, p.caret_blink_interval);
2000 }
2001 static bool Read(const Message* m, void** iter, param_type* p) {
2002 if (!ReadParam(m, iter, &p->can_accept_load_drops))
2003 return false;
2004 if (!ReadParam(m, iter, &p->should_antialias_text))
2005 return false;
2006
2007 int hinting = 0;
2008 if (!ReadParam(m, iter, &hinting))
2009 return false;
2010 p->hinting = static_cast<RendererPreferencesHintingEnum>(hinting);
2011
2012 int subpixel_rendering = 0;
2013 if (!ReadParam(m, iter, &subpixel_rendering))
2014 return false;
2015 p->subpixel_rendering =
2016 static_cast<RendererPreferencesSubpixelRenderingEnum>(
2017 subpixel_rendering);
2018
2019 int focus_ring_color;
2020 if (!ReadParam(m, iter, &focus_ring_color))
2021 return false;
2022 p->focus_ring_color = focus_ring_color;
2023
2024 int thumb_active_color, thumb_inactive_color, track_color;
2025 int active_selection_bg_color, active_selection_fg_color;
2026 int inactive_selection_bg_color, inactive_selection_fg_color;
2027 if (!ReadParam(m, iter, &thumb_active_color) ||
2028 !ReadParam(m, iter, &thumb_inactive_color) ||
2029 !ReadParam(m, iter, &track_color) ||
2030 !ReadParam(m, iter, &active_selection_bg_color) ||
2031 !ReadParam(m, iter, &active_selection_fg_color) ||
2032 !ReadParam(m, iter, &inactive_selection_bg_color) ||
2033 !ReadParam(m, iter, &inactive_selection_fg_color))
2034 return false;
2035 p->thumb_active_color = thumb_active_color;
2036 p->thumb_inactive_color = thumb_inactive_color;
2037 p->track_color = track_color;
2038 p->active_selection_bg_color = active_selection_bg_color;
2039 p->active_selection_fg_color = active_selection_fg_color;
2040 p->inactive_selection_bg_color = inactive_selection_bg_color;
2041 p->inactive_selection_fg_color = inactive_selection_fg_color;
2042
2043 if (!ReadParam(m, iter, &p->browser_handles_top_level_requests))
2044 return false;
2045
2046 if (!ReadParam(m, iter, &p->caret_blink_interval))
2047 return false;
2048
2049 return true;
2050 }
2051 static void Log(const param_type& p, std::wstring* l) {
2052 l->append(L"<RendererPreferences>");
2053 }
1644 }; 2054 };
1645 2055
1646 // Traits for WebPreferences structure to pack/unpack. 2056 // Traits for WebPreferences structure to pack/unpack.
1647 template <> 2057 template <>
1648 struct ParamTraits<WebPreferences> { 2058 struct ParamTraits<WebPreferences> {
1649 typedef WebPreferences param_type; 2059 typedef WebPreferences param_type;
1650 static void Write(Message* m, const param_type& p); 2060 static void Write(Message* m, const param_type& p) {
1651 static bool Read(const Message* m, void** iter, param_type* p); 2061 WriteParam(m, p.standard_font_family);
1652 static void Log(const param_type& p, std::wstring* l); 2062 WriteParam(m, p.fixed_font_family);
2063 WriteParam(m, p.serif_font_family);
2064 WriteParam(m, p.sans_serif_font_family);
2065 WriteParam(m, p.cursive_font_family);
2066 WriteParam(m, p.fantasy_font_family);
2067 WriteParam(m, p.default_font_size);
2068 WriteParam(m, p.default_fixed_font_size);
2069 WriteParam(m, p.minimum_font_size);
2070 WriteParam(m, p.minimum_logical_font_size);
2071 WriteParam(m, p.default_encoding);
2072 WriteParam(m, p.javascript_enabled);
2073 WriteParam(m, p.web_security_enabled);
2074 WriteParam(m, p.javascript_can_open_windows_automatically);
2075 WriteParam(m, p.loads_images_automatically);
2076 WriteParam(m, p.plugins_enabled);
2077 WriteParam(m, p.dom_paste_enabled);
2078 WriteParam(m, p.developer_extras_enabled);
2079 WriteParam(m, p.inspector_settings);
2080 WriteParam(m, p.site_specific_quirks_enabled);
2081 WriteParam(m, p.shrinks_standalone_images_to_fit);
2082 WriteParam(m, p.uses_universal_detector);
2083 WriteParam(m, p.text_areas_are_resizable);
2084 WriteParam(m, p.java_enabled);
2085 WriteParam(m, p.allow_scripts_to_close_windows);
2086 WriteParam(m, p.uses_page_cache);
2087 WriteParam(m, p.remote_fonts_enabled);
2088 WriteParam(m, p.javascript_can_access_clipboard);
2089 WriteParam(m, p.xss_auditor_enabled);
2090 WriteParam(m, p.local_storage_enabled);
2091 WriteParam(m, p.databases_enabled);
2092 WriteParam(m, p.application_cache_enabled);
2093 WriteParam(m, p.tabs_to_links);
2094 WriteParam(m, p.user_style_sheet_enabled);
2095 WriteParam(m, p.user_style_sheet_location);
2096 WriteParam(m, p.author_and_user_styles_enabled);
2097 WriteParam(m, p.allow_universal_access_from_file_urls);
2098 WriteParam(m, p.allow_file_access_from_file_urls);
2099 WriteParam(m, p.experimental_webgl_enabled);
2100 WriteParam(m, p.show_composited_layer_borders);
2101 WriteParam(m, p.accelerated_compositing_enabled);
2102 WriteParam(m, p.accelerated_2d_canvas_enabled);
2103 WriteParam(m, p.memory_info_enabled);
2104 }
2105 static bool Read(const Message* m, void** iter, param_type* p) {
2106 return
2107 ReadParam(m, iter, &p->standard_font_family) &&
2108 ReadParam(m, iter, &p->fixed_font_family) &&
2109 ReadParam(m, iter, &p->serif_font_family) &&
2110 ReadParam(m, iter, &p->sans_serif_font_family) &&
2111 ReadParam(m, iter, &p->cursive_font_family) &&
2112 ReadParam(m, iter, &p->fantasy_font_family) &&
2113 ReadParam(m, iter, &p->default_font_size) &&
2114 ReadParam(m, iter, &p->default_fixed_font_size) &&
2115 ReadParam(m, iter, &p->minimum_font_size) &&
2116 ReadParam(m, iter, &p->minimum_logical_font_size) &&
2117 ReadParam(m, iter, &p->default_encoding) &&
2118 ReadParam(m, iter, &p->javascript_enabled) &&
2119 ReadParam(m, iter, &p->web_security_enabled) &&
2120 ReadParam(m, iter, &p->javascript_can_open_windows_automatically) &&
2121 ReadParam(m, iter, &p->loads_images_automatically) &&
2122 ReadParam(m, iter, &p->plugins_enabled) &&
2123 ReadParam(m, iter, &p->dom_paste_enabled) &&
2124 ReadParam(m, iter, &p->developer_extras_enabled) &&
2125 ReadParam(m, iter, &p->inspector_settings) &&
2126 ReadParam(m, iter, &p->site_specific_quirks_enabled) &&
2127 ReadParam(m, iter, &p->shrinks_standalone_images_to_fit) &&
2128 ReadParam(m, iter, &p->uses_universal_detector) &&
2129 ReadParam(m, iter, &p->text_areas_are_resizable) &&
2130 ReadParam(m, iter, &p->java_enabled) &&
2131 ReadParam(m, iter, &p->allow_scripts_to_close_windows) &&
2132 ReadParam(m, iter, &p->uses_page_cache) &&
2133 ReadParam(m, iter, &p->remote_fonts_enabled) &&
2134 ReadParam(m, iter, &p->javascript_can_access_clipboard) &&
2135 ReadParam(m, iter, &p->xss_auditor_enabled) &&
2136 ReadParam(m, iter, &p->local_storage_enabled) &&
2137 ReadParam(m, iter, &p->databases_enabled) &&
2138 ReadParam(m, iter, &p->application_cache_enabled) &&
2139 ReadParam(m, iter, &p->tabs_to_links) &&
2140 ReadParam(m, iter, &p->user_style_sheet_enabled) &&
2141 ReadParam(m, iter, &p->user_style_sheet_location) &&
2142 ReadParam(m, iter, &p->author_and_user_styles_enabled) &&
2143 ReadParam(m, iter, &p->allow_universal_access_from_file_urls) &&
2144 ReadParam(m, iter, &p->allow_file_access_from_file_urls) &&
2145 ReadParam(m, iter, &p->experimental_webgl_enabled) &&
2146 ReadParam(m, iter, &p->show_composited_layer_borders) &&
2147 ReadParam(m, iter, &p->accelerated_compositing_enabled) &&
2148 ReadParam(m, iter, &p->accelerated_2d_canvas_enabled) &&
2149 ReadParam(m, iter, &p->memory_info_enabled);
2150 }
2151 static void Log(const param_type& p, std::wstring* l) {
2152 l->append(L"<WebPreferences>");
2153 }
1653 }; 2154 };
1654 2155
1655 // Traits for WebDropData 2156 // Traits for WebDropData
1656 template <> 2157 template <>
1657 struct ParamTraits<WebDropData> { 2158 struct ParamTraits<WebDropData> {
1658 typedef WebDropData param_type; 2159 typedef WebDropData param_type;
1659 static void Write(Message* m, const param_type& p); 2160 static void Write(Message* m, const param_type& p) {
1660 static bool Read(const Message* m, void** iter, param_type* p); 2161 WriteParam(m, p.identity);
1661 static void Log(const param_type& p, std::wstring* l); 2162 WriteParam(m, p.url);
2163 WriteParam(m, p.url_title);
2164 WriteParam(m, p.download_metadata);
2165 WriteParam(m, p.file_extension);
2166 WriteParam(m, p.filenames);
2167 WriteParam(m, p.plain_text);
2168 WriteParam(m, p.text_html);
2169 WriteParam(m, p.html_base_url);
2170 WriteParam(m, p.file_description_filename);
2171 WriteParam(m, p.file_contents);
2172 }
2173 static bool Read(const Message* m, void** iter, param_type* p) {
2174 return
2175 ReadParam(m, iter, &p->identity) &&
2176 ReadParam(m, iter, &p->url) &&
2177 ReadParam(m, iter, &p->url_title) &&
2178 ReadParam(m, iter, &p->download_metadata) &&
2179 ReadParam(m, iter, &p->file_extension) &&
2180 ReadParam(m, iter, &p->filenames) &&
2181 ReadParam(m, iter, &p->plain_text) &&
2182 ReadParam(m, iter, &p->text_html) &&
2183 ReadParam(m, iter, &p->html_base_url) &&
2184 ReadParam(m, iter, &p->file_description_filename) &&
2185 ReadParam(m, iter, &p->file_contents);
2186 }
2187 static void Log(const param_type& p, std::wstring* l) {
2188 l->append(L"<WebDropData>");
2189 }
1662 }; 2190 };
1663 2191
1664 // Traits for AudioManager::Format. 2192 // Traits for AudioManager::Format.
1665 template <> 2193 template <>
1666 struct ParamTraits<AudioManager::Format> { 2194 struct ParamTraits<AudioManager::Format> {
1667 typedef AudioManager::Format param_type; 2195 typedef AudioManager::Format param_type;
1668 static void Write(Message* m, const param_type& p) { 2196 static void Write(Message* m, const param_type& p) {
1669 m->WriteInt(p); 2197 m->WriteInt(p);
1670 } 2198 }
1671 static bool Read(const Message* m, void** iter, param_type* p) { 2199 static bool Read(const Message* m, void** iter, param_type* p) {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 2585
2058 template <> 2586 template <>
2059 struct SimilarTypeTraits<ViewType::Type> { 2587 struct SimilarTypeTraits<ViewType::Type> {
2060 typedef int Type; 2588 typedef int Type;
2061 }; 2589 };
2062 2590
2063 // Traits for URLPattern. 2591 // Traits for URLPattern.
2064 template <> 2592 template <>
2065 struct ParamTraits<URLPattern> { 2593 struct ParamTraits<URLPattern> {
2066 typedef URLPattern param_type; 2594 typedef URLPattern param_type;
2067 static void Write(Message* m, const param_type& p); 2595 static void Write(Message* m, const param_type& p) {
2068 static bool Read(const Message* m, void** iter, param_type* p); 2596 WriteParam(m, p.valid_schemes());
2069 static void Log(const param_type& p, std::wstring* l); 2597 WriteParam(m, p.GetAsString());
2598 }
2599 static bool Read(const Message* m, void** iter, param_type* p) {
2600 int valid_schemes;
2601 std::string spec;
2602 if (!ReadParam(m, iter, &valid_schemes) ||
2603 !ReadParam(m, iter, &spec))
2604 return false;
2605
2606 p->set_valid_schemes(valid_schemes);
2607 return p->Parse(spec);
2608 }
2609 static void Log(const param_type& p, std::wstring* l) {
2610 LogParam(p.GetAsString(), l);
2611 }
2070 }; 2612 };
2071 2613
2072 template <> 2614 template <>
2073 struct ParamTraits<Clipboard::Buffer> { 2615 struct ParamTraits<Clipboard::Buffer> {
2074 typedef Clipboard::Buffer param_type; 2616 typedef Clipboard::Buffer param_type;
2075 static void Write(Message* m, const param_type& p) { 2617 static void Write(Message* m, const param_type& p) {
2076 m->WriteInt(p); 2618 m->WriteInt(p);
2077 } 2619 }
2078 static bool Read(const Message* m, void** iter, param_type* p) { 2620 static bool Read(const Message* m, void** iter, param_type* p) {
2079 int buffer; 2621 int buffer;
(...skipping 22 matching lines...) Expand all
2102 } 2644 }
2103 2645
2104 LogParam(type, l); 2646 LogParam(type, l);
2105 } 2647 }
2106 }; 2648 };
2107 2649
2108 // Traits for EditCommand structure. 2650 // Traits for EditCommand structure.
2109 template <> 2651 template <>
2110 struct ParamTraits<EditCommand> { 2652 struct ParamTraits<EditCommand> {
2111 typedef EditCommand param_type; 2653 typedef EditCommand param_type;
2112 static void Write(Message* m, const param_type& p); 2654 static void Write(Message* m, const param_type& p) {
2113 static bool Read(const Message* m, void** iter, param_type* p); 2655 WriteParam(m, p.name);
2114 static void Log(const param_type& p, std::wstring* l); 2656 WriteParam(m, p.value);
2657 }
2658 static bool Read(const Message* m, void** iter, param_type* p) {
2659 return ReadParam(m, iter, &p->name) && ReadParam(m, iter, &p->value);
2660 }
2661 static void Log(const param_type& p, std::wstring* l) {
2662 l->append(L"(");
2663 LogParam(p.name, l);
2664 l->append(L":");
2665 LogParam(p.value, l);
2666 l->append(L")");
2667 }
2115 }; 2668 };
2116 2669
2117 // Traits for DOMStorageType enum. 2670 // Traits for DOMStorageType enum.
2118 template <> 2671 template <>
2119 struct ParamTraits<DOMStorageType> { 2672 struct ParamTraits<DOMStorageType> {
2120 typedef DOMStorageType param_type; 2673 typedef DOMStorageType param_type;
2121 static void Write(Message* m, const param_type& p) { 2674 static void Write(Message* m, const param_type& p) {
2122 m->WriteInt(p); 2675 m->WriteInt(p);
2123 } 2676 }
2124 static bool Read(const Message* m, void** iter, param_type* p) { 2677 static bool Read(const Message* m, void** iter, param_type* p) {
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
2452 l->append(L","); 3005 l->append(L",");
2453 LogParam(p.notification_id, l); 3006 LogParam(p.notification_id, l);
2454 l->append(L")"); 3007 l->append(L")");
2455 } 3008 }
2456 }; 3009 };
2457 3010
2458 // Traits for WebCookie 3011 // Traits for WebCookie
2459 template <> 3012 template <>
2460 struct ParamTraits<webkit_glue::WebCookie> { 3013 struct ParamTraits<webkit_glue::WebCookie> {
2461 typedef webkit_glue::WebCookie param_type; 3014 typedef webkit_glue::WebCookie param_type;
2462 static void Write(Message* m, const param_type& p); 3015 static void Write(Message* m, const param_type& p) {
2463 static bool Read(const Message* m, void** iter, param_type* p); 3016 WriteParam(m, p.name);
2464 static void Log(const param_type& p, std::wstring* l); 3017 WriteParam(m, p.value);
3018 WriteParam(m, p.domain);
3019 WriteParam(m, p.path);
3020 WriteParam(m, p.expires);
3021 WriteParam(m, p.http_only);
3022 WriteParam(m, p.secure);
3023 WriteParam(m, p.session);
3024 }
3025 static bool Read(const Message* m, void** iter, param_type* p) {
3026 return
3027 ReadParam(m, iter, &p->name) &&
3028 ReadParam(m, iter, &p->value) &&
3029 ReadParam(m, iter, &p->domain) &&
3030 ReadParam(m, iter, &p->path) &&
3031 ReadParam(m, iter, &p->expires) &&
3032 ReadParam(m, iter, &p->http_only) &&
3033 ReadParam(m, iter, &p->secure) &&
3034 ReadParam(m, iter, &p->session);
3035 }
3036 static void Log(const param_type& p, std::wstring* l) {
3037 l->append(L"<WebCookie>");
3038 }
2465 }; 3039 };
2466 3040
2467 template<> 3041 template<>
2468 struct ParamTraits<ViewMsg_ExecuteCode_Params> { 3042 struct ParamTraits<ViewMsg_ExecuteCode_Params> {
2469 typedef ViewMsg_ExecuteCode_Params param_type; 3043 typedef ViewMsg_ExecuteCode_Params param_type;
2470 static void Write(Message* m, const param_type& p) { 3044 static void Write(Message* m, const param_type& p) {
2471 WriteParam(m, p.request_id); 3045 WriteParam(m, p.request_id);
2472 WriteParam(m, p.extension_id); 3046 WriteParam(m, p.extension_id);
2473 WriteParam(m, p.host_permissions); 3047 WriteParam(m, p.host_permissions);
2474 WriteParam(m, p.is_javascript); 3048 WriteParam(m, p.is_javascript);
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
2602 LogParam(p.session_storage_namespace_id, l); 3176 LogParam(p.session_storage_namespace_id, l);
2603 l->append(L", "); 3177 l->append(L", ");
2604 LogParam(p.frame_name, l); 3178 LogParam(p.frame_name, l);
2605 l->append(L")"); 3179 l->append(L")");
2606 } 3180 }
2607 }; 3181 };
2608 3182
2609 template <> 3183 template <>
2610 struct ParamTraits<ExtensionExtent> { 3184 struct ParamTraits<ExtensionExtent> {
2611 typedef ExtensionExtent param_type; 3185 typedef ExtensionExtent param_type;
2612 static void Write(Message* m, const param_type& p); 3186 static void Write(Message* m, const param_type& p) {
2613 static bool Read(const Message* m, void** iter, param_type* p); 3187 WriteParam(m, p.patterns());
2614 static void Log(const param_type& p, std::wstring* l); 3188 }
3189 static bool Read(const Message* m, void** iter, param_type* p) {
3190 std::vector<URLPattern> patterns;
3191 bool success =
3192 ReadParam(m, iter, &patterns);
3193 if (!success)
3194 return false;
3195
3196 for (size_t i = 0; i < patterns.size(); ++i)
3197 p->AddPattern(patterns[i]);
3198 return true;
3199 }
3200 static void Log(const param_type& p, std::wstring* l) {
3201 LogParam(p.patterns(), l);
3202 }
2615 }; 3203 };
2616 3204
2617 template <> 3205 template <>
2618 struct ParamTraits<ViewMsg_ExtensionExtentInfo> { 3206 struct ParamTraits<ViewMsg_ExtensionExtentInfo> {
2619 typedef ViewMsg_ExtensionExtentInfo param_type; 3207 typedef ViewMsg_ExtensionExtentInfo param_type;
2620 static void Write(Message* m, const param_type& p) { 3208 static void Write(Message* m, const param_type& p) {
2621 WriteParam(m, p.extension_id); 3209 WriteParam(m, p.extension_id);
2622 WriteParam(m, p.web_extent); 3210 WriteParam(m, p.web_extent);
2623 WriteParam(m, p.browse_extent); 3211 WriteParam(m, p.browse_extent);
2624 } 3212 }
(...skipping 17 matching lines...) Expand all
2642 return ReadParam(m, iter, &p->extension_apps); 3230 return ReadParam(m, iter, &p->extension_apps);
2643 } 3231 }
2644 static void Log(const param_type& p, std::wstring* l) { 3232 static void Log(const param_type& p, std::wstring* l) {
2645 LogParam(p.extension_apps, l); 3233 LogParam(p.extension_apps, l);
2646 } 3234 }
2647 }; 3235 };
2648 3236
2649 template<> 3237 template<>
2650 struct ParamTraits<appcache::AppCacheResourceInfo> { 3238 struct ParamTraits<appcache::AppCacheResourceInfo> {
2651 typedef appcache::AppCacheResourceInfo param_type; 3239 typedef appcache::AppCacheResourceInfo param_type;
2652 static void Write(Message* m, const param_type& p); 3240 static void Write(Message* m, const param_type& p) {
2653 static bool Read(const Message* m, void** iter, param_type* p); 3241 WriteParam(m, p.url);
2654 static void Log(const param_type& p, std::wstring* l); 3242 WriteParam(m, p.size);
3243 WriteParam(m, p.is_manifest);
3244 WriteParam(m, p.is_master);
3245 WriteParam(m, p.is_fallback);
3246 WriteParam(m, p.is_foreign);
3247 WriteParam(m, p.is_explicit);
3248 }
3249 static bool Read(const Message* m, void** iter, param_type* p) {
3250 return ReadParam(m, iter, &p->url) &&
3251 ReadParam(m, iter, &p->size) &&
3252 ReadParam(m, iter, &p->is_manifest) &&
3253 ReadParam(m, iter, &p->is_master) &&
3254 ReadParam(m, iter, &p->is_fallback) &&
3255 ReadParam(m, iter, &p->is_foreign) &&
3256 ReadParam(m, iter, &p->is_explicit);
3257 }
3258 static void Log(const param_type& p, std::wstring* l) {
3259 l->append(L"(");
3260 LogParam(p.url, l);
3261 l->append(L", ");
3262 LogParam(p.size, l);
3263 l->append(L", ");
3264 LogParam(p.is_manifest, l);
3265 l->append(L", ");
3266 LogParam(p.is_master, l);
3267 l->append(L", ");
3268 LogParam(p.is_fallback, l);
3269 l->append(L", ");
3270 LogParam(p.is_foreign, l);
3271 l->append(L", ");
3272 LogParam(p.is_explicit, l);
3273 l->append(L")");
3274 }
2655 }; 3275 };
2656 3276
2657 template <> 3277 template <>
2658 struct ParamTraits<appcache::AppCacheInfo> { 3278 struct ParamTraits<appcache::AppCacheInfo> {
2659 typedef appcache::AppCacheInfo param_type; 3279 typedef appcache::AppCacheInfo param_type;
2660 static void Write(Message* m, const param_type& p); 3280 static void Write(Message* m, const param_type& p) {
2661 static bool Read(const Message* m, void** iter, param_type* p); 3281 WriteParam(m, p.manifest_url);
2662 static void Log(const param_type& p, std::wstring* l); 3282 WriteParam(m, p.creation_time);
2663 }; 3283 WriteParam(m, p.last_update_time);
3284 WriteParam(m, p.last_access_time);
3285 WriteParam(m, p.cache_id);
3286 WriteParam(m, p.status);
3287 WriteParam(m, p.size);
3288 WriteParam(m, p.is_complete);
3289 }
3290 static bool Read(const Message* m, void** iter, param_type* p) {
3291 return ReadParam(m, iter, &p->manifest_url) &&
3292 ReadParam(m, iter, &p->creation_time) &&
3293 ReadParam(m, iter, &p->last_update_time) &&
3294 ReadParam(m, iter, &p->last_access_time) &&
3295 ReadParam(m, iter, &p->cache_id) &&
3296 ReadParam(m, iter, &p->status) &&
3297 ReadParam(m, iter, &p->size) &&
3298 ReadParam(m, iter, &p->is_complete);
3299 }
3300 static void Log(const param_type& p, std::wstring* l) {
3301 l->append(L"(");
3302 LogParam(p.manifest_url, l);
3303 l->append(L", ");
3304 LogParam(p.creation_time, l);
3305 l->append(L", ");
3306 LogParam(p.last_update_time, l);
3307 l->append(L", ");
3308 LogParam(p.last_access_time, l);
3309 l->append(L", ");
3310 LogParam(p.cache_id, l);
3311 l->append(L", ");
3312 LogParam(p.status, l);
3313 l->append(L", ");
3314 LogParam(p.size, l);
3315 l->append(L")");
3316 LogParam(p.is_complete, l);
3317 l->append(L", ");
3318 }
3319 };
2664 3320
2665 template <> 3321 template <>
2666 struct ParamTraits<WindowContainerType> { 3322 struct ParamTraits<WindowContainerType> {
2667 typedef WindowContainerType param_type; 3323 typedef WindowContainerType param_type;
2668 static void Write(Message* m, const param_type& p) { 3324 static void Write(Message* m, const param_type& p) {
2669 int val = static_cast<int>(p); 3325 int val = static_cast<int>(p);
2670 WriteParam(m, val); 3326 WriteParam(m, val);
2671 } 3327 }
2672 static bool Read(const Message* m, void** iter, param_type* p) { 3328 static bool Read(const Message* m, void** iter, param_type* p) {
2673 int val = 0; 3329 int val = 0;
2674 if (!ReadParam(m, iter, &val) || 3330 if (!ReadParam(m, iter, &val) ||
2675 val < WINDOW_CONTAINER_TYPE_NORMAL || 3331 val < WINDOW_CONTAINER_TYPE_NORMAL ||
2676 val >= WINDOW_CONTAINER_TYPE_MAX_VALUE) 3332 val >= WINDOW_CONTAINER_TYPE_MAX_VALUE)
2677 return false; 3333 return false;
2678 *p = static_cast<param_type>(val); 3334 *p = static_cast<param_type>(val);
2679 return true; 3335 return true;
2680 } 3336 }
2681 static void Log(const param_type& p, std::wstring* l) { 3337 static void Log(const param_type& p, std::wstring* l) {
2682 ParamTraits<int>::Log(static_cast<int>(p), l); 3338 LogParam(p, l);
2683 } 3339 }
2684 }; 3340 };
2685 3341
2686 template <> 3342 template <>
2687 struct ParamTraits<webkit_glue::WebAccessibility> { 3343 struct ParamTraits<webkit_glue::WebAccessibility> {
2688 typedef webkit_glue::WebAccessibility param_type; 3344 typedef webkit_glue::WebAccessibility param_type;
2689 static void Write(Message* m, const param_type& p); 3345 static void Write(Message* m, const param_type& p) {
2690 static bool Read(const Message* m, void** iter, param_type* p); 3346 WriteParam(m, p.id);
2691 static void Log(const param_type& p, std::wstring* l); 3347 WriteParam(m, p.name);
3348 WriteParam(m, p.value);
3349 WriteParam(m, static_cast<int>(p.role));
3350 WriteParam(m, static_cast<int>(p.state));
3351 WriteParam(m, p.location);
3352 WriteParam(m, p.attributes);
3353 WriteParam(m, p.children);
3354 }
3355 static bool Read(const Message* m, void** iter, param_type* p) {
3356 bool ret = ReadParam(m, iter, &p->id);
3357 ret = ret && ReadParam(m, iter, &p->name);
3358 ret = ret && ReadParam(m, iter, &p->value);
3359 int role = -1;
3360 ret = ret && ReadParam(m, iter, &role);
3361 if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
3362 role < webkit_glue::WebAccessibility::NUM_ROLES) {
3363 p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
3364 } else {
3365 p->role = webkit_glue::WebAccessibility::ROLE_NONE;
3366 }
3367 int state = 0;
3368 ret = ret && ReadParam(m, iter, &state);
3369 p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
3370 ret = ret && ReadParam(m, iter, &p->location);
3371 ret = ret && ReadParam(m, iter, &p->attributes);
3372 ret = ret && ReadParam(m, iter, &p->children);
3373 return ret;
3374 }
3375 static void Log(const param_type& p, std::wstring* l) {
3376 l->append(L"(");
3377 LogParam(p.id, l);
3378 l->append(L", ");
3379 LogParam(p.name, l);
3380 l->append(L", ");
3381 LogParam(p.value, l);
3382 l->append(L", ");
3383 LogParam(static_cast<int>(p.role), l);
3384 l->append(L", ");
3385 LogParam(static_cast<int>(p.state), l);
3386 l->append(L", ");
3387 LogParam(p.location, l);
3388 l->append(L", ");
3389 LogParam(p.attributes, l);
3390 l->append(L", ");
3391 LogParam(p.children, l);
3392 l->append(L")");
3393 }
2692 }; 3394 };
2693 3395
2694 // Traits for ViewMsg_DeviceOrientationUpdated_Params 3396 // Traits for ViewMsg_DeviceOrientationUpdated_Params
2695 // structure to pack/unpack. 3397 // structure to pack/unpack.
2696 template <> 3398 template <>
2697 struct ParamTraits<ViewMsg_DeviceOrientationUpdated_Params> { 3399 struct ParamTraits<ViewMsg_DeviceOrientationUpdated_Params> {
2698 typedef ViewMsg_DeviceOrientationUpdated_Params param_type; 3400 typedef ViewMsg_DeviceOrientationUpdated_Params param_type;
2699 static void Write(Message* m, const param_type& p) { 3401 static void Write(Message* m, const param_type& p) {
2700 WriteParam(m, p.can_provide_alpha); 3402 WriteParam(m, p.can_provide_alpha);
2701 WriteParam(m, p.alpha); 3403 WriteParam(m, p.alpha);
(...skipping 26 matching lines...) Expand all
2728 LogParam(p.gamma, l); 3430 LogParam(p.gamma, l);
2729 l->append(L")"); 3431 l->append(L")");
2730 } 3432 }
2731 }; 3433 };
2732 } // namespace IPC 3434 } // namespace IPC
2733 3435
2734 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 3436 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
2735 #include "ipc/ipc_message_macros.h" 3437 #include "ipc/ipc_message_macros.h"
2736 3438
2737 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 3439 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW
« no previous file with comments | « chrome/common/plugin_messages.cc ('k') | chrome/common/render_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698