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

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

Issue 9712: AppCachePlumbing (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
OLDNEW
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 15 matching lines...) Expand all
26 #include "net/http/http_response_headers.h" 26 #include "net/http/http_response_headers.h"
27 #include "net/url_request/url_request_status.h" 27 #include "net/url_request/url_request_status.h"
28 #include "webkit/glue/autofill_form.h" 28 #include "webkit/glue/autofill_form.h"
29 #include "webkit/glue/context_menu.h" 29 #include "webkit/glue/context_menu.h"
30 #include "webkit/glue/feed.h" 30 #include "webkit/glue/feed.h"
31 #include "webkit/glue/form_data.h" 31 #include "webkit/glue/form_data.h"
32 #include "webkit/glue/password_form.h" 32 #include "webkit/glue/password_form.h"
33 #include "webkit/glue/password_form_dom_manager.h" 33 #include "webkit/glue/password_form_dom_manager.h"
34 #include "webkit/glue/resource_loader_bridge.h" 34 #include "webkit/glue/resource_loader_bridge.h"
35 #include "webkit/glue/webaccessibility.h" 35 #include "webkit/glue/webaccessibility.h"
36 #include "webkit/glue/webappcachecontext.h"
36 #include "webkit/glue/webdropdata.h" 37 #include "webkit/glue/webdropdata.h"
37 #include "webkit/glue/webplugin.h" 38 #include "webkit/glue/webplugin.h"
38 #include "webkit/glue/webpreferences.h" 39 #include "webkit/glue/webpreferences.h"
39 #include "webkit/glue/webview_delegate.h" 40 #include "webkit/glue/webview_delegate.h"
40 41
41 #if defined(OS_POSIX) 42 #if defined(OS_POSIX)
42 #include "skia/include/SkBitmap.h" 43 #include "skia/include/SkBitmap.h"
43 #endif 44 #endif
44 45
45 namespace base { 46 namespace base {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // Process ID of process that originated this request. 269 // Process ID of process that originated this request.
269 int origin_pid; 270 int origin_pid;
270 271
271 // What this resource load is for (main frame, sub-frame, sub-resource, 272 // What this resource load is for (main frame, sub-frame, sub-resource,
272 // object). 273 // object).
273 ResourceType::Type resource_type; 274 ResourceType::Type resource_type;
274 275
275 // Used by plugin->browser requests to get the correct URLRequestContext. 276 // Used by plugin->browser requests to get the correct URLRequestContext.
276 uint32 request_context; 277 uint32 request_context;
277 278
279 // Indicates which frame (or worker context) the request is being loaded into,
280 // or kNoAppCacheContextId.
281 int32 app_cache_context_id;
282
278 // Optional upload data (may be null). 283 // Optional upload data (may be null).
279 scoped_refptr<net::UploadData> upload_data; 284 scoped_refptr<net::UploadData> upload_data;
280 }; 285 };
281 286
282 // Parameters for a render request. 287 // Parameters for a render request.
283 struct ViewMsg_Print_Params { 288 struct ViewMsg_Print_Params {
284 // In pixels according to dpi_x and dpi_y. 289 // In pixels according to dpi_x and dpi_y.
285 gfx::Size printable_size; 290 gfx::Size printable_size;
286 291
287 // Specifies dots per inch. 292 // Specifies dots per inch.
(...skipping 927 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 WriteParam(m, p.policy_url); 1220 WriteParam(m, p.policy_url);
1216 WriteParam(m, p.referrer); 1221 WriteParam(m, p.referrer);
1217 WriteParam(m, p.frame_origin); 1222 WriteParam(m, p.frame_origin);
1218 WriteParam(m, p.main_frame_origin); 1223 WriteParam(m, p.main_frame_origin);
1219 WriteParam(m, p.headers); 1224 WriteParam(m, p.headers);
1220 WriteParam(m, p.default_mime_type); 1225 WriteParam(m, p.default_mime_type);
1221 WriteParam(m, p.load_flags); 1226 WriteParam(m, p.load_flags);
1222 WriteParam(m, p.origin_pid); 1227 WriteParam(m, p.origin_pid);
1223 WriteParam(m, p.resource_type); 1228 WriteParam(m, p.resource_type);
1224 WriteParam(m, p.request_context); 1229 WriteParam(m, p.request_context);
1230 WriteParam(m, p.app_cache_context_id);
1225 WriteParam(m, p.upload_data); 1231 WriteParam(m, p.upload_data);
1226 } 1232 }
1227 static bool Read(const Message* m, void** iter, param_type* r) { 1233 static bool Read(const Message* m, void** iter, param_type* r) {
1228 return 1234 return
1229 ReadParam(m, iter, &r->method) && 1235 ReadParam(m, iter, &r->method) &&
1230 ReadParam(m, iter, &r->url) && 1236 ReadParam(m, iter, &r->url) &&
1231 ReadParam(m, iter, &r->policy_url) && 1237 ReadParam(m, iter, &r->policy_url) &&
1232 ReadParam(m, iter, &r->referrer) && 1238 ReadParam(m, iter, &r->referrer) &&
1233 ReadParam(m, iter, &r->frame_origin) && 1239 ReadParam(m, iter, &r->frame_origin) &&
1234 ReadParam(m, iter, &r->main_frame_origin) && 1240 ReadParam(m, iter, &r->main_frame_origin) &&
1235 ReadParam(m, iter, &r->headers) && 1241 ReadParam(m, iter, &r->headers) &&
1236 ReadParam(m, iter, &r->default_mime_type) && 1242 ReadParam(m, iter, &r->default_mime_type) &&
1237 ReadParam(m, iter, &r->load_flags) && 1243 ReadParam(m, iter, &r->load_flags) &&
1238 ReadParam(m, iter, &r->origin_pid) && 1244 ReadParam(m, iter, &r->origin_pid) &&
1239 ReadParam(m, iter, &r->resource_type) && 1245 ReadParam(m, iter, &r->resource_type) &&
1240 ReadParam(m, iter, &r->request_context) && 1246 ReadParam(m, iter, &r->request_context) &&
1247 ReadParam(m, iter, &r->app_cache_context_id) &&
1241 ReadParam(m, iter, &r->upload_data); 1248 ReadParam(m, iter, &r->upload_data);
1242 } 1249 }
1243 static void Log(const param_type& p, std::wstring* l) { 1250 static void Log(const param_type& p, std::wstring* l) {
1244 l->append(L"("); 1251 l->append(L"(");
1245 LogParam(p.method, l); 1252 LogParam(p.method, l);
1246 l->append(L", "); 1253 l->append(L", ");
1247 LogParam(p.url, l); 1254 LogParam(p.url, l);
1248 l->append(L", "); 1255 l->append(L", ");
1249 LogParam(p.referrer, l); 1256 LogParam(p.referrer, l);
1250 l->append(L", "); 1257 l->append(L", ");
1251 LogParam(p.frame_origin, l); 1258 LogParam(p.frame_origin, l);
1252 l->append(L", "); 1259 l->append(L", ");
1253 LogParam(p.main_frame_origin, l); 1260 LogParam(p.main_frame_origin, l);
1254 l->append(L", "); 1261 l->append(L", ");
1255 LogParam(p.default_mime_type, l); 1262 LogParam(p.default_mime_type, l);
1256 l->append(L", "); 1263 l->append(L", ");
1257 LogParam(p.load_flags, l); 1264 LogParam(p.load_flags, l);
1258 l->append(L", "); 1265 l->append(L", ");
1259 LogParam(p.origin_pid, l); 1266 LogParam(p.origin_pid, l);
1260 l->append(L", "); 1267 l->append(L", ");
1261 LogParam(p.resource_type, l); 1268 LogParam(p.resource_type, l);
1262 l->append(L", "); 1269 l->append(L", ");
1263 LogParam(p.request_context, l); 1270 LogParam(p.request_context, l);
1271 l->append(L", ");
1272 LogParam(p.app_cache_context_id, l);
1264 l->append(L")"); 1273 l->append(L")");
1265 } 1274 }
1266 }; 1275 };
1267 1276
1268 // Traits for URLRequestStatus 1277 // Traits for URLRequestStatus
1269 template <> 1278 template <>
1270 struct ParamTraits<URLRequestStatus> { 1279 struct ParamTraits<URLRequestStatus> {
1271 typedef URLRequestStatus param_type; 1280 typedef URLRequestStatus param_type;
1272 static void Write(Message* m, const param_type& p) { 1281 static void Write(Message* m, const param_type& p) {
1273 WriteParam(m, static_cast<int>(p.status())); 1282 WriteParam(m, static_cast<int>(p.status()));
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { 1354 struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
1346 typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type; 1355 typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type;
1347 static void Write(Message* m, const param_type& p) { 1356 static void Write(Message* m, const param_type& p) {
1348 WriteParam(m, p.request_time); 1357 WriteParam(m, p.request_time);
1349 WriteParam(m, p.response_time); 1358 WriteParam(m, p.response_time);
1350 WriteParam(m, p.headers); 1359 WriteParam(m, p.headers);
1351 WriteParam(m, p.mime_type); 1360 WriteParam(m, p.mime_type);
1352 WriteParam(m, p.charset); 1361 WriteParam(m, p.charset);
1353 WriteParam(m, p.security_info); 1362 WriteParam(m, p.security_info);
1354 WriteParam(m, p.content_length); 1363 WriteParam(m, p.content_length);
1364 WriteParam(m, p.app_cache_id);
1355 WriteParam(m, p.response_data_file); 1365 WriteParam(m, p.response_data_file);
1356 } 1366 }
1357 static bool Read(const Message* m, void** iter, param_type* r) { 1367 static bool Read(const Message* m, void** iter, param_type* r) {
1358 return 1368 return
1359 ReadParam(m, iter, &r->request_time) && 1369 ReadParam(m, iter, &r->request_time) &&
1360 ReadParam(m, iter, &r->response_time) && 1370 ReadParam(m, iter, &r->response_time) &&
1361 ReadParam(m, iter, &r->headers) && 1371 ReadParam(m, iter, &r->headers) &&
1362 ReadParam(m, iter, &r->mime_type) && 1372 ReadParam(m, iter, &r->mime_type) &&
1363 ReadParam(m, iter, &r->charset) && 1373 ReadParam(m, iter, &r->charset) &&
1364 ReadParam(m, iter, &r->security_info) && 1374 ReadParam(m, iter, &r->security_info) &&
1365 ReadParam(m, iter, &r->content_length) && 1375 ReadParam(m, iter, &r->content_length) &&
1376 ReadParam(m, iter, &r->app_cache_id) &&
1366 ReadParam(m, iter, &r->response_data_file); 1377 ReadParam(m, iter, &r->response_data_file);
1367 } 1378 }
1368 static void Log(const param_type& p, std::wstring* l) { 1379 static void Log(const param_type& p, std::wstring* l) {
1369 l->append(L"("); 1380 l->append(L"(");
1370 LogParam(p.request_time, l); 1381 LogParam(p.request_time, l);
1371 l->append(L", "); 1382 l->append(L", ");
1372 LogParam(p.response_time, l); 1383 LogParam(p.response_time, l);
1373 l->append(L", "); 1384 l->append(L", ");
1374 LogParam(p.headers, l); 1385 LogParam(p.headers, l);
1375 l->append(L", "); 1386 l->append(L", ");
1376 LogParam(p.mime_type, l); 1387 LogParam(p.mime_type, l);
1377 l->append(L", "); 1388 l->append(L", ");
1378 LogParam(p.charset, l); 1389 LogParam(p.charset, l);
1379 l->append(L", "); 1390 l->append(L", ");
1380 LogParam(p.security_info, l); 1391 LogParam(p.security_info, l);
1392 l->append(L", ");
1393 LogParam(p.content_length, l);
1394 l->append(L", ");
1395 LogParam(p.app_cache_id, l);
1381 l->append(L")"); 1396 l->append(L")");
1382 } 1397 }
1383 }; 1398 };
1384 1399
1385 template <> 1400 template <>
1386 struct ParamTraits<ResourceResponseHead> { 1401 struct ParamTraits<ResourceResponseHead> {
1387 typedef ResourceResponseHead param_type; 1402 typedef ResourceResponseHead param_type;
1388 static void Write(Message* m, const param_type& p) { 1403 static void Write(Message* m, const param_type& p) {
1389 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p); 1404 ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p);
1390 WriteParam(m, p.status); 1405 WriteParam(m, p.status);
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1772 break; 1787 break;
1773 default: 1788 default:
1774 state = L"UNKNOWN"; 1789 state = L"UNKNOWN";
1775 break; 1790 break;
1776 } 1791 }
1777 1792
1778 LogParam(state, l); 1793 LogParam(state, l);
1779 } 1794 }
1780 }; 1795 };
1781 1796
1797 template <>
1798 struct ParamTraits<WebAppCacheContext::ContextType> {
1799 typedef WebAppCacheContext::ContextType param_type;
1800 static void Write(Message* m, const param_type& p) {
1801 m->WriteInt(static_cast<int>(p));
1802 }
1803 static bool Read(const Message* m, void** iter, param_type* p) {
1804 int type;
1805 if (!m->ReadInt(iter, &type))
1806 return false;
1807 *p = static_cast<param_type>(type);
1808 return true;
1809 }
1810 static void Log(const param_type& p, std::wstring* l) {
1811 std::wstring state;
1812 switch (p) {
1813 case WebAppCacheContext::MAIN_FRAME:
1814 state = L"MAIN_FRAME";
1815 break;
1816 case WebAppCacheContext::CHILD_FRAME:
1817 state = L"CHILD_FRAME";
1818 break;
1819 case WebAppCacheContext::DEDICATED_WORKER:
1820 state = L"DECICATED_WORKER";
1821 break;
1822 default:
1823 state = L"UNKNOWN";
1824 break;
1825 }
1826
1827 LogParam(state, l);
1828 }
1829 };
1830
1782 } // namespace IPC 1831 } // namespace IPC
1783 1832
1784 1833
1785 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h" 1834 #define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
1786 #include "chrome/common/ipc_message_macros.h" 1835 #include "chrome/common/ipc_message_macros.h"
1787 1836
1788 #endif // CHROME_COMMON_RENDER_MESSAGES_H_ 1837 #endif // CHROME_COMMON_RENDER_MESSAGES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698