| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // Process ID of process that originated this request. | 259 // Process ID of process that originated this request. |
| 260 int origin_pid; | 260 int origin_pid; |
| 261 | 261 |
| 262 // What this resource load is for (main frame, sub-frame, sub-resource, | 262 // What this resource load is for (main frame, sub-frame, sub-resource, |
| 263 // object). | 263 // object). |
| 264 ResourceType::Type resource_type; | 264 ResourceType::Type resource_type; |
| 265 | 265 |
| 266 // Used by plugin->browser requests to get the correct URLRequestContext. | 266 // Used by plugin->browser requests to get the correct URLRequestContext. |
| 267 uint32 request_context; | 267 uint32 request_context; |
| 268 | 268 |
| 269 // Optional upload data (may be empty). | 269 // Optional upload data (may be null). |
| 270 std::vector<net::UploadData::Element> upload_content; | 270 scoped_refptr<net::UploadData> upload_data; |
| 271 }; | 271 }; |
| 272 | 272 |
| 273 // Parameters for a render request. | 273 // Parameters for a render request. |
| 274 struct ViewMsg_Print_Params { | 274 struct ViewMsg_Print_Params { |
| 275 // In pixels according to dpi_x and dpi_y. | 275 // In pixels according to dpi_x and dpi_y. |
| 276 gfx::Size printable_size; | 276 gfx::Size printable_size; |
| 277 | 277 |
| 278 // Specifies dots per inch. | 278 // Specifies dots per inch. |
| 279 double dpi; | 279 double dpi; |
| 280 | 280 |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1154 return false; | 1154 return false; |
| 1155 r->SetToFilePathRange(file_path, offset, length); | 1155 r->SetToFilePathRange(file_path, offset, length); |
| 1156 } | 1156 } |
| 1157 return true; | 1157 return true; |
| 1158 } | 1158 } |
| 1159 static void Log(const param_type& p, std::wstring* l) { | 1159 static void Log(const param_type& p, std::wstring* l) { |
| 1160 l->append(L"<net::UploadData::Element>"); | 1160 l->append(L"<net::UploadData::Element>"); |
| 1161 } | 1161 } |
| 1162 }; | 1162 }; |
| 1163 | 1163 |
| 1164 // Traits for net::UploadData. |
| 1165 template <> |
| 1166 struct ParamTraits<scoped_refptr<net::UploadData> > { |
| 1167 typedef scoped_refptr<net::UploadData> param_type; |
| 1168 static void Write(Message* m, const param_type& p) { |
| 1169 WriteParam(m, p.get() != NULL); |
| 1170 if (p) { |
| 1171 WriteParam(m, p->elements()); |
| 1172 WriteParam(m, p->identifier()); |
| 1173 } |
| 1174 } |
| 1175 static bool Read(const Message* m, void** iter, param_type* r) { |
| 1176 bool has_object; |
| 1177 if (!ReadParam(m, iter, &has_object)) |
| 1178 return false; |
| 1179 if (!has_object) |
| 1180 return true; |
| 1181 std::vector<net::UploadData::Element> elements; |
| 1182 if (!ReadParam(m, iter, &elements)) |
| 1183 return false; |
| 1184 int identifier; |
| 1185 if (!ReadParam(m, iter, &identifier)) |
| 1186 return false; |
| 1187 *r = new net::UploadData; |
| 1188 (*r)->swap_elements(&elements); |
| 1189 (*r)->set_identifier(identifier); |
| 1190 return true; |
| 1191 } |
| 1192 static void Log(const param_type& p, std::wstring* l) { |
| 1193 l->append(L"<net::UploadData>"); |
| 1194 } |
| 1195 }; |
| 1196 |
| 1164 // Traits for WebKit::WebCache::UsageStats | 1197 // Traits for WebKit::WebCache::UsageStats |
| 1165 template <> | 1198 template <> |
| 1166 struct ParamTraits<WebKit::WebCache::UsageStats> { | 1199 struct ParamTraits<WebKit::WebCache::UsageStats> { |
| 1167 typedef WebKit::WebCache::UsageStats param_type; | 1200 typedef WebKit::WebCache::UsageStats param_type; |
| 1168 static void Write(Message* m, const param_type& p) { | 1201 static void Write(Message* m, const param_type& p) { |
| 1169 WriteParam(m, p.minDeadCapacity); | 1202 WriteParam(m, p.minDeadCapacity); |
| 1170 WriteParam(m, p.maxDeadCapacity); | 1203 WriteParam(m, p.maxDeadCapacity); |
| 1171 WriteParam(m, p.capacity); | 1204 WriteParam(m, p.capacity); |
| 1172 WriteParam(m, p.liveSize); | 1205 WriteParam(m, p.liveSize); |
| 1173 WriteParam(m, p.deadSize); | 1206 WriteParam(m, p.deadSize); |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1297 WriteParam(m, p.url); | 1330 WriteParam(m, p.url); |
| 1298 WriteParam(m, p.policy_url); | 1331 WriteParam(m, p.policy_url); |
| 1299 WriteParam(m, p.referrer); | 1332 WriteParam(m, p.referrer); |
| 1300 WriteParam(m, p.frame_origin); | 1333 WriteParam(m, p.frame_origin); |
| 1301 WriteParam(m, p.main_frame_origin); | 1334 WriteParam(m, p.main_frame_origin); |
| 1302 WriteParam(m, p.headers); | 1335 WriteParam(m, p.headers); |
| 1303 WriteParam(m, p.load_flags); | 1336 WriteParam(m, p.load_flags); |
| 1304 WriteParam(m, p.origin_pid); | 1337 WriteParam(m, p.origin_pid); |
| 1305 WriteParam(m, p.resource_type); | 1338 WriteParam(m, p.resource_type); |
| 1306 WriteParam(m, p.request_context); | 1339 WriteParam(m, p.request_context); |
| 1307 WriteParam(m, p.upload_content); | 1340 WriteParam(m, p.upload_data); |
| 1308 } | 1341 } |
| 1309 static bool Read(const Message* m, void** iter, param_type* r) { | 1342 static bool Read(const Message* m, void** iter, param_type* r) { |
| 1310 return | 1343 return |
| 1311 ReadParam(m, iter, &r->method) && | 1344 ReadParam(m, iter, &r->method) && |
| 1312 ReadParam(m, iter, &r->url) && | 1345 ReadParam(m, iter, &r->url) && |
| 1313 ReadParam(m, iter, &r->policy_url) && | 1346 ReadParam(m, iter, &r->policy_url) && |
| 1314 ReadParam(m, iter, &r->referrer) && | 1347 ReadParam(m, iter, &r->referrer) && |
| 1315 ReadParam(m, iter, &r->frame_origin) && | 1348 ReadParam(m, iter, &r->frame_origin) && |
| 1316 ReadParam(m, iter, &r->main_frame_origin) && | 1349 ReadParam(m, iter, &r->main_frame_origin) && |
| 1317 ReadParam(m, iter, &r->headers) && | 1350 ReadParam(m, iter, &r->headers) && |
| 1318 ReadParam(m, iter, &r->load_flags) && | 1351 ReadParam(m, iter, &r->load_flags) && |
| 1319 ReadParam(m, iter, &r->origin_pid) && | 1352 ReadParam(m, iter, &r->origin_pid) && |
| 1320 ReadParam(m, iter, &r->resource_type) && | 1353 ReadParam(m, iter, &r->resource_type) && |
| 1321 ReadParam(m, iter, &r->request_context) && | 1354 ReadParam(m, iter, &r->request_context) && |
| 1322 ReadParam(m, iter, &r->upload_content); | 1355 ReadParam(m, iter, &r->upload_data); |
| 1323 } | 1356 } |
| 1324 static void Log(const param_type& p, std::wstring* l) { | 1357 static void Log(const param_type& p, std::wstring* l) { |
| 1325 l->append(L"("); | 1358 l->append(L"("); |
| 1326 LogParam(p.method, l); | 1359 LogParam(p.method, l); |
| 1327 l->append(L", "); | 1360 l->append(L", "); |
| 1328 LogParam(p.url, l); | 1361 LogParam(p.url, l); |
| 1329 l->append(L", "); | 1362 l->append(L", "); |
| 1330 LogParam(p.referrer, l); | 1363 LogParam(p.referrer, l); |
| 1331 l->append(L", "); | 1364 l->append(L", "); |
| 1332 LogParam(p.frame_origin, l); | 1365 LogParam(p.frame_origin, l); |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1882 } | 1915 } |
| 1883 }; | 1916 }; |
| 1884 | 1917 |
| 1885 } // namespace IPC | 1918 } // namespace IPC |
| 1886 | 1919 |
| 1887 | 1920 |
| 1888 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" | 1921 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" |
| 1889 #include "chrome/common/ipc_message_macros.h" | 1922 #include "chrome/common/ipc_message_macros.h" |
| 1890 | 1923 |
| 1891 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ | 1924 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ |
| OLD | NEW |