summaryrefslogtreecommitdiffstats
path: root/chrome/common/render_messages.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-05 19:08:32 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-05 19:08:32 +0000
commit94dc971dc40c6cfea33abd234e744ac314d0bc2a (patch)
tree0f2f3f0b57dfdb01c65afc6833e7ad622eb85697 /chrome/common/render_messages.cc
parenta14ea34921d1347ceca1c8ddaa6dc1cf6efb1ddb (diff)
downloadchromium_src-94dc971dc40c6cfea33abd234e744ac314d0bc2a.zip
chromium_src-94dc971dc40c6cfea33abd234e744ac314d0bc2a.tar.gz
chromium_src-94dc971dc40c6cfea33abd234e744ac314d0bc2a.tar.bz2
Move resource related IPCs to their own file in content. I added a IPC_STRUCT_TRAITS_PARENT macro to allow the automatic serializing macros to add a parent struct.
TBR=tsepez Review URL: http://codereview.chromium.org/6628035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/render_messages.cc')
-rw-r--r--chrome/common/render_messages.cc269
1 files changed, 1 insertions, 268 deletions
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index 8a7f043..1ee9fbf 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -8,19 +8,16 @@
#include "chrome/common/extensions/url_pattern.h"
#include "chrome/common/gpu_param_traits.h"
#include "chrome/common/render_messages_params.h"
-#include "chrome/common/resource_response.h"
#include "chrome/common/thumbnail_score.h"
#include "chrome/common/web_apps.h"
+#include "content/common/resource_response.h"
#include "ipc/ipc_channel_handle.h"
#include "media/audio/audio_buffers_state.h"
-#include "net/base/upload_data.h"
-#include "net/http/http_response_headers.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/rect.h"
#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/blob/blob_data.h"
-#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcookie.h"
#include "webkit/glue/webcursor.h"
@@ -287,270 +284,6 @@ void ParamTraits<webkit::npapi::WebPluginInfo>::Log(const param_type& p,
l->append(")");
}
-void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Write(
- Message* m, const param_type& p) {
- WriteParam(m, p.get() != NULL);
- if (p) {
- // Do not disclose Set-Cookie headers over IPC.
- p->Persist(m, net::HttpResponseHeaders::PERSIST_SANS_COOKIES);
- }
-}
-
-bool ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Read(
- const Message* m, void** iter, param_type* r) {
- bool has_object;
- if (!ReadParam(m, iter, &has_object))
- return false;
- if (has_object)
- *r = new net::HttpResponseHeaders(*m, iter);
- return true;
-}
-
-void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Log(
- const param_type& p, std::string* l) {
- l->append("<HttpResponseHeaders>");
-}
-
-void ParamTraits<webkit_glue::ResourceLoadTimingInfo>::Write(
- Message* m, const param_type& p) {
- WriteParam(m, p.base_time.is_null());
- if (p.base_time.is_null())
- return;
- WriteParam(m, p.base_time);
- WriteParam(m, p.proxy_start);
- WriteParam(m, p.proxy_end);
- WriteParam(m, p.dns_start);
- WriteParam(m, p.dns_end);
- WriteParam(m, p.connect_start);
- WriteParam(m, p.connect_end);
- WriteParam(m, p.ssl_start);
- WriteParam(m, p.ssl_end);
- WriteParam(m, p.send_start);
- WriteParam(m, p.send_end);
- WriteParam(m, p.receive_headers_start);
- WriteParam(m, p.receive_headers_end);
-}
-
-bool ParamTraits<webkit_glue::ResourceLoadTimingInfo>::Read(
- const Message* m, void** iter, param_type* r) {
- bool is_null;
- if (!ReadParam(m, iter, &is_null))
- return false;
- if (is_null)
- return true;
-
- return
- ReadParam(m, iter, &r->base_time) &&
- ReadParam(m, iter, &r->proxy_start) &&
- ReadParam(m, iter, &r->proxy_end) &&
- ReadParam(m, iter, &r->dns_start) &&
- ReadParam(m, iter, &r->dns_end) &&
- ReadParam(m, iter, &r->connect_start) &&
- ReadParam(m, iter, &r->connect_end) &&
- ReadParam(m, iter, &r->ssl_start) &&
- ReadParam(m, iter, &r->ssl_end) &&
- ReadParam(m, iter, &r->send_start) &&
- ReadParam(m, iter, &r->send_end) &&
- ReadParam(m, iter, &r->receive_headers_start) &&
- ReadParam(m, iter, &r->receive_headers_end);
-}
-
-void ParamTraits<webkit_glue::ResourceLoadTimingInfo>::Log(const param_type& p,
- std::string* l) {
- l->append("(");
- LogParam(p.base_time, l);
- l->append(", ");
- LogParam(p.proxy_start, l);
- l->append(", ");
- LogParam(p.proxy_end, l);
- l->append(", ");
- LogParam(p.dns_start, l);
- l->append(", ");
- LogParam(p.dns_end, l);
- l->append(", ");
- LogParam(p.connect_start, l);
- l->append(", ");
- LogParam(p.connect_end, l);
- l->append(", ");
- LogParam(p.ssl_start, l);
- l->append(", ");
- LogParam(p.ssl_end, l);
- l->append(", ");
- LogParam(p.send_start, l);
- l->append(", ");
- LogParam(p.send_end, l);
- l->append(", ");
- LogParam(p.receive_headers_start, l);
- l->append(", ");
- LogParam(p.receive_headers_end, l);
- l->append(")");
-}
-
-void ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> >::Write(
- Message* m, const param_type& p) {
- WriteParam(m, p.get() != NULL);
- if (p.get()) {
- WriteParam(m, p->http_status_code);
- WriteParam(m, p->http_status_text);
- WriteParam(m, p->request_headers);
- WriteParam(m, p->response_headers);
- }
-}
-
-bool ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> >::Read(
- const Message* m, void** iter, param_type* r) {
- bool has_object;
- if (!ReadParam(m, iter, &has_object))
- return false;
- if (!has_object)
- return true;
- *r = new webkit_glue::ResourceDevToolsInfo();
- return
- ReadParam(m, iter, &(*r)->http_status_code) &&
- ReadParam(m, iter, &(*r)->http_status_text) &&
- ReadParam(m, iter, &(*r)->request_headers) &&
- ReadParam(m, iter, &(*r)->response_headers);
-}
-
-void ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> >::Log(
- const param_type& p, std::string* l) {
- l->append("(");
- if (p) {
- LogParam(p->request_headers, l);
- l->append(", ");
- LogParam(p->response_headers, l);
- }
- l->append(")");
-}
-
-void ParamTraits<webkit_glue::ResourceResponseInfo>::Write(
- Message* m, const param_type& p) {
- WriteParam(m, p.request_time);
- WriteParam(m, p.response_time);
- WriteParam(m, p.headers);
- WriteParam(m, p.mime_type);
- WriteParam(m, p.charset);
- WriteParam(m, p.security_info);
- WriteParam(m, p.content_length);
- WriteParam(m, p.appcache_id);
- WriteParam(m, p.appcache_manifest_url);
- WriteParam(m, p.connection_id);
- WriteParam(m, p.connection_reused);
- WriteParam(m, p.load_timing);
- WriteParam(m, p.devtools_info);
- WriteParam(m, p.download_file_path);
- WriteParam(m, p.was_fetched_via_spdy);
- WriteParam(m, p.was_npn_negotiated);
- WriteParam(m, p.was_alternate_protocol_available);
- WriteParam(m, p.was_fetched_via_proxy);
- WriteParam(m, p.socket_address);
-}
-
-bool ParamTraits<webkit_glue::ResourceResponseInfo>::Read(
- const Message* m, void** iter, param_type* r) {
- return
- ReadParam(m, iter, &r->request_time) &&
- ReadParam(m, iter, &r->response_time) &&
- ReadParam(m, iter, &r->headers) &&
- ReadParam(m, iter, &r->mime_type) &&
- ReadParam(m, iter, &r->charset) &&
- ReadParam(m, iter, &r->security_info) &&
- ReadParam(m, iter, &r->content_length) &&
- ReadParam(m, iter, &r->appcache_id) &&
- ReadParam(m, iter, &r->appcache_manifest_url) &&
- ReadParam(m, iter, &r->connection_id) &&
- ReadParam(m, iter, &r->connection_reused) &&
- ReadParam(m, iter, &r->load_timing) &&
- ReadParam(m, iter, &r->devtools_info) &&
- ReadParam(m, iter, &r->download_file_path) &&
- ReadParam(m, iter, &r->was_fetched_via_spdy) &&
- ReadParam(m, iter, &r->was_npn_negotiated) &&
- ReadParam(m, iter, &r->was_alternate_protocol_available) &&
- ReadParam(m, iter, &r->was_fetched_via_proxy) &&
- ReadParam(m, iter, &r->socket_address);
-}
-
-void ParamTraits<webkit_glue::ResourceResponseInfo>::Log(
- const param_type& p, std::string* l) {
- l->append("(");
- LogParam(p.request_time, l);
- l->append(", ");
- LogParam(p.response_time, l);
- l->append(", ");
- LogParam(p.headers, l);
- l->append(", ");
- LogParam(p.mime_type, l);
- l->append(", ");
- LogParam(p.charset, l);
- l->append(", ");
- LogParam(p.security_info, l);
- l->append(", ");
- LogParam(p.content_length, l);
- l->append(", ");
- LogParam(p.appcache_id, l);
- l->append(", ");
- LogParam(p.appcache_manifest_url, l);
- l->append(", ");
- LogParam(p.connection_id, l);
- l->append(", ");
- LogParam(p.connection_reused, l);
- l->append(", ");
- LogParam(p.load_timing, l);
- l->append(", ");
- LogParam(p.devtools_info, l);
- l->append(", ");
- LogParam(p.download_file_path, l);
- l->append(", ");
- LogParam(p.was_fetched_via_spdy, l);
- l->append(", ");
- LogParam(p.was_npn_negotiated, l);
- l->append(", ");
- LogParam(p.was_alternate_protocol_available, l);
- l->append(", ");
- LogParam(p.was_fetched_via_proxy, l);
- l->append(", ");
- LogParam(p.socket_address, l);
- l->append(")");
-}
-
-void ParamTraits<ResourceResponseHead>::Write(Message* m, const param_type& p) {
- ParamTraits<webkit_glue::ResourceResponseInfo>::Write(m, p);
- WriteParam(m, p.status);
-}
-
-bool ParamTraits<ResourceResponseHead>::Read(const Message* m,
- void** iter,
- param_type* r) {
- return ParamTraits<webkit_glue::ResourceResponseInfo>::Read(
- m, iter, r) &&
- ReadParam(m, iter, &r->status);
-}
-
-void ParamTraits<ResourceResponseHead>::Log(const param_type& p,
- std::string* l) {
- // log more?
- ParamTraits<webkit_glue::ResourceResponseInfo>::Log(p, l);
-}
-
-void ParamTraits<SyncLoadResult>::Write(Message* m, const param_type& p) {
- ParamTraits<ResourceResponseHead>::Write(m, p);
- WriteParam(m, p.final_url);
- WriteParam(m, p.data);
-}
-
-bool ParamTraits<SyncLoadResult>::Read(const Message* m, void** iter,
- param_type* r) {
- return
- ParamTraits<ResourceResponseHead>::Read(m, iter, r) &&
- ReadParam(m, iter, &r->final_url) &&
- ReadParam(m, iter, &r->data);
-}
-
-void ParamTraits<SyncLoadResult>::Log(const param_type& p, std::string* l) {
- // log more?
- ParamTraits<webkit_glue::ResourceResponseInfo>::Log(p, l);
-}
-
void ParamTraits<RendererPreferences>::Write(Message* m, const param_type& p) {
WriteParam(m, p.can_accept_load_drops);
WriteParam(m, p.should_antialias_text);