diff options
author | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 17:45:54 +0000 |
---|---|---|
committer | michaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-07 17:45:54 +0000 |
commit | 1edc16b82bd98eb06188a94e62c668d439035e6e (patch) | |
tree | 3edaea7ad20c2981febbc5e081bb2d499d97e671 /chrome/common/render_messages.h | |
parent | 7d769c36ccaf6663c49e3c89d959a47b9449f68a (diff) | |
download | chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.zip chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.tar.gz chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.tar.bz2 |
Adds new messages and widens some existing messages between the renderer and browser processes to support an implementation of the HTML5AppCache spec with most of the logic running in the browser process. The gist of most of the changes are to indicate which frame each resource request is coming from, and to indicate which appcache each response was retrieved from (if any).See https://docs.google.com/a/google.com/Doc?docid=agv6ghfsqr_15f749cgt3&hl=en
Review URL: http://codereview.chromium.org/9712
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/render_messages.h')
-rw-r--r-- | chrome/common/render_messages.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index 0d5404a..32f8f57 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -33,6 +33,7 @@ #include "webkit/glue/password_form_dom_manager.h" #include "webkit/glue/resource_loader_bridge.h" #include "webkit/glue/webaccessibility.h" +#include "webkit/glue/webappcachecontext.h" #include "webkit/glue/webdropdata.h" #include "webkit/glue/webplugin.h" #include "webkit/glue/webpreferences.h" @@ -275,6 +276,10 @@ struct ViewHostMsg_Resource_Request { // Used by plugin->browser requests to get the correct URLRequestContext. uint32 request_context; + // Indicates which frame (or worker context) the request is being loaded into, + // or kNoAppCacheContextId. + int32 app_cache_context_id; + // Optional upload data (may be null). scoped_refptr<net::UploadData> upload_data; }; @@ -1222,6 +1227,7 @@ struct ParamTraits<ViewHostMsg_Resource_Request> { WriteParam(m, p.origin_pid); WriteParam(m, p.resource_type); WriteParam(m, p.request_context); + WriteParam(m, p.app_cache_context_id); WriteParam(m, p.upload_data); } static bool Read(const Message* m, void** iter, param_type* r) { @@ -1238,6 +1244,7 @@ struct ParamTraits<ViewHostMsg_Resource_Request> { ReadParam(m, iter, &r->origin_pid) && ReadParam(m, iter, &r->resource_type) && ReadParam(m, iter, &r->request_context) && + ReadParam(m, iter, &r->app_cache_context_id) && ReadParam(m, iter, &r->upload_data); } static void Log(const param_type& p, std::wstring* l) { @@ -1261,6 +1268,8 @@ struct ParamTraits<ViewHostMsg_Resource_Request> { LogParam(p.resource_type, l); l->append(L", "); LogParam(p.request_context, l); + l->append(L", "); + LogParam(p.app_cache_context_id, l); l->append(L")"); } }; @@ -1352,6 +1361,7 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { WriteParam(m, p.charset); WriteParam(m, p.security_info); WriteParam(m, p.content_length); + WriteParam(m, p.app_cache_id); WriteParam(m, p.response_data_file); } static bool Read(const Message* m, void** iter, param_type* r) { @@ -1363,6 +1373,7 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { ReadParam(m, iter, &r->charset) && ReadParam(m, iter, &r->security_info) && ReadParam(m, iter, &r->content_length) && + ReadParam(m, iter, &r->app_cache_id) && ReadParam(m, iter, &r->response_data_file); } static void Log(const param_type& p, std::wstring* l) { @@ -1378,6 +1389,10 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> { LogParam(p.charset, l); l->append(L", "); LogParam(p.security_info, l); + l->append(L", "); + LogParam(p.content_length, l); + l->append(L", "); + LogParam(p.app_cache_id, l); l->append(L")"); } }; @@ -1779,6 +1794,40 @@ struct ParamTraits<AudioOutputStream::State> { } }; +template <> +struct ParamTraits<WebAppCacheContext::ContextType> { + typedef WebAppCacheContext::ContextType param_type; + static void Write(Message* m, const param_type& p) { + m->WriteInt(static_cast<int>(p)); + } + static bool Read(const Message* m, void** iter, param_type* p) { + int type; + if (!m->ReadInt(iter, &type)) + return false; + *p = static_cast<param_type>(type); + return true; + } + static void Log(const param_type& p, std::wstring* l) { + std::wstring state; + switch (p) { + case WebAppCacheContext::MAIN_FRAME: + state = L"MAIN_FRAME"; + break; + case WebAppCacheContext::CHILD_FRAME: + state = L"CHILD_FRAME"; + break; + case WebAppCacheContext::DEDICATED_WORKER: + state = L"DECICATED_WORKER"; + break; + default: + state = L"UNKNOWN"; + break; + } + + LogParam(state, l); + } +}; + } // namespace IPC |