summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 19:05:37 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-08 19:05:37 +0000
commitb4b3a91b7f7b30b0aa1628b43b61ee9aebce562f (patch)
treedc7491ed95382eb245d8704f7e2c3f0c2f8c9997 /chrome/common
parentf5dae35ca6f55a4e2d5949b96b519c1287825c76 (diff)
downloadchromium_src-b4b3a91b7f7b30b0aa1628b43b61ee9aebce562f.zip
chromium_src-b4b3a91b7f7b30b0aa1628b43b61ee9aebce562f.tar.gz
chromium_src-b4b3a91b7f7b30b0aa1628b43b61ee9aebce562f.tar.bz2
FBTF: Move some structs in webkit_glue::ResourceLoaderBridge:: .
This moves inner structs into the namespace toplevel so we can foreward declare them; then we forward declare them in render_messages.h so we can drop that header. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3616014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61996 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/common_param_traits.h2
-rw-r--r--chrome/common/extensions/extension_localization_peer.cc4
-rw-r--r--chrome/common/extensions/extension_localization_peer.h6
-rw-r--r--chrome/common/extensions/extension_localization_peer_unittest.cc4
-rw-r--r--chrome/common/render_messages.cc247
-rw-r--r--chrome/common/render_messages.h248
-rw-r--r--chrome/common/render_messages_internal.h4
-rw-r--r--chrome/common/resource_dispatcher.cc3
-rw-r--r--chrome/common/resource_dispatcher.h2
-rw-r--r--chrome/common/resource_dispatcher_unittest.cc10
-rw-r--r--chrome/common/resource_response.h3
-rw-r--r--chrome/common/security_filter_peer.cc14
-rw-r--r--chrome/common/security_filter_peer.h12
13 files changed, 305 insertions, 254 deletions
diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h
index a2c5dca..11c9749 100644
--- a/chrome/common/common_param_traits.h
+++ b/chrome/common/common_param_traits.h
@@ -12,8 +12,6 @@
#define CHROME_COMMON_COMMON_PARAM_TRAITS_H_
#pragma once
-#include <vector>
-
#include "app/surface/transport_dib.h"
#include "base/file_util.h"
#include "base/ref_counted.h"
diff --git a/chrome/common/extensions/extension_localization_peer.cc b/chrome/common/extensions/extension_localization_peer.cc
index 315b9f0..06e0317 100644
--- a/chrome/common/extensions/extension_localization_peer.cc
+++ b/chrome/common/extensions/extension_localization_peer.cc
@@ -48,7 +48,7 @@ void ExtensionLocalizationPeer::OnUploadProgress(
bool ExtensionLocalizationPeer::OnReceivedRedirect(
const GURL& new_url,
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies) {
NOTREACHED();
@@ -56,7 +56,7 @@ bool ExtensionLocalizationPeer::OnReceivedRedirect(
}
void ExtensionLocalizationPeer::OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered) {
response_info_ = info;
}
diff --git a/chrome/common/extensions/extension_localization_peer.h b/chrome/common/extensions/extension_localization_peer.h
index 4beee2d..b2b7c7a 100644
--- a/chrome/common/extensions/extension_localization_peer.h
+++ b/chrome/common/extensions/extension_localization_peer.h
@@ -34,11 +34,11 @@ class ExtensionLocalizationPeer
virtual void OnUploadProgress(uint64 position, uint64 size);
virtual bool OnReceivedRedirect(
const GURL& new_url,
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies);
virtual void OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered);
virtual void OnDownloadedData(int len) {}
virtual void OnReceivedData(const char* data, int len);
@@ -64,7 +64,7 @@ class ExtensionLocalizationPeer
webkit_glue::ResourceLoaderBridge::Peer* original_peer_;
// We just pass though the response info. This holds the copy of the original.
- webkit_glue::ResourceLoaderBridge::ResponseInfo response_info_;
+ webkit_glue::ResourceResponseInfo response_info_;
// Sends ViewHostMsg_GetExtensionMessageBundle message to the browser to fetch
// message catalog.
diff --git a/chrome/common/extensions/extension_localization_peer_unittest.cc b/chrome/common/extensions/extension_localization_peer_unittest.cc
index dbcce27..bc6f73f 100644
--- a/chrome/common/extensions/extension_localization_peer_unittest.cc
+++ b/chrome/common/extensions/extension_localization_peer_unittest.cc
@@ -60,11 +60,11 @@ class MockResourceLoaderBridgePeer
MOCK_METHOD2(OnUploadProgress, void(uint64 position, uint64 size));
MOCK_METHOD4(OnReceivedRedirect, bool(
const GURL& new_url,
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies));
MOCK_METHOD2(OnReceivedResponse, void(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered));
MOCK_METHOD1(OnDownloadedData, void(int len));
MOCK_METHOD2(OnReceivedData, void(const char* data, int len));
diff --git a/chrome/common/render_messages.cc b/chrome/common/render_messages.cc
index ff80db6..5d422da 100644
--- a/chrome/common/render_messages.cc
+++ b/chrome/common/render_messages.cc
@@ -12,31 +12,34 @@
#include "chrome/common/indexed_db_key.h"
#include "chrome/common/indexed_db_param_traits.h"
#include "chrome/common/render_messages_params.h"
+#include "chrome/common/resource_response.h"
#include "chrome/common/serialized_script_value.h"
#include "chrome/common/thumbnail_score.h"
#include "gfx/rect.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/skia/include/core/SkBitmap.h"
#include "third_party/WebKit/WebKit/chromium/public/WebCompositionUnderline.h"
#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h"
#include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayerAction.h"
#include "third_party/WebKit/WebKit/chromium/public/WebScreenInfo.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/blob/blob_data.h"
#include "webkit/glue/context_menu.h"
+#include "webkit/glue/dom_operations.h"
#include "webkit/glue/form_data.h"
#include "webkit/glue/form_field.h"
-#include "webkit/glue/password_form_dom_manager.h"
#include "webkit/glue/password_form.h"
+#include "webkit/glue/password_form_dom_manager.h"
+#include "webkit/glue/plugins/webplugin.h"
+#include "webkit/glue/plugins/webplugininfo.h"
+#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/glue/webaccessibility.h"
#include "webkit/glue/webcookie.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webdropdata.h"
-#include "webkit/glue/plugins/webplugin.h"
-#include "webkit/glue/plugins/webplugininfo.h"
-#include "webkit/glue/dom_operations.h"
#include "webkit/glue/webmenuitem.h"
#if defined(OS_MACOSX)
@@ -345,6 +348,240 @@ void ParamTraits<scoped_refptr<net::HttpResponseHeaders> >::Log(
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->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)->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);
+}
+
+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);
+}
+
+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(")");
+}
+
+void ParamTraits<ResourceResponseHead>::Write(Message* m, const param_type& p) {
+ ParamTraits<webkit_glue::ResourceResponseInfo>::Write(m, p);
+ WriteParam(m, p.status);
+ WriteParam(m, p.replace_extension_localization_templates);
+}
+
+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) &&
+ ReadParam(m, iter, &r->replace_extension_localization_templates);
+}
+
+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<webkit_glue::FormData>::Write(Message* m,
const param_type& p) {
WriteParam(m, p.name);
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 8408893..ea5d47c 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -20,18 +20,15 @@
#include "chrome/common/dom_storage_common.h"
#include "chrome/common/indexed_db_param_traits.h"
#include "chrome/common/page_transition_types.h"
-#include "chrome/common/resource_response.h"
#include "chrome/common/translate_errors.h"
#include "chrome/common/view_types.h"
#include "chrome/common/webkit_param_traits.h"
#include "gfx/native_widget_types.h"
#include "ipc/ipc_message_utils.h"
#include "ipc/ipc_platform_file.h" // ifdefed typedef.
-#include "media/audio/audio_buffers_state.h"
#include "third_party/WebKit/WebKit/chromium/public/WebStorageArea.h"
#include "webkit/appcache/appcache_interfaces.h" // enum appcache::Status
#include "webkit/fileapi/file_system_types.h" // enum fileapi::FileSystemType
-#include "webkit/glue/resource_loader_bridge.h" // nested classes
#if defined(OS_MACOSX)
struct FontDescriptor;
@@ -55,18 +52,24 @@ namespace webkit_glue {
struct FormData;
class FormField;
struct PasswordFormFillData;
+struct ResourceDevToolsInfo;
+struct ResourceLoadTimingInfo;
+struct ResourceResponseInfo;
struct WebAccessibility;
struct WebCookie;
struct WebPluginGeometry;
struct WebAccessibility;
}
+struct AudioBuffersState;
class ExtensionExtent;
class GURL;
class SkBitmap;
class URLPattern;
struct ContextMenuParams;
struct EditCommand;
+struct ResourceResponseHead;
+struct SyncLoadResult;
struct RendererPreferences;
struct WebDropData;
struct WebMenuItem;
@@ -191,239 +194,46 @@ struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
static void Log(const param_type& p, std::string* l);
};
-// Traits for webkit_glue::ResourceLoaderBridge::LoadTimingInfo
+// Traits for webkit_glue::ResourceLoadTimingInfo
template <>
-struct ParamTraits<webkit_glue::ResourceLoaderBridge::LoadTimingInfo> {
- typedef webkit_glue::ResourceLoaderBridge::LoadTimingInfo param_type;
- static void 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);
- }
- static bool 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);
- }
- static void 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(")");
- }
+struct ParamTraits<webkit_glue::ResourceLoadTimingInfo> {
+ typedef webkit_glue::ResourceLoadTimingInfo param_type;
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* r);
+ static void Log(const param_type& p, std::string* l);
};
template <>
-struct ParamTraits<
- scoped_refptr<webkit_glue::ResourceLoaderBridge::DevToolsInfo> > {
- typedef scoped_refptr<webkit_glue::ResourceLoaderBridge::DevToolsInfo>
- param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.get() != NULL);
- if (p.get()) {
- WriteParam(m, p->request_headers);
- WriteParam(m, p->response_headers);
- }
- }
- static bool 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::ResourceLoaderBridge::DevToolsInfo();
- return
- ReadParam(m, iter, &(*r)->request_headers) &&
- ReadParam(m, iter, &(*r)->response_headers);
- }
- static void 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(")");
- }
+struct ParamTraits<scoped_refptr<webkit_glue::ResourceDevToolsInfo> > {
+ typedef scoped_refptr<webkit_glue::ResourceDevToolsInfo> param_type;
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* r);
+ static void Log(const param_type& p, std::string* l);
};
-// Traits for webkit_glue::ResourceLoaderBridge::ResponseInfo
+// Traits for webkit_glue::ResourceResponseInfo
template <>
-struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
- typedef webkit_glue::ResourceLoaderBridge::ResponseInfo param_type;
- static void 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);
- }
- static bool 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);
- }
- static void 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(")");
- }
+struct ParamTraits<webkit_glue::ResourceResponseInfo> {
+ typedef webkit_glue::ResourceResponseInfo param_type;
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* r);
+ static void Log(const param_type& p, std::string* l);
};
template <>
struct ParamTraits<ResourceResponseHead> {
typedef ResourceResponseHead param_type;
- static void Write(Message* m, const param_type& p) {
- ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Write(m, p);
- WriteParam(m, p.status);
- WriteParam(m, p.replace_extension_localization_templates);
- }
- static bool Read(const Message* m, void** iter, param_type* r) {
- return ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Read(
- m, iter, r) &&
- ReadParam(m, iter, &r->status) &&
- ReadParam(m, iter, &r->replace_extension_localization_templates);
- }
- static void Log(const param_type& p, std::string* l) {
- // log more?
- ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* r);
+ static void Log(const param_type& p, std::string* l);
};
template <>
struct ParamTraits<SyncLoadResult> {
typedef SyncLoadResult param_type;
- static void Write(Message* m, const param_type& p) {
- ParamTraits<ResourceResponseHead>::Write(m, p);
- WriteParam(m, p.final_url);
- WriteParam(m, p.data);
- }
- static bool 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);
- }
- static void Log(const param_type& p, std::string* l) {
- // log more?
- ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo>::Log(p, l);
- }
+ static void Write(Message* m, const param_type& p);
+ static bool Read(const Message* m, void** iter, param_type* r);
+ static void Log(const param_type& p, std::string* l);
};
// Traits for FormData structure to pack/unpack.
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 1008de2..ae93fe4 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -54,6 +54,10 @@ struct Entry;
}
}
+namespace gfx {
+class Rect;
+}
+
namespace IPC {
struct ChannelHandle;
class Message;
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 9f182a1..e56ae7b 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -15,6 +15,7 @@
#include "chrome/common/extensions/extension_localization_peer.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
+#include "chrome/common/resource_response.h"
#include "chrome/common/security_filter_peer.h"
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
@@ -427,7 +428,7 @@ void ResourceDispatcher::OnReceivedRedirect(
const IPC::Message& message,
int request_id,
const GURL& new_url,
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info) {
+ const webkit_glue::ResourceResponseInfo& info) {
PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
if (!request_info)
return;
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index 77e08ac..475119f 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -98,7 +98,7 @@ class ResourceDispatcher {
const IPC::Message& message,
int request_id,
const GURL& new_url,
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info);
+ const webkit_glue::ResourceResponseInfo& info);
void OnReceivedData(
const IPC::Message& message,
int request_id,
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index ff007f9..8e31ee9 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -12,12 +12,14 @@
#include "chrome/common/render_messages.h"
#include "chrome/common/render_messages_params.h"
#include "chrome/common/resource_dispatcher.h"
+#include "chrome/common/resource_response.h"
#include "net/base/upload_data.h"
#include "net/http/http_response_headers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/appcache/appcache_interfaces.h"
using webkit_glue::ResourceLoaderBridge;
+using webkit_glue::ResourceResponseInfo;
static const char test_page_url[] = "http://www.google.com/";
static const char test_page_headers[] =
@@ -40,7 +42,7 @@ class TestRequestCallback : public ResourceLoaderBridge::Peer {
virtual bool OnReceivedRedirect(
const GURL& new_url,
- const ResourceLoaderBridge::ResponseInfo& info,
+ const ResourceResponseInfo& info,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies) {
*has_new_first_party_for_cookies = false;
@@ -48,7 +50,7 @@ class TestRequestCallback : public ResourceLoaderBridge::Peer {
}
virtual void OnReceivedResponse(
- const ResourceLoaderBridge::ResponseInfo& info,
+ const ResourceResponseInfo& info,
bool content_filtered) {
}
@@ -264,7 +266,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
virtual bool OnReceivedRedirect(
const GURL& new_url,
- const ResourceLoaderBridge::ResponseInfo& info,
+ const ResourceResponseInfo& info,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies) {
*has_new_first_party_for_cookies = false;
@@ -272,7 +274,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest,
}
virtual void OnReceivedResponse(
- const ResourceLoaderBridge::ResponseInfo& info,
+ const ResourceResponseInfo& info,
bool content_filtered) {
EXPECT_EQ(defer_loading_, false);
set_defer_loading(true);
diff --git a/chrome/common/resource_response.h b/chrome/common/resource_response.h
index 0700a8c..058a811 100644
--- a/chrome/common/resource_response.h
+++ b/chrome/common/resource_response.h
@@ -16,8 +16,7 @@
#include "webkit/glue/resource_loader_bridge.h"
// Parameters for a resource response header.
-struct ResourceResponseHead
- : webkit_glue::ResourceLoaderBridge::ResponseInfo {
+struct ResourceResponseHead : webkit_glue::ResourceResponseInfo {
ResourceResponseHead();
~ResourceResponseHead();
diff --git a/chrome/common/security_filter_peer.cc b/chrome/common/security_filter_peer.cc
index b4fcbd3..9b0815b 100644
--- a/chrome/common/security_filter_peer.cc
+++ b/chrome/common/security_filter_peer.cc
@@ -67,7 +67,7 @@ void SecurityFilterPeer::OnUploadProgress(uint64 position, uint64 size) {
bool SecurityFilterPeer::OnReceivedRedirect(
const GURL& new_url,
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies) {
NOTREACHED();
@@ -75,7 +75,7 @@ bool SecurityFilterPeer::OnReceivedRedirect(
}
void SecurityFilterPeer::OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered) {
NOTREACHED();
}
@@ -96,8 +96,8 @@ GURL SecurityFilterPeer::GetURLForDebugging() const {
// static
void ProcessResponseInfo(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info_in,
- webkit_glue::ResourceLoaderBridge::ResponseInfo* info_out,
+ const webkit_glue::ResourceResponseInfo& info_in,
+ webkit_glue::ResourceResponseInfo* info_out,
const std::string& mime_type) {
DCHECK(info_out);
*info_out = info_in;
@@ -138,7 +138,7 @@ BufferedPeer::~BufferedPeer() {
}
void BufferedPeer::OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool response_filtered) {
ProcessResponseInfo(info, &response_info_, mime_type_);
}
@@ -186,7 +186,7 @@ ReplaceContentPeer::~ReplaceContentPeer() {
}
void ReplaceContentPeer::OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered) {
// Ignore this, we'll serve some alternate content in OnCompletedRequest.
}
@@ -199,7 +199,7 @@ void ReplaceContentPeer::OnCompletedRequest(
const URLRequestStatus& status,
const std::string& security_info,
const base::Time& completion_time) {
- webkit_glue::ResourceLoaderBridge::ResponseInfo info;
+ webkit_glue::ResourceResponseInfo info;
ProcessResponseInfo(info, &info, mime_type_);
info.security_info = security_info;
info.content_length = static_cast<int>(data_.size());
diff --git a/chrome/common/security_filter_peer.h b/chrome/common/security_filter_peer.h
index 593fbb0..8365ebd 100644
--- a/chrome/common/security_filter_peer.h
+++ b/chrome/common/security_filter_peer.h
@@ -33,11 +33,11 @@ class SecurityFilterPeer : public webkit_glue::ResourceLoaderBridge::Peer {
virtual void OnUploadProgress(uint64 position, uint64 size);
virtual bool OnReceivedRedirect(
const GURL& new_url,
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool* has_new_first_party_for_cookies,
GURL* new_first_party_for_cookies);
virtual void OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered);
virtual void OnDownloadedData(int len) {}
virtual void OnReceivedData(const char* data, int len);
@@ -68,7 +68,7 @@ class BufferedPeer : public SecurityFilterPeer {
// ResourceLoaderBridge::Peer Implementation.
virtual void OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered);
virtual void OnReceivedData(const char* data, int len);
virtual void OnCompletedRequest(const URLRequestStatus& status,
@@ -82,7 +82,7 @@ class BufferedPeer : public SecurityFilterPeer {
// original peer, if it returns false, an error is sent instead.
virtual bool DataReady() = 0;
- webkit_glue::ResourceLoaderBridge::ResponseInfo response_info_;
+ webkit_glue::ResourceResponseInfo response_info_;
std::string data_;
private:
@@ -109,7 +109,7 @@ class ReplaceContentPeer : public SecurityFilterPeer {
// ResourceLoaderBridge::Peer Implementation.
virtual void OnReceivedResponse(
- const webkit_glue::ResourceLoaderBridge::ResponseInfo& info,
+ const webkit_glue::ResourceResponseInfo& info,
bool content_filtered);
void OnReceivedData(const char* data, int len);
void OnCompletedRequest(const URLRequestStatus& status,
@@ -117,7 +117,7 @@ class ReplaceContentPeer : public SecurityFilterPeer {
const base::Time& completion_time);
private:
- webkit_glue::ResourceLoaderBridge::ResponseInfo response_info_;
+ webkit_glue::ResourceResponseInfo response_info_;
std::string mime_type_;
std::string data_;