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
diff --git a/chrome/browser/debugger/devtools_netlog_observer.cc b/chrome/browser/debugger/devtools_netlog_observer.cc
index 0c2bb3e..6724a53 100644
--- a/chrome/browser/debugger/devtools_netlog_observer.cc
+++ b/chrome/browser/debugger/devtools_netlog_observer.cc
@@ -6,7 +6,7 @@
 
 #include "base/string_util.h"
 #include "chrome/browser/io_thread.h"
-#include "chrome/common/resource_response.h"
+#include "content/common/resource_response.h"
 #include "net/base/load_flags.h"
 #include "net/http/http_net_log_params.h"
 #include "net/http/http_response_headers.h"
diff --git a/chrome/browser/net/load_timing_observer.cc b/chrome/browser/net/load_timing_observer.cc
index d4e1bec2..63ac8ea3 100644
--- a/chrome/browser/net/load_timing_observer.cc
+++ b/chrome/browser/net/load_timing_observer.cc
@@ -6,8 +6,8 @@
 
 #include "base/time.h"
 #include "chrome/browser/net/chrome_net_log.h"
-#include "chrome/common/resource_response.h"
 #include "content/browser/browser_thread.h"
+#include "content/common/resource_response.h"
 #include "net/base/load_flags.h"
 #include "net/url_request/url_request.h"
 #include "net/url_request/url_request_netlog_params.h"
diff --git a/chrome/browser/prerender/prerender_resource_handler.cc b/chrome/browser/prerender/prerender_resource_handler.cc
index 65ec6d3..3e47e4a 100644
--- a/chrome/browser/prerender/prerender_resource_handler.cc
+++ b/chrome/browser/prerender/prerender_resource_handler.cc
@@ -5,7 +5,7 @@
 #include "chrome/browser/prerender/prerender_resource_handler.h"
 
 #include "chrome/browser/net/chrome_url_request_context.h"
-#include "chrome/common/resource_response.h"
+#include "content/common/resource_response.h"
 #include "net/base/load_flags.h"
 #include "net/http/http_response_headers.h"
 #include "net/url_request/url_request.h"
diff --git a/chrome/browser/prerender/prerender_resource_handler_unittest.cc b/chrome/browser/prerender/prerender_resource_handler_unittest.cc
index 3bfcaf6..f6501d8 100644
--- a/chrome/browser/prerender/prerender_resource_handler_unittest.cc
+++ b/chrome/browser/prerender/prerender_resource_handler_unittest.cc
@@ -3,7 +3,7 @@
 // found in the LICENSE file.
 
 #include "chrome/browser/prerender/prerender_resource_handler.h"
-#include "chrome/common/resource_response.h"
+#include "content/common/resource_response.h"
 #include "net/http/http_response_headers.h"
 #include "net/url_request/url_request_test_util.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc
index 9c47b23..73dff89 100644
--- a/chrome/browser/renderer_host/browser_render_process_host.cc
+++ b/chrome/browser/renderer_host/browser_render_process_host.cc
@@ -91,9 +91,9 @@
 #include "content/browser/renderer_host/socket_stream_dispatcher_host.h"
 #include "content/browser/speech/speech_input_dispatcher_host.h"
 #include "content/browser/worker_host/worker_message_filter.h"
+#include "content/common/resource_messages.h"
 #include "grit/generated_resources.h"
 #include "ipc/ipc_logging.h"
-#include "ipc/ipc_message.h"
 #include "ipc/ipc_platform_file.h"
 #include "ipc/ipc_switches.h"
 #include "media/base/media_switches.h"
@@ -245,7 +245,7 @@
   }
 
   virtual net::URLRequestContext* GetRequestContext(
-      const ViewHostMsg_Resource_Request& resource_request) {
+      const ResourceHostMsg_Request& resource_request) {
     URLRequestContextGetter* request_context = request_context_;
     // If the request has resource type of ResourceType::MEDIA, we use a request
     // context specific to media for handling it because these resources have
diff --git a/chrome/browser/renderer_host/download_resource_handler.cc b/chrome/browser/renderer_host/download_resource_handler.cc
index d379493..277e0c68 100644
--- a/chrome/browser/renderer_host/download_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_resource_handler.cc
@@ -13,11 +13,11 @@
 #include "chrome/browser/download/download_item.h"
 #include "chrome/browser/download/download_file_manager.h"
 #include "chrome/browser/history/download_create_info.h"
-#include "chrome/common/resource_response.h"
 #include "content/browser/browser_thread.h"
 #include "content/browser/renderer_host/global_request_id.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
+#include "content/common/resource_response.h"
 #include "net/base/io_buffer.h"
 #include "net/http/http_response_headers.h"
 #include "net/url_request/url_request_context.h"
diff --git a/chrome/browser/renderer_host/download_throttling_resource_handler.cc b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
index 0351fe90..d0648b1 100644
--- a/chrome/browser/renderer_host/download_throttling_resource_handler.cc
+++ b/chrome/browser/renderer_host/download_throttling_resource_handler.cc
@@ -7,8 +7,8 @@
 #include "base/logging.h"
 #include "chrome/browser/download/download_util.h"
 #include "chrome/browser/renderer_host/download_resource_handler.h"
-#include "chrome/common/resource_response.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
+#include "content/common/resource_response.h"
 #include "net/base/io_buffer.h"
 #include "net/base/mime_sniffer.h"
 
diff --git a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
index 9921c607..f708c812 100644
--- a/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
+++ b/chrome/browser/renderer_host/safe_browsing_resource_handler.cc
@@ -5,10 +5,10 @@
 #include "chrome/browser/renderer_host/safe_browsing_resource_handler.h"
 
 #include "base/logging.h"
-#include "chrome/common/resource_response.h"
 #include "content/browser/renderer_host/global_request_id.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_message_filter.h"
+#include "content/common/resource_response.h"
 #include "net/base/net_errors.h"
 #include "net/base/io_buffer.h"
 
diff --git a/chrome/chrome_common.gypi b/chrome/chrome_common.gypi
index f711f828..a770f1f 100644
--- a/chrome/chrome_common.gypi
+++ b/chrome/chrome_common.gypi
@@ -146,10 +146,8 @@
           'common/profiling.cc',
           'common/profiling.h',
           'common/ref_counted_util.h',
-          'common/resource_response.cc',
-          'common/resource_response.h',
           'common/result_codes.h',
-	  'common/safebrowsing_messages.h',
+          'common/safebrowsing_messages.h',
           'common/sandbox_init_wrapper.h',
           'common/sandbox_init_wrapper_linux.cc',
           'common/sandbox_init_wrapper_mac.cc',
diff --git a/chrome/common/common_param_traits.cc b/chrome/common/common_param_traits.cc
index 94c97c9..5eefb2697 100644
--- a/chrome/common/common_param_traits.cc
+++ b/chrome/common/common_param_traits.cc
@@ -12,8 +12,6 @@
 #include "chrome/common/web_apps.h"
 #include "content/common/common_param_traits.h"
 #include "googleurl/src/gurl.h"
-#include "net/base/host_port_pair.h"
-#include "net/base/upload_data.h"
 #include "printing/backend/print_backend.h"
 #include "printing/native_metafile.h"
 #include "printing/page_range.h"
@@ -273,225 +271,6 @@
   l->append("<WebApplicationInfo>");
 }
 
-void ParamTraits<net::HostPortPair>::Write(Message* m, const param_type& p) {
-  WriteParam(m, p.host());
-  WriteParam(m, p.port());
-}
-
-bool ParamTraits<net::HostPortPair>::Read(const Message* m, void** iter,
-                                          param_type* r) {
-  std::string host;
-  uint16 port;
-  if (!ReadParam(m, iter, &host) || !ReadParam(m, iter, &port))
-    return false;
-
-  r->set_host(host);
-  r->set_port(port);
-  return true;
-}
-
-void ParamTraits<net::HostPortPair>::Log(const param_type& p, std::string* l) {
-  l->append(p.ToString());
-}
-
-void ParamTraits<net::URLRequestStatus>::Write(Message* m,
-                                               const param_type& p) {
-  WriteParam(m, static_cast<int>(p.status()));
-  WriteParam(m, p.os_error());
-}
-
-bool ParamTraits<net::URLRequestStatus>::Read(const Message* m, void** iter,
-                                              param_type* r) {
-  int status, os_error;
-  if (!ReadParam(m, iter, &status) ||
-      !ReadParam(m, iter, &os_error))
-    return false;
-  r->set_status(static_cast<net::URLRequestStatus::Status>(status));
-  r->set_os_error(os_error);
-  return true;
-}
-
-void ParamTraits<net::URLRequestStatus>::Log(const param_type& p,
-                                             std::string* l) {
-  std::string status;
-  switch (p.status()) {
-    case net::URLRequestStatus::SUCCESS:
-      status = "SUCCESS";
-      break;
-    case net::URLRequestStatus::IO_PENDING:
-      status = "IO_PENDING ";
-      break;
-    case net::URLRequestStatus::HANDLED_EXTERNALLY:
-      status = "HANDLED_EXTERNALLY";
-      break;
-    case net::URLRequestStatus::CANCELED:
-      status = "CANCELED";
-      break;
-    case net::URLRequestStatus::FAILED:
-      status = "FAILED";
-      break;
-    default:
-      status = "UNKNOWN";
-      break;
-  }
-  if (p.status() == net::URLRequestStatus::FAILED)
-    l->append("(");
-
-  LogParam(status, l);
-
-  if (p.status() == net::URLRequestStatus::FAILED) {
-    l->append(", ");
-    LogParam(p.os_error(), l);
-    l->append(")");
-  }
-}
-
-// Only the net::UploadData ParamTraits<> definition needs this definition, so
-// keep this in the implementation file so we can forward declare UploadData in
-// the header.
-template <>
-struct ParamTraits<net::UploadData::Element> {
-  typedef net::UploadData::Element param_type;
-  static void Write(Message* m, const param_type& p) {
-    WriteParam(m, static_cast<int>(p.type()));
-    switch (p.type()) {
-      case net::UploadData::TYPE_BYTES: {
-        m->WriteData(&p.bytes()[0], static_cast<int>(p.bytes().size()));
-        break;
-      }
-      case net::UploadData::TYPE_CHUNK: {
-        std::string chunk_length = StringPrintf(
-            "%X\r\n", static_cast<unsigned int>(p.bytes().size()));
-        std::vector<char> bytes;
-        bytes.insert(bytes.end(), chunk_length.data(),
-                     chunk_length.data() + chunk_length.length());
-        const char* data = &p.bytes()[0];
-        bytes.insert(bytes.end(), data, data + p.bytes().size());
-        const char* crlf = "\r\n";
-        bytes.insert(bytes.end(), crlf, crlf + strlen(crlf));
-        if (p.is_last_chunk()) {
-          const char* end_of_data = "0\r\n\r\n";
-          bytes.insert(bytes.end(), end_of_data,
-                       end_of_data + strlen(end_of_data));
-        }
-        m->WriteData(&bytes[0], static_cast<int>(bytes.size()));
-        // If this element is part of a chunk upload then send over information
-        // indicating if this is the last chunk.
-        WriteParam(m, p.is_last_chunk());
-        break;
-      }
-      case net::UploadData::TYPE_FILE: {
-        WriteParam(m, p.file_path());
-        WriteParam(m, p.file_range_offset());
-        WriteParam(m, p.file_range_length());
-        WriteParam(m, p.expected_file_modification_time());
-        break;
-      }
-      default: {
-        WriteParam(m, p.blob_url());
-        break;
-      }
-    }
-  }
-  static bool Read(const Message* m, void** iter, param_type* r) {
-    int type;
-    if (!ReadParam(m, iter, &type))
-      return false;
-    switch (type) {
-      case net::UploadData::TYPE_BYTES: {
-        const char* data;
-        int len;
-        if (!m->ReadData(iter, &data, &len))
-          return false;
-        r->SetToBytes(data, len);
-        break;
-      }
-      case net::UploadData::TYPE_CHUNK: {
-        const char* data;
-        int len;
-        if (!m->ReadData(iter, &data, &len))
-          return false;
-        r->SetToBytes(data, len);
-        // If this element is part of a chunk upload then we need to explicitly
-        // set the type of the element and whether it is the last chunk.
-        bool is_last_chunk = false;
-        if (!ReadParam(m, iter, &is_last_chunk))
-          return false;
-        r->set_type(net::UploadData::TYPE_CHUNK);
-        r->set_is_last_chunk(is_last_chunk);
-        break;
-      }
-      case net::UploadData::TYPE_FILE: {
-        FilePath file_path;
-        uint64 offset, length;
-        base::Time expected_modification_time;
-        if (!ReadParam(m, iter, &file_path))
-          return false;
-        if (!ReadParam(m, iter, &offset))
-          return false;
-        if (!ReadParam(m, iter, &length))
-          return false;
-        if (!ReadParam(m, iter, &expected_modification_time))
-          return false;
-        r->SetToFilePathRange(file_path, offset, length,
-                              expected_modification_time);
-        break;
-      }
-      default: {
-        DCHECK(type == net::UploadData::TYPE_BLOB);
-        GURL blob_url;
-        if (!ReadParam(m, iter, &blob_url))
-          return false;
-        r->SetToBlobUrl(blob_url);
-        break;
-      }
-    }
-    return true;
-  }
-  static void Log(const param_type& p, std::string* l) {
-    l->append("<net::UploadData::Element>");
-  }
-};
-
-void ParamTraits<scoped_refptr<net::UploadData> >::Write(Message* m,
-                                                         const param_type& p) {
-  WriteParam(m, p.get() != NULL);
-  if (p) {
-    WriteParam(m, *p->elements());
-    WriteParam(m, p->identifier());
-    WriteParam(m, p->is_chunked());
-  }
-}
-
-bool ParamTraits<scoped_refptr<net::UploadData> >::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;
-  std::vector<net::UploadData::Element> elements;
-  if (!ReadParam(m, iter, &elements))
-    return false;
-  int64 identifier;
-  if (!ReadParam(m, iter, &identifier))
-    return false;
-  bool is_chunked = false;
-  if (!ReadParam(m, iter, &is_chunked))
-    return false;
-  *r = new net::UploadData;
-  (*r)->swap_elements(&elements);
-  (*r)->set_identifier(identifier);
-  (*r)->set_is_chunked(is_chunked);
-  return true;
-}
-
-void ParamTraits<scoped_refptr<net::UploadData> >::Log(const param_type& p,
-                                                       std::string* l) {
-  l->append("<net::UploadData>");
-}
-
 void ParamTraits<ThumbnailScore>::Write(Message* m, const param_type& p) {
   IPC::ParamTraits<double>::Write(m, p.boring_score);
   IPC::ParamTraits<bool>::Write(m, p.good_clipping);
diff --git a/chrome/common/common_param_traits.h b/chrome/common/common_param_traits.h
index abeaa117..1a2e4e6c 100644
--- a/chrome/common/common_param_traits.h
+++ b/chrome/common/common_param_traits.h
@@ -19,7 +19,6 @@
 #include "chrome/common/content_settings.h"
 #include "chrome/common/page_zoom.h"
 #include "ipc/ipc_message_utils.h"
-#include "net/url_request/url_request_status.h"
 #include "printing/native_metafile.h"
 // !!! WARNING: DO NOT ADD NEW WEBKIT DEPENDENCIES !!!
 //
@@ -27,7 +26,7 @@
 // 'third_party/WebKit/'. Chrome Frame and NACL build parts of base/ and
 // chrome/common/ for a mini-library that doesn't depend on webkit.
 //
-// TODO(erg): The following two headers are historical and only work because
+// TODO(erg): The following headers are historical and only work because
 // their definitions are inlined, which also needs to be fixed.
 #include "ui/gfx/native_widget_types.h"
 #include "webkit/glue/webcursor.h"
@@ -48,12 +47,6 @@
 class Size;
 }  // namespace gfx
 
-namespace net {
-class HostPortPair;
-class UploadData;
-class URLRequestStatus;
-}
-
 namespace printing {
 struct PageRange;
 struct PrinterCapsAndDefaults;
@@ -253,33 +246,6 @@
 };
 #endif
 
-// Traits for HostPortPair
-template<>
-struct ParamTraits<net::HostPortPair> {
-  typedef net::HostPortPair 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 URLRequestStatus
-template <>
-struct ParamTraits<net::URLRequestStatus> {
-  typedef net::URLRequestStatus 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 net::UploadData.
-template <>
-struct ParamTraits<scoped_refptr<net::UploadData> > {
-  typedef scoped_refptr<net::UploadData> 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<ThumbnailScore> {
   typedef ThumbnailScore param_type;
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 @@
   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);
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index fa07f83..777abe5 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -40,20 +40,12 @@
 class Time;
 }
 
-namespace net {
-class HttpResponseHeaders;
-class UploadData;
-}
-
 namespace webkit_blob {
 class BlobData;
 }
 
 namespace webkit_glue {
 struct CustomContextMenuContext;
-struct ResourceDevToolsInfo;
-struct ResourceLoadTimingInfo;
-struct ResourceResponseInfo;
 struct WebAccessibility;
 struct WebCookie;
 }
@@ -74,42 +66,39 @@
 struct ContextMenuParams;
 struct EditCommand;
 struct RendererPreferences;
-struct ResourceResponseHead;
-struct SyncLoadResult;
 struct WebDropData;
 struct WebMenuItem;
 struct WebPreferences;
 
 // Forward declarations of structures used to store data for when we have a lot
 // of parameters.
-struct ViewMsg_Navigate_Params;
-struct ViewMsg_AudioStreamState_Params;
-struct ViewMsg_StopFinding_Params;
-struct ViewHostMsg_GetSearchProviderInstallState_Params;
-struct ViewHostMsg_PageHasOSDD_Type;
-struct ViewHostMsg_FrameNavigate_Params;
-struct ViewHostMsg_UpdateRect_Params;
-struct ViewMsg_ClosePage_Params;
-struct ViewHostMsg_Resource_Request;
-struct ViewMsg_Print_Params;
-struct ViewMsg_PrintPage_Params;
-struct ViewMsg_PrintPages_Params;
+struct ViewHostMsg_AccessibilityNotification_Params;
+struct ViewHostMsg_Audio_CreateStream_Params;
+struct ViewHostMsg_CreateWindow_Params;
+struct ViewHostMsg_CreateWorker_Params;
 struct ViewHostMsg_DidPreviewDocument_Params;
 struct ViewHostMsg_DidPrintPage_Params;
-struct ViewHostMsg_Audio_CreateStream_Params;
+struct ViewHostMsg_DomMessage_Params;
+struct ViewHostMsg_FrameNavigate_Params;
+struct ViewHostMsg_GetSearchProviderInstallState_Params;
+struct ViewHostMsg_MalwareDOMDetails_Params;
+struct ViewHostMsg_PageHasOSDD_Type;
+struct ViewHostMsg_RunFileChooser_Params;
+struct ViewHostMsg_ShowNotification_Params;
 struct ViewHostMsg_ShowPopup_Params;
 struct ViewHostMsg_ScriptedPrint_Params;
-struct ViewMsg_ExecuteCode_Params;
-struct ViewHostMsg_CreateWorker_Params;
-struct ViewHostMsg_ShowNotification_Params;
-struct ViewMsg_New_Params;
-struct ViewHostMsg_CreateWindow_Params;
-struct ViewHostMsg_RunFileChooser_Params;
-struct ViewMsg_ExtensionLoaded_Params;
+struct ViewHostMsg_UpdateRect_Params;
+struct ViewMsg_AudioStreamState_Params;
+struct ViewMsg_ClosePage_Params;
 struct ViewMsg_DeviceOrientationUpdated_Params;
-struct ViewHostMsg_DomMessage_Params;
-struct ViewHostMsg_AccessibilityNotification_Params;
-struct ViewHostMsg_MalwareDOMDetails_Params;
+struct ViewMsg_ExecuteCode_Params;
+struct ViewMsg_ExtensionLoaded_Params;
+struct ViewMsg_New_Params;
+struct ViewMsg_Navigate_Params;
+struct ViewMsg_Print_Params;
+struct ViewMsg_PrintPages_Params;
+struct ViewMsg_PrintPage_Params;
+struct ViewMsg_StopFinding_Params;
 
 // Values that may be OR'd together to form the 'flags' parameter of the
 // ViewMsg_EnablePreferredSizeChangedMode message.
@@ -186,56 +175,6 @@
   static void Log(const param_type& p, std::string* l);
 };
 
-template <>
-struct ParamTraits<scoped_refptr<net::HttpResponseHeaders> > {
-  typedef scoped_refptr<net::HttpResponseHeaders> 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::ResourceLoadTimingInfo
-template <>
-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::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::ResourceResponseInfo
-template <>
-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);
-  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);
-  static bool Read(const Message* m, void** iter, param_type* r);
-  static void Log(const param_type& p, std::string* l);
-};
-
 // Traits for reading/writing CSS Colors
 template <>
 struct ParamTraits<CSSColors::CSSColorName> {
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index 2aabd92..90d8717f 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -325,51 +325,6 @@
                     int, /* request id */
                     bool /* whether the script ran successfully */)
 
-// Sent when the headers are available for a resource request.
-IPC_MESSAGE_ROUTED2(ViewMsg_Resource_ReceivedResponse,
-                    int /* request_id */,
-                    ResourceResponseHead)
-
-// Sent when cached metadata from a resource request is ready.
-IPC_MESSAGE_ROUTED2(ViewMsg_Resource_ReceivedCachedMetadata,
-                    int /* request_id */,
-                    std::vector<char> /* data */)
-
-// Sent as upload progress is being made.
-IPC_MESSAGE_ROUTED3(ViewMsg_Resource_UploadProgress,
-                    int /* request_id */,
-                    int64 /* position */,
-                    int64 /* size */)
-
-// Sent when the request has been redirected.  The receiver is expected to
-// respond with either a FollowRedirect message (if the redirect is to be
-// followed) or a CancelRequest message (if it should not be followed).
-IPC_MESSAGE_ROUTED3(ViewMsg_Resource_ReceivedRedirect,
-                    int /* request_id */,
-                    GURL /* new_url */,
-                    ResourceResponseHead)
-
-// Sent when some data from a resource request is ready. The handle should
-// already be mapped into the process that receives this message.
-IPC_MESSAGE_ROUTED3(ViewMsg_Resource_DataReceived,
-                    int /* request_id */,
-                    base::SharedMemoryHandle /* data */,
-                    int /* data_len */)
-
-// Sent when some data from a resource request has been downloaded to
-// file. This is only called in the 'download_to_file' case and replaces
-// ViewMsg_Resource_DataReceived in the call sequence in that case.
-IPC_MESSAGE_ROUTED2(ViewMsg_Resource_DataDownloaded,
-                    int /* request_id */,
-                    int /* data_len */)
-
-// Sent when the request has been completed.
-IPC_MESSAGE_ROUTED4(ViewMsg_Resource_RequestComplete,
-                    int /* request_id */,
-                    net::URLRequestStatus /* status */,
-                    std::string /* security info */,
-                    base::Time /* completion_time */)
-
 // Sent when user prompting is required before a ViewHostMsg_GetCookies
 // message can complete.  This message indicates that the renderer should
 // pump messages while waiting for cookies.
@@ -1279,28 +1234,6 @@
                     int /* active_match_ordinal */,
                     bool /* final_update */)
 
-// Makes a resource request via the browser.
-IPC_MESSAGE_ROUTED2(ViewHostMsg_RequestResource,
-                    int /* request_id */,
-                    ViewHostMsg_Resource_Request)
-
-// Cancels a resource request with the ID given as the parameter.
-IPC_MESSAGE_ROUTED1(ViewHostMsg_CancelRequest,
-                    int /* request_id */)
-
-// Follows a redirect that occured for the resource request with the ID given
-// as the parameter.
-IPC_MESSAGE_ROUTED3(ViewHostMsg_FollowRedirect,
-                    int /* request_id */,
-                    bool /* has_new_first_party_for_cookies */,
-                    GURL /* new_first_party_for_cookies */)
-
-// Makes a synchronous resource request via the browser.
-IPC_SYNC_MESSAGE_ROUTED2_1(ViewHostMsg_SyncLoad,
-                           int /* request_id */,
-                           ViewHostMsg_Resource_Request,
-                           SyncLoadResult)
-
 // Used to set a cookie. The cookie is set asynchronously, but will be
 // available to a subsequent ViewHostMsg_GetCookies request.
 IPC_MESSAGE_ROUTED3(ViewHostMsg_SetCookie,
@@ -1843,33 +1776,15 @@
 IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetCPBrowsingContext,
                             uint32 /* context */)
 
-// Sent when the renderer process is done processing a DataReceived
-// message.
-IPC_MESSAGE_ROUTED1(ViewHostMsg_DataReceived_ACK,
-                    int /* request_id */)
-
 IPC_MESSAGE_CONTROL1(ViewHostMsg_RevealFolderInOS,
                      FilePath /* path */)
 
-// Sent when the renderer has processed a DataDownloaded message.
-IPC_MESSAGE_ROUTED1(ViewHostMsg_DataDownloaded_ACK,
-                    int /* request_id */)
-
-// Sent when the renderer process deletes a resource loader.
-IPC_MESSAGE_CONTROL1(ViewHostMsg_ReleaseDownloadedFile,
-                     int /* request_id */)
-
 // Sent when a provisional load on the main frame redirects.
 IPC_MESSAGE_ROUTED3(ViewHostMsg_DidRedirectProvisionalLoad,
                     int /* page_id */,
                     GURL /* last url */,
                     GURL /* url redirected to */)
 
-// Sent by the renderer process to acknowledge receipt of a
-// UploadProgress message.
-IPC_MESSAGE_ROUTED1(ViewHostMsg_UploadProgress_ACK,
-                    int /* request_id */)
-
 // Sent when the renderer changes the zoom level for a particular url, so the
 // browser can update its records.  If remember is true, then url is used to
 // update the zoom level for all pages in that site.  Otherwise, the render
diff --git a/chrome/common/render_messages_params.cc b/chrome/common/render_messages_params.cc
index 149e521..336d67b 100644
--- a/chrome/common/render_messages_params.cc
+++ b/chrome/common/render_messages_params.cc
@@ -59,21 +59,6 @@
 ViewMsg_ClosePage_Params::~ViewMsg_ClosePage_Params() {
 }
 
-ViewHostMsg_Resource_Request::ViewHostMsg_Resource_Request()
-    : load_flags(0),
-      origin_pid(0),
-      resource_type(ResourceType::MAIN_FRAME),
-      request_context(0),
-      appcache_host_id(0),
-      download_to_file(false),
-      has_user_gesture(false),
-      host_renderer_id(0),
-      host_render_view_id(0) {
-}
-
-ViewHostMsg_Resource_Request::~ViewHostMsg_Resource_Request() {
-}
-
 ViewMsg_Print_Params::ViewMsg_Print_Params()
     : margin_top(0),
       margin_left(0),
@@ -390,46 +375,6 @@
   }
 };
 
-template <>
-struct ParamTraits<ResourceType::Type> {
-  typedef ResourceType::Type param_type;
-  static void Write(Message* m, const param_type& p) {
-    m->WriteInt(p);
-  }
-  static bool Read(const Message* m, void** iter, param_type* p) {
-    int type;
-    if (!m->ReadInt(iter, &type) || !ResourceType::ValidType(type))
-      return false;
-    *p = ResourceType::FromInt(type);
-    return true;
-  }
-  static void Log(const param_type& p, std::string* l) {
-    std::string type;
-    switch (p) {
-      case ResourceType::MAIN_FRAME:
-        type = "MAIN_FRAME";
-        break;
-      case ResourceType::SUB_FRAME:
-        type = "SUB_FRAME";
-        break;
-      case ResourceType::SUB_RESOURCE:
-        type = "SUB_RESOURCE";
-        break;
-      case ResourceType::OBJECT:
-        type = "OBJECT";
-        break;
-      case ResourceType::MEDIA:
-        type = "MEDIA";
-        break;
-      default:
-        type = "UNKNOWN";
-        break;
-    }
-
-    LogParam(type, l);
-  }
-};
-
 template<>
 struct ParamTraits<NavigationGesture> {
   typedef NavigationGesture param_type;
@@ -937,75 +882,6 @@
   l->append(")");
 }
 
-void ParamTraits<ViewHostMsg_Resource_Request>::Write(Message* m,
-                                                      const param_type& p) {
-  WriteParam(m, p.method);
-  WriteParam(m, p.url);
-  WriteParam(m, p.first_party_for_cookies);
-  WriteParam(m, p.referrer);
-  WriteParam(m, p.headers);
-  WriteParam(m, p.load_flags);
-  WriteParam(m, p.origin_pid);
-  WriteParam(m, p.resource_type);
-  WriteParam(m, p.request_context);
-  WriteParam(m, p.appcache_host_id);
-  WriteParam(m, p.upload_data);
-  WriteParam(m, p.download_to_file);
-  WriteParam(m, p.has_user_gesture);
-  WriteParam(m, p.host_renderer_id);
-  WriteParam(m, p.host_render_view_id);
-}
-
-bool ParamTraits<ViewHostMsg_Resource_Request>::Read(const Message* m,
-                                                     void** iter,
-                                                     param_type* r) {
-  return
-      ReadParam(m, iter, &r->method) &&
-      ReadParam(m, iter, &r->url) &&
-      ReadParam(m, iter, &r->first_party_for_cookies) &&
-      ReadParam(m, iter, &r->referrer) &&
-      ReadParam(m, iter, &r->headers) &&
-      ReadParam(m, iter, &r->load_flags) &&
-      ReadParam(m, iter, &r->origin_pid) &&
-      ReadParam(m, iter, &r->resource_type) &&
-      ReadParam(m, iter, &r->request_context) &&
-      ReadParam(m, iter, &r->appcache_host_id) &&
-      ReadParam(m, iter, &r->upload_data) &&
-      ReadParam(m, iter, &r->download_to_file) &&
-      ReadParam(m, iter, &r->has_user_gesture) &&
-      ReadParam(m, iter, &r->host_renderer_id) &&
-      ReadParam(m, iter, &r->host_render_view_id);
-}
-
-void ParamTraits<ViewHostMsg_Resource_Request>::Log(const param_type& p,
-                                                    std::string* l) {
-  l->append("(");
-  LogParam(p.method, l);
-  l->append(", ");
-  LogParam(p.url, l);
-  l->append(", ");
-  LogParam(p.referrer, l);
-  l->append(", ");
-  LogParam(p.load_flags, l);
-  l->append(", ");
-  LogParam(p.origin_pid, l);
-  l->append(", ");
-  LogParam(p.resource_type, l);
-  l->append(", ");
-  LogParam(p.request_context, l);
-  l->append(", ");
-  LogParam(p.appcache_host_id, l);
-  l->append(", ");
-  LogParam(p.download_to_file, l);
-  l->append(", ");
-  LogParam(p.has_user_gesture, l);
-  l->append(", ");
-  LogParam(p.host_renderer_id, l);
-  l->append(", ");
-  LogParam(p.host_render_view_id, l);
-  l->append(")");
-}
-
 void ParamTraits<ViewMsg_Print_Params>::Write(Message* m, const param_type& p) {
   WriteParam(m, p.page_size);
   WriteParam(m, p.printable_size);
diff --git a/chrome/common/render_messages_params.h b/chrome/common/render_messages_params.h
index 00998af..d698ca5b 100644
--- a/chrome/common/render_messages_params.h
+++ b/chrome/common/render_messages_params.h
@@ -33,7 +33,6 @@
 #include "ui/gfx/rect.h"
 #include "ui/gfx/size.h"
 #include "webkit/glue/password_form.h"
-#include "webkit/glue/resource_type.h"
 #include "webkit/glue/webaccessibility.h"
 #include "webkit/glue/webmenuitem.h"
 #include "webkit/glue/webpreferences.h"
@@ -428,66 +427,6 @@
   int new_request_id;
 };
 
-// Parameters for a resource request.
-struct ViewHostMsg_Resource_Request {
-  ViewHostMsg_Resource_Request();
-  ~ViewHostMsg_Resource_Request();
-
-  // The request method: GET, POST, etc.
-  std::string method;
-
-  // The requested URL.
-  GURL url;
-
-  // Usually the URL of the document in the top-level window, which may be
-  // checked by the third-party cookie blocking policy. Leaving it empty may
-  // lead to undesired cookie blocking. Third-party cookie blocking can be
-  // bypassed by setting first_party_for_cookies = url, but this should ideally
-  // only be done if there really is no way to determine the correct value.
-  GURL first_party_for_cookies;
-
-  // The referrer to use (may be empty).
-  GURL referrer;
-
-  // Additional HTTP request headers.
-  std::string headers;
-
-  // net::URLRequest load flags (0 by default).
-  int load_flags;
-
-  // Process ID from which this request originated, or zero if it originated
-  // in the renderer itself.
-  int origin_pid;
-
-  // What this resource load is for (main frame, sub-frame, sub-resource,
-  // object).
-  ResourceType::Type resource_type;
-
-  // Used by plugin->browser requests to get the correct net::URLRequestContext.
-  uint32 request_context;
-
-  // Indicates which frame (or worker context) the request is being loaded into,
-  // or kNoHostId.
-  int appcache_host_id;
-
-  // Optional upload data (may be null).
-  scoped_refptr<net::UploadData> upload_data;
-
-  bool download_to_file;
-
-  // True if the request was user initiated.
-  bool has_user_gesture;
-
-  // The following two members are specified if the request is initiated by
-  // a plugin like Gears.
-
-  // Contains the id of the host renderer.
-  int host_renderer_id;
-
-  // Contains the id of the host render view.
-  int host_render_view_id;
-};
-
 // Parameters for a render request.
 struct ViewMsg_Print_Params {
   ViewMsg_Print_Params();
@@ -1028,14 +967,6 @@
 };
 
 template <>
-struct ParamTraits<ViewHostMsg_Resource_Request> {
-  typedef ViewHostMsg_Resource_Request 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<ViewMsg_Print_Params> {
   typedef ViewMsg_Print_Params param_type;
   static void Write(Message* m, const param_type& p);
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index 18d0f68..f6b19668 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -12,10 +12,9 @@
 #include "base/message_loop.h"
 #include "base/shared_memory.h"
 #include "base/string_util.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 "content/common/resource_response.h"
+#include "content/common/resource_messages.h"
 #include "net/base/net_errors.h"
 #include "net/base/net_util.h"
 #include "net/base/upload_data.h"
@@ -67,7 +66,7 @@
 
   // The request to send, created on initialization for modification and
   // appending data.
-  ViewHostMsg_Resource_Request request_;
+  ResourceHostMsg_Request request_;
 
   // ID for the request, valid once Start()ed, -1 if not valid yet.
   int request_id_;
@@ -123,7 +122,7 @@
 
     if (request_.download_to_file) {
       dispatcher_->message_sender()->Send(
-          new ViewHostMsg_ReleaseDownloadedFile(request_id_));
+          new ResourceHostMsg_ReleaseDownloadedFile(request_id_));
     }
   }
 }
@@ -182,7 +181,7 @@
       peer_, request_.resource_type, request_.url);
 
   return dispatcher_->message_sender()->Send(
-      new ViewHostMsg_RequestResource(routing_id_, request_id_, request_));
+      new ResourceHostMsg_RequestResource(routing_id_, request_id_, request_));
 }
 
 void IPCResourceLoaderBridge::Cancel() {
@@ -217,8 +216,8 @@
   request_id_ = MakeRequestID();
 
   SyncLoadResult result;
-  IPC::SyncMessage* msg = new ViewHostMsg_SyncLoad(routing_id_, request_id_,
-                                                   request_, &result);
+  IPC::SyncMessage* msg = new ResourceHostMsg_SyncLoad(routing_id_, request_id_,
+                                                       request_, &result);
   // NOTE: This may pump events (see RenderThread::Send).
   if (!dispatcher_->message_sender()->Send(msg)) {
     response->status.set_status(net::URLRequestStatus::FAILED);
@@ -317,7 +316,7 @@
 
   // Acknowledge receipt
   message_sender()->Send(
-      new ViewHostMsg_UploadProgress_ACK(message.routing_id(), request_id));
+      new ResourceHostMsg_UploadProgress_ACK(message.routing_id(), request_id));
 }
 
 void ResourceDispatcher::OnReceivedResponse(
@@ -350,7 +349,7 @@
                                         int data_len) {
   // Acknowledge the reception of this data.
   message_sender()->Send(
-      new ViewHostMsg_DataReceived_ACK(message.routing_id(), request_id));
+      new ResourceHostMsg_DataReceived_ACK(message.routing_id(), request_id));
 
   const bool shm_valid = base::SharedMemory::IsHandleValid(shm_handle);
   DCHECK((shm_valid && data_len > 0) || (!shm_valid && !data_len));
@@ -371,7 +370,7 @@
                                           int data_len) {
   // Acknowledge the reception of this message.
   message_sender()->Send(
-      new ViewHostMsg_DataDownloaded_ACK(message.routing_id(), request_id));
+      new ResourceHostMsg_DataDownloaded_ACK(message.routing_id(), request_id));
 
   PendingRequestInfo* request_info = GetPendingRequestInfo(request_id);
   if (!request_info)
@@ -401,9 +400,9 @@
     if (!request_info)
       return;
     request_info->pending_redirect_message.reset(
-        new ViewHostMsg_FollowRedirect(routing_id, request_id,
-                                       has_new_first_party_for_cookies,
-                                       new_first_party_for_cookies));
+        new ResourceHostMsg_FollowRedirect(routing_id, request_id,
+                                           has_new_first_party_for_cookies,
+                                           new_first_party_for_cookies));
     if (!request_info->is_deferred) {
       FollowPendingRedirect(request_id, *request_info);
     }
@@ -488,7 +487,7 @@
   pending_requests_.erase(it);
 
   message_sender()->Send(
-      new ViewHostMsg_CancelRequest(routing_id, request_id));
+      new ResourceHostMsg_CancelRequest(routing_id, request_id));
 }
 
 void ResourceDispatcher::SetDefersLoading(int request_id, bool value) {
@@ -513,14 +512,14 @@
 
 void ResourceDispatcher::DispatchMessage(const IPC::Message& message) {
   IPC_BEGIN_MESSAGE_MAP(ResourceDispatcher, message)
-    IPC_MESSAGE_HANDLER(ViewMsg_Resource_UploadProgress, OnUploadProgress)
-    IPC_MESSAGE_HANDLER(ViewMsg_Resource_ReceivedResponse, OnReceivedResponse)
-    IPC_MESSAGE_HANDLER(
-        ViewMsg_Resource_ReceivedCachedMetadata, OnReceivedCachedMetadata)
-    IPC_MESSAGE_HANDLER(ViewMsg_Resource_ReceivedRedirect, OnReceivedRedirect)
-    IPC_MESSAGE_HANDLER(ViewMsg_Resource_DataReceived, OnReceivedData)
-    IPC_MESSAGE_HANDLER(ViewMsg_Resource_DataDownloaded, OnDownloadedData)
-    IPC_MESSAGE_HANDLER(ViewMsg_Resource_RequestComplete, OnRequestComplete)
+    IPC_MESSAGE_HANDLER(ResourceMsg_UploadProgress, OnUploadProgress)
+    IPC_MESSAGE_HANDLER(ResourceMsg_ReceivedResponse, OnReceivedResponse)
+    IPC_MESSAGE_HANDLER(ResourceMsg_ReceivedCachedMetadata,
+                        OnReceivedCachedMetadata)
+    IPC_MESSAGE_HANDLER(ResourceMsg_ReceivedRedirect, OnReceivedRedirect)
+    IPC_MESSAGE_HANDLER(ResourceMsg_DataReceived, OnReceivedData)
+    IPC_MESSAGE_HANDLER(ResourceMsg_DataDownloaded, OnDownloadedData)
+    IPC_MESSAGE_HANDLER(ResourceMsg_RequestComplete, OnRequestComplete)
   IPC_END_MESSAGE_MAP()
 }
 
@@ -567,13 +566,13 @@
 bool ResourceDispatcher::IsResourceDispatcherMessage(
     const IPC::Message& message) {
   switch (message.type()) {
-    case ViewMsg_Resource_UploadProgress::ID:
-    case ViewMsg_Resource_ReceivedResponse::ID:
-    case ViewMsg_Resource_ReceivedCachedMetadata::ID:
-    case ViewMsg_Resource_ReceivedRedirect::ID:
-    case ViewMsg_Resource_DataReceived::ID:
-    case ViewMsg_Resource_DataDownloaded::ID:
-    case ViewMsg_Resource_RequestComplete::ID:
+    case ResourceMsg_UploadProgress::ID:
+    case ResourceMsg_ReceivedResponse::ID:
+    case ResourceMsg_ReceivedCachedMetadata::ID:
+    case ResourceMsg_ReceivedRedirect::ID:
+    case ResourceMsg_DataReceived::ID:
+    case ResourceMsg_DataDownloaded::ID:
+    case ResourceMsg_RequestComplete::ID:
       return true;
 
     default:
@@ -595,7 +594,7 @@
 
   // If the message contains a shared memory handle, we should close the
   // handle or there will be a memory leak.
-  if (message.type() == ViewMsg_Resource_DataReceived::ID) {
+  if (message.type() == ResourceMsg_DataReceived::ID) {
     base::SharedMemoryHandle shm_handle;
     if (IPC::ParamTraits<base::SharedMemoryHandle>::Read(&message,
                                                          &iter,
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index c960edf..6bdd72d 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -12,7 +12,8 @@
 #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 "content/common/resource_response.h"
+#include "content/common/resource_messages.h"
 #include "net/base/upload_data.h"
 #include "net/http/http_response_headers.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -99,8 +100,8 @@
   void ProcessMessages() {
     while (!message_queue_.empty()) {
       int request_id;
-      ViewHostMsg_Resource_Request request;
-      ASSERT_TRUE(ViewHostMsg_RequestResource::Read(
+      ResourceHostMsg_Request request;
+      ASSERT_TRUE(ResourceHostMsg_RequestResource::Read(
           &message_queue_[0], &request_id, &request));
 
       // check values
@@ -130,7 +131,7 @@
 
       // read the ack message.
       Tuple1<int> request_ack;
-      ASSERT_TRUE(ViewHostMsg_DataReceived_ACK::Read(
+      ASSERT_TRUE(ResourceHostMsg_DataReceived_ACK::Read(
           &message_queue_[0], &request_ack));
 
       ASSERT_EQ(request_ack.a, request_id);
@@ -230,7 +231,7 @@
     response_head.status.set_status(net::URLRequestStatus::SUCCESS);
 
     IPC::Message* response_message =
-        new ViewMsg_Resource_ReceivedResponse(0, 0, response_head);
+        new ResourceMsg_ReceivedResponse(0, 0, response_head);
 
     dispatcher_->OnMessageReceived(*response_message);
 
@@ -243,7 +244,7 @@
                                               &duplicated_handle));
 
     response_message =
-        new ViewMsg_Resource_DataReceived(0, 0, duplicated_handle, 100);
+        new ResourceMsg_DataReceived(0, 0, duplicated_handle, 100);
 
     dispatcher_->OnMessageReceived(*response_message);
 
diff --git a/chrome/common/resource_response.cc b/chrome/common/resource_response.cc
deleted file mode 100644
index ab4bdfe..0000000
--- a/chrome/common/resource_response.cc
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/resource_response.h"
-
-ResourceResponseHead::ResourceResponseHead() {
-}
-
-ResourceResponseHead::~ResourceResponseHead() {}
-
-SyncLoadResult::SyncLoadResult() {}
-
-SyncLoadResult::~SyncLoadResult() {}
-
-ResourceResponse::ResourceResponse() {}
-
-ResourceResponse::~ResourceResponse() {}
diff --git a/chrome/renderer/render_thread.cc b/chrome/renderer/render_thread.cc
index 31771cd..5b68787 100644
--- a/chrome/renderer/render_thread.cc
+++ b/chrome/renderer/render_thread.cc
@@ -38,13 +38,6 @@
 #include "chrome/common/url_constants.h"
 #include "chrome/common/web_database_observer_impl.h"
 #include "chrome/plugin/npobject_util.h"
-// TODO(port)
-#if defined(OS_WIN)
-#include "chrome/plugin/plugin_channel.h"
-#else
-#include "base/scoped_handle.h"
-#include "chrome/plugin/plugin_channel_base.h"
-#endif
 #include "chrome/renderer/automation/dom_automation_v8_extension.h"
 #include "chrome/renderer/cookie_message_filter.h"
 #include "chrome/renderer/devtools_agent_filter.h"
@@ -72,8 +65,8 @@
 #include "chrome/renderer/searchbox_extension.h"
 #include "chrome/renderer/spellchecker/spellcheck.h"
 #include "chrome/renderer/user_script_slave.h"
+#include "content/common/resource_messages.h"
 #include "ipc/ipc_channel_handle.h"
-#include "ipc/ipc_message.h"
 #include "ipc/ipc_platform_file.h"
 #include "net/base/net_util.h"
 #include "third_party/sqlite/sqlite3.h"
@@ -98,6 +91,14 @@
 #include "webkit/glue/webkit_glue.h"
 #include "v8/include/v8.h"
 
+// TODO(port)
+#if defined(OS_WIN)
+#include "chrome/plugin/plugin_channel.h"
+#else
+#include "base/scoped_handle.h"
+#include "chrome/plugin/plugin_channel_base.h"
+#endif
+
 #if defined(OS_WIN)
 #include <windows.h>
 #include <objbase.h>
@@ -354,7 +355,7 @@
         case ViewHostMsg_GetRawCookies::ID:
         case ViewHostMsg_CookiesEnabled::ID:
         case DOMStorageHostMsg_SetItem::ID:
-        case ViewHostMsg_SyncLoad::ID:
+        case ResourceHostMsg_SyncLoad::ID:
         case DatabaseHostMsg_Allow::ID:
           may_show_cookie_prompt = true;
           pumping_events = true;
diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
index 9fd9a7da..06c6164f 100644
--- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
+++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.cc
@@ -13,12 +13,13 @@
 #include "chrome/common/main_function_params.h"
 #include "chrome/common/render_messages.h"
 #include "chrome/common/render_messages_params.h"
-#include "chrome/common/resource_response.h"
 #include "chrome/common/sandbox_init_wrapper.h"
 #include "chrome/renderer/mock_render_process.h"
 #include "chrome/renderer/render_thread.h"
 #include "chrome/renderer/render_view.h"
 #include "chrome/renderer/renderer_main_platform_delegate.h"
+#include "content/common/resource_messages.h"
+#include "content/common/resource_response.h"
 #include "googleurl/src/gurl.h"
 #include "net/base/upload_data.h"
 #include "net/http/http_response_headers.h"
@@ -42,7 +43,7 @@
   IPC_BEGIN_MESSAGE_MAP(RenderViewFakeResourcesTest, message)
     IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewReady, OnRenderViewReady)
     IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopLoading, OnDidStopLoading)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_RequestResource, OnRequestResource)
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_RequestResource, OnRequestResource)
   IPC_END_MESSAGE_MAP()
   return true;
 }
@@ -139,7 +140,7 @@
 void RenderViewFakeResourcesTest::OnRequestResource(
     const IPC::Message& message,
     int request_id,
-    const ViewHostMsg_Resource_Request& request_data) {
+    const ResourceHostMsg_Request& request_data) {
   std::string headers, body;
   std::map<std::string, std::string>::const_iterator it =
       responses_.find(request_data.url.spec());
@@ -154,7 +155,7 @@
   ResourceResponseHead response_head;
   response_head.headers = new net::HttpResponseHeaders(headers);
   response_head.mime_type = "text/html";
-  ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_ReceivedResponse(
+  ASSERT_TRUE(channel_->Send(new ResourceMsg_ReceivedResponse(
       message.routing_id(), request_id, response_head)));
 
   base::SharedMemory shared_memory;
@@ -164,10 +165,10 @@
   base::SharedMemoryHandle handle;
   ASSERT_TRUE(shared_memory.GiveToProcess(base::Process::Current().handle(),
                                           &handle));
-  ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_DataReceived(
+  ASSERT_TRUE(channel_->Send(new ResourceMsg_DataReceived(
       message.routing_id(), request_id, handle, body.size())));
 
-  ASSERT_TRUE(channel_->Send(new ViewMsg_Resource_RequestComplete(
+  ASSERT_TRUE(channel_->Send(new ResourceMsg_RequestComplete(
       message.routing_id(),
       request_id,
       net::URLRequestStatus(),
diff --git a/chrome/renderer/safe_browsing/render_view_fake_resources_test.h b/chrome/renderer/safe_browsing/render_view_fake_resources_test.h
index 6b05e99..34e964b 100644
--- a/chrome/renderer/safe_browsing/render_view_fake_resources_test.h
+++ b/chrome/renderer/safe_browsing/render_view_fake_resources_test.h
@@ -58,7 +58,7 @@
 class RenderView;
 class SandboxInitWrapper;
 struct MainFunctionParams;
-struct ViewHostMsg_Resource_Request;
+struct ResourceHostMsg_Request;
 
 namespace WebKit {
 class WebFrame;
@@ -111,7 +111,7 @@
   // and the supplied content, otherwise we send it a 404 error.
   void OnRequestResource(const IPC::Message& message,
                          int request_id,
-                         const ViewHostMsg_Resource_Request& request_data);
+                         const ResourceHostMsg_Request& request_data);
 
   // Notification that the render view we've created is ready to use.
   void OnRenderViewReady();
diff --git a/content/browser/plugin_process_host.cc b/content/browser/plugin_process_host.cc
index 4d1301a..355ce0e 100644
--- a/content/browser/plugin_process_host.cc
+++ b/content/browser/plugin_process_host.cc
@@ -38,6 +38,7 @@
 #include "content/browser/plugin_service.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_message_filter.h"
+#include "content/common/resource_messages.h"
 #include "ipc/ipc_switches.h"
 #include "net/base/cookie_store.h"
 #include "net/base/io_buffer.h"
@@ -70,7 +71,7 @@
   }
 
   virtual net::URLRequestContext* GetRequestContext(
-      const ViewHostMsg_Resource_Request& resource_request) {
+      const ResourceHostMsg_Request& resource_request) {
     return CPBrowsingContextManager::GetInstance()->ToURLRequestContext(
         resource_request.request_context);
   }
diff --git a/content/browser/renderer_host/async_resource_handler.cc b/content/browser/renderer_host/async_resource_handler.cc
index 937f120..fb7b8d9d 100644
--- a/content/browser/renderer_host/async_resource_handler.cc
+++ b/content/browser/renderer_host/async_resource_handler.cc
@@ -14,11 +14,12 @@
 #include "chrome/browser/net/chrome_url_request_context.h"
 #include "chrome/browser/net/load_timing_observer.h"
 #include "chrome/common/render_messages.h"
-#include "chrome/common/resource_response.h"
 #include "content/browser/renderer_host/global_request_id.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
 #include "content/browser/renderer_host/resource_message_filter.h"
+#include "content/common/resource_response.h"
+#include "content/common/resource_messages.h"
 #include "net/base/io_buffer.h"
 #include "net/base/load_flags.h"
 #include "net/base/net_log.h"
@@ -91,9 +92,8 @@
 bool AsyncResourceHandler::OnUploadProgress(int request_id,
                                             uint64 position,
                                             uint64 size) {
-  return filter_->Send(new ViewMsg_Resource_UploadProgress(routing_id_,
-                                                           request_id,
-                                                           position, size));
+  return filter_->Send(new ResourceMsg_UploadProgress(routing_id_, request_id,
+                                                      position, size));
 }
 
 bool AsyncResourceHandler::OnRequestRedirected(int request_id,
@@ -105,7 +105,7 @@
       GlobalRequestID(filter_->child_id(), request_id));
   LoadTimingObserver::PopulateTimingInfo(request, response);
   DevToolsNetLogObserver::PopulateResponseInfo(request, response);
-  return filter_->Send(new ViewMsg_Resource_ReceivedRedirect(
+  return filter_->Send(new ResourceMsg_ReceivedRedirect(
       routing_id_, request_id, new_url, response->response_head));
 }
 
@@ -137,14 +137,14 @@
     }
   }
 
-  filter_->Send(new ViewMsg_Resource_ReceivedResponse(
+  filter_->Send(new ResourceMsg_ReceivedResponse(
       routing_id_, request_id, response->response_head));
 
   if (request->response_info().metadata) {
     std::vector<char> copy(request->response_info().metadata->data(),
                            request->response_info().metadata->data() +
                            request->response_info().metadata->size());
-    filter_->Send(new ViewMsg_Resource_ReceivedCachedMetadata(
+    filter_->Send(new ResourceMsg_ReceivedCachedMetadata(
         routing_id_, request_id, copy));
   }
 
@@ -215,7 +215,7 @@
   // We just unmapped the memory.
   read_buffer_ = NULL;
 
-  filter_->Send(new ViewMsg_Resource_DataReceived(
+  filter_->Send(new ResourceMsg_DataReceived(
       routing_id_, request_id, handle, *bytes_read));
 
   return true;
@@ -223,7 +223,7 @@
 
 void AsyncResourceHandler::OnDataDownloaded(
     int request_id, int bytes_downloaded) {
-  filter_->Send(new ViewMsg_Resource_DataDownloaded(
+  filter_->Send(new ResourceMsg_DataDownloaded(
       routing_id_, request_id, bytes_downloaded));
 }
 
@@ -232,11 +232,11 @@
     const net::URLRequestStatus& status,
     const std::string& security_info) {
   Time completion_time = Time::Now();
-  filter_->Send(new ViewMsg_Resource_RequestComplete(routing_id_,
-                                                     request_id,
-                                                     status,
-                                                     security_info,
-                                                     completion_time));
+  filter_->Send(new ResourceMsg_RequestComplete(routing_id_,
+                                                request_id,
+                                                status,
+                                                security_info,
+                                                completion_time));
 
   // If we still have a read buffer, then see about caching it for later...
   // Note that we have to make sure the buffer is not still being used, so we
diff --git a/content/browser/renderer_host/buffered_resource_handler.cc b/content/browser/renderer_host/buffered_resource_handler.cc
index 4923ca75..570d933 100644
--- a/content/browser/renderer_host/buffered_resource_handler.cc
+++ b/content/browser/renderer_host/buffered_resource_handler.cc
@@ -11,12 +11,12 @@
 #include "base/string_util.h"
 #include "chrome/browser/renderer_host/download_throttling_resource_handler.h"
 #include "chrome/common/extensions/user_script.h"
-#include "chrome/common/resource_response.h"
 #include "chrome/common/url_constants.h"
 #include "content/browser/browser_thread.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
 #include "content/browser/renderer_host/x509_user_cert_resource_handler.h"
+#include "content/common/resource_response.h"
 #include "net/base/io_buffer.h"
 #include "net/base/mime_sniffer.h"
 #include "net/base/mime_util.h"
diff --git a/content/browser/renderer_host/redirect_to_file_resource_handler.cc b/content/browser/renderer_host/redirect_to_file_resource_handler.cc
index bb18a4a..952a896 100644
--- a/content/browser/renderer_host/redirect_to_file_resource_handler.cc
+++ b/content/browser/renderer_host/redirect_to_file_resource_handler.cc
@@ -9,8 +9,8 @@
 #include "base/logging.h"
 #include "base/platform_file.h"
 #include "base/task.h"
-#include "chrome/common/resource_response.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
+#include "content/common/resource_response.h"
 #include "net/base/file_stream.h"
 #include "net/base/io_buffer.h"
 #include "net/base/mime_sniffer.h"
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index 869c92d..6ed17f1 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -61,6 +61,7 @@
 #include "content/browser/renderer_host/resource_request_details.h"
 #include "content/browser/renderer_host/sync_resource_handler.h"
 #include "content/browser/worker_host/worker_service.h"
+#include "content/common/resource_messages.h"
 #include "net/base/auth.h"
 #include "net/base/cert_status_flags.h"
 #include "net/base/cookie_monster.h"
@@ -126,7 +127,7 @@
 // if the renderer is attempting to upload an unauthorized file.
 bool ShouldServiceRequest(ChildProcessInfo::ProcessType process_type,
                           int child_id,
-                          const ViewHostMsg_Resource_Request& request_data)  {
+                          const ResourceHostMsg_Request& request_data)  {
   if (process_type == ChildProcessInfo::PLUGIN_PROCESS)
     return true;
 
@@ -312,15 +313,15 @@
   filter_ = filter;
   bool handled = true;
   IPC_BEGIN_MESSAGE_MAP_EX(ResourceDispatcherHost, message, *message_was_ok)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_RequestResource, OnRequestResource)
-    IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_SyncLoad, OnSyncLoad)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_ReleaseDownloadedFile,
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_RequestResource, OnRequestResource)
+    IPC_MESSAGE_HANDLER_DELAY_REPLY(ResourceHostMsg_SyncLoad, OnSyncLoad)
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_ReleaseDownloadedFile,
                         OnReleaseDownloadedFile)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_DataReceived_ACK, OnDataReceivedACK)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_DataDownloaded_ACK, OnDataDownloadedACK)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_UploadProgress_ACK, OnUploadProgressACK)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_CancelRequest, OnCancelRequest)
-    IPC_MESSAGE_HANDLER(ViewHostMsg_FollowRedirect, OnFollowRedirect)
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_DataReceived_ACK, OnDataReceivedACK)
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_DataDownloaded_ACK, OnDataDownloadedACK)
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_UploadProgress_ACK, OnUploadProgressACK)
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_CancelRequest, OnCancelRequest)
+    IPC_MESSAGE_HANDLER(ResourceHostMsg_FollowRedirect, OnFollowRedirect)
     IPC_MESSAGE_HANDLER(ViewHostMsg_ClosePage_ACK, OnClosePageACK)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP_EX()
@@ -332,7 +333,7 @@
 void ResourceDispatcherHost::OnRequestResource(
     const IPC::Message& message,
     int request_id,
-    const ViewHostMsg_Resource_Request& request_data) {
+    const ResourceHostMsg_Request& request_data) {
   BeginRequest(request_id, request_data, NULL, message.routing_id());
 }
 
@@ -346,7 +347,7 @@
 // a normal asynchronous set of response messages will be generated.
 void ResourceDispatcherHost::OnSyncLoad(
     int request_id,
-    const ViewHostMsg_Resource_Request& request_data,
+    const ResourceHostMsg_Request& request_data,
     IPC::Message* sync_result) {
   BeginRequest(request_id, request_data, sync_result,
                sync_result->routing_id());
@@ -354,7 +355,7 @@
 
 void ResourceDispatcherHost::BeginRequest(
     int request_id,
-    const ViewHostMsg_Resource_Request& request_data,
+    const ResourceHostMsg_Request& request_data,
     IPC::Message* sync_result,  // only valid for sync
     int route_id) {
   ChildProcessInfo::ProcessType process_type = filter_->process_type();
@@ -376,11 +377,11 @@
     if (sync_result) {
       SyncLoadResult result;
       result.status = status;
-      ViewHostMsg_SyncLoad::WriteReplyParams(sync_result, result);
+      ResourceHostMsg_SyncLoad::WriteReplyParams(sync_result, result);
       filter_->Send(sync_result);
     } else {
       // Tell the renderer that this request was disallowed.
-      filter_->Send(new ViewMsg_Resource_RequestComplete(
+      filter_->Send(new ResourceMsg_RequestComplete(
           route_id,
           request_id,
           status,
diff --git a/content/browser/renderer_host/resource_dispatcher_host.h b/content/browser/renderer_host/resource_dispatcher_host.h
index 47dcb22..0dbe8712 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.h
+++ b/content/browser/renderer_host/resource_dispatcher_host.h
@@ -45,7 +45,7 @@
 class WebKitThread;
 struct DownloadSaveInfo;
 struct GlobalRequestID;
-struct ViewHostMsg_Resource_Request;
+struct ResourceHostMsg_Request;
 struct ViewMsg_ClosePage_Params;
 
 namespace net {
@@ -384,12 +384,12 @@
 
   void OnRequestResource(const IPC::Message& msg,
                          int request_id,
-                         const ViewHostMsg_Resource_Request& request_data);
+                         const ResourceHostMsg_Request& request_data);
   void OnSyncLoad(int request_id,
-                  const ViewHostMsg_Resource_Request& request_data,
+                  const ResourceHostMsg_Request& request_data,
                   IPC::Message* sync_result);
   void BeginRequest(int request_id,
-                    const ViewHostMsg_Resource_Request& request_data,
+                    const ResourceHostMsg_Request& request_data,
                     IPC::Message* sync_result,  // only valid for sync
                     int route_id);  // only valid for async
   void OnDataReceivedACK(int request_id);
diff --git a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
index 6c3813e5..e763523 100644
--- a/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -10,13 +10,14 @@
 #include "chrome/common/chrome_plugin_lib.h"
 #include "chrome/common/render_messages.h"
 #include "chrome/common/render_messages_params.h"
-#include "chrome/common/resource_response.h"
 #include "content/browser/browser_thread.h"
 #include "content/browser/child_process_security_policy.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
 #include "content/browser/renderer_host/resource_handler.h"
 #include "content/browser/renderer_host/resource_message_filter.h"
+#include "content/common/resource_messages.h"
+#include "content/common/resource_response.h"
 #include "net/base/net_errors.h"
 #include "net/base/upload_data.h"
 #include "net/http/http_util.h"
@@ -37,7 +38,7 @@
   ASSERT_GE(messages.size(), 2U);
 
   // The first messages should be received response.
-  ASSERT_EQ(ViewMsg_Resource_ReceivedResponse::ID, messages[0].type());
+  ASSERT_EQ(ResourceMsg_ReceivedResponse::ID, messages[0].type());
 
   void* iter = NULL;
   int request_id;
@@ -50,22 +51,22 @@
 static int RequestIDForMessage(const IPC::Message& msg) {
   int request_id = -1;
   switch (msg.type()) {
-    case ViewMsg_Resource_UploadProgress::ID:
-    case ViewMsg_Resource_ReceivedResponse::ID:
-    case ViewMsg_Resource_ReceivedRedirect::ID:
-    case ViewMsg_Resource_DataReceived::ID:
-    case ViewMsg_Resource_RequestComplete::ID:
+    case ResourceMsg_UploadProgress::ID:
+    case ResourceMsg_ReceivedResponse::ID:
+    case ResourceMsg_ReceivedRedirect::ID:
+    case ResourceMsg_DataReceived::ID:
+    case ResourceMsg_RequestComplete::ID:
       request_id = IPC::MessageIterator(msg).NextInt();
       break;
   }
   return request_id;
 }
 
-static ViewHostMsg_Resource_Request CreateResourceRequest(
+static ResourceHostMsg_Request CreateResourceRequest(
     const char* method,
     ResourceType::Type type,
     const GURL& url) {
-  ViewHostMsg_Resource_Request request;
+  ResourceHostMsg_Request request;
   request.method = std::string(method);
   request.url = url;
   request.first_party_for_cookies = url;  // bypass third-party cookie blocking
@@ -285,9 +286,9 @@
     int render_view_id,
     int request_id,
     const GURL& url) {
-  ViewHostMsg_Resource_Request request =
+  ResourceHostMsg_Request request =
       CreateResourceRequest("GET", resource_type_, url);
-  ViewHostMsg_RequestResource msg(render_view_id, request_id, request);
+  ResourceHostMsg_RequestResource msg(render_view_id, request_id, request);
   bool msg_was_ok;
   host_.OnMessageReceived(msg, filter, &msg_was_ok);
   KickOffRequest();
@@ -310,11 +311,11 @@
   ASSERT_EQ(3U, messages.size());
 
   // The first messages should be received response
-  ASSERT_EQ(ViewMsg_Resource_ReceivedResponse::ID, messages[0].type());
+  ASSERT_EQ(ResourceMsg_ReceivedResponse::ID, messages[0].type());
 
   // followed by the data, currently we only do the data in one chunk, but
   // should probably test multiple chunks later
-  ASSERT_EQ(ViewMsg_Resource_DataReceived::ID, messages[1].type());
+  ASSERT_EQ(ResourceMsg_DataReceived::ID, messages[1].type());
 
   void* iter = NULL;
   int request_id;
@@ -331,10 +332,10 @@
   ASSERT_EQ(0, memcmp(reference_data.c_str(), data, data_len));
 
   // followed by a 0-byte read
-  //ASSERT_EQ(ViewMsg_Resource_DataReceived::ID, messages[2].type());
+  //ASSERT_EQ(ResourceMsg_DataReceived::ID, messages[2].type());
 
   // the last message should be all data received
-  ASSERT_EQ(ViewMsg_Resource_RequestComplete::ID, messages[2].type());
+  ASSERT_EQ(ResourceMsg_RequestComplete::ID, messages[2].type());
 }
 
 // Tests whether many messages get dispatched properly.
@@ -389,8 +390,8 @@
 
   // Check that request 2 got canceled.
   ASSERT_EQ(2U, msgs[1].size());
-  ASSERT_EQ(ViewMsg_Resource_ReceivedResponse::ID, msgs[1][0].type());
-  ASSERT_EQ(ViewMsg_Resource_RequestComplete::ID, msgs[1][1].type());
+  ASSERT_EQ(ResourceMsg_ReceivedResponse::ID, msgs[1][0].type());
+  ASSERT_EQ(ResourceMsg_RequestComplete::ID, msgs[1][1].type());
 
   int request_id;
   net::URLRequestStatus status;
@@ -429,7 +430,7 @@
   scoped_refptr<TestFilter> test_filter = new TestFilter();
 
   // request 1 goes to the test delegate
-  ViewHostMsg_Resource_Request request = CreateResourceRequest(
+  ResourceHostMsg_Request request = CreateResourceRequest(
       "GET", ResourceType::SUB_RESOURCE, net::URLRequestTestJob::test_url_1());
 
   EXPECT_EQ(0, host_.GetOutstandingRequestsMemoryCost(0));
@@ -758,7 +759,7 @@
     // Should have sent a single RequestComplete message.
     int index = kMaxRequests + i;
     EXPECT_EQ(1U, msgs[index].size());
-    EXPECT_EQ(ViewMsg_Resource_RequestComplete::ID, msgs[index][0].type());
+    EXPECT_EQ(ResourceMsg_RequestComplete::ID, msgs[index][0].type());
 
     // The RequestComplete message should have had status
     // (CANCELLED, ERR_INSUFFICIENT_RESOURCES).
@@ -922,7 +923,7 @@
 
   // We should have gotten one RequestComplete message.
   ASSERT_EQ(1U, msgs[0].size());
-  EXPECT_EQ(ViewMsg_Resource_RequestComplete::ID, msgs[0][0].type());
+  EXPECT_EQ(ResourceMsg_RequestComplete::ID, msgs[0][0].type());
 
   // The RequestComplete message should have had status
   // (CANCELED, ERR_FILE_NOT_FOUND).
diff --git a/content/browser/renderer_host/resource_message_filter.cc b/content/browser/renderer_host/resource_message_filter.cc
index 7b3229b..3988776 100644
--- a/content/browser/renderer_host/resource_message_filter.cc
+++ b/content/browser/renderer_host/resource_message_filter.cc
@@ -36,7 +36,7 @@
 }
 
 ChromeURLRequestContext* ResourceMessageFilter::GetURLRequestContext(
-    const ViewHostMsg_Resource_Request& resource_request) {
+    const ResourceHostMsg_Request& resource_request) {
   net::URLRequestContext* rv = NULL;
   if (url_request_context_override_.get())
     rv = url_request_context_override_->GetRequestContext(resource_request);
diff --git a/content/browser/renderer_host/resource_message_filter.h b/content/browser/renderer_host/resource_message_filter.h
index 88736645..efc6aa0 100644
--- a/content/browser/renderer_host/resource_message_filter.h
+++ b/content/browser/renderer_host/resource_message_filter.h
@@ -11,7 +11,7 @@
 
 class ChromeURLRequestContext;
 class ResourceDispatcherHost;
-struct ViewHostMsg_Resource_Request;
+struct ResourceHostMsg_Request;
 
 namespace net {
 class URLRequestContext;
@@ -31,7 +31,7 @@
     URLRequestContextOverride() {}
 
     virtual net::URLRequestContext* GetRequestContext(
-        const ViewHostMsg_Resource_Request& resource_request) = 0;
+        const ResourceHostMsg_Request& resource_request) = 0;
 
    protected:
     friend class base::RefCountedThreadSafe<URLRequestContextOverride>;
@@ -51,7 +51,7 @@
 
   // Returns the net::URLRequestContext for the given request.
   ChromeURLRequestContext* GetURLRequestContext(
-      const ViewHostMsg_Resource_Request& resource_request);
+      const ResourceHostMsg_Request& resource_request);
 
   void set_url_request_context_override(URLRequestContextOverride* u) {
     url_request_context_override_ = u;
diff --git a/content/browser/renderer_host/socket_stream_dispatcher_host.cc b/content/browser/renderer_host/socket_stream_dispatcher_host.cc
index d3c1b3a..ce6c855 100644
--- a/content/browser/renderer_host/socket_stream_dispatcher_host.cc
+++ b/content/browser/renderer_host/socket_stream_dispatcher_host.cc
@@ -11,6 +11,7 @@
 #include "content/browser/renderer_host/socket_stream_host.h"
 #include "content/common/socket_stream.h"
 #include "content/common/socket_stream_messages.h"
+#include "content/common/resource_messages.h"
 #include "net/websockets/websocket_job.h"
 #include "net/websockets/websocket_throttle.h"
 
@@ -154,7 +155,7 @@
     // GetRequestContext will take a different parameter and we can take out
     // this struct and the #include "chrome/common/render_messages_params.h"
     // above.
-    ViewHostMsg_Resource_Request request;
+    ResourceHostMsg_Request request;
     rv = url_request_context_override_->GetRequestContext(request);
   }
   if (!rv) {
diff --git a/content/browser/renderer_host/sync_resource_handler.cc b/content/browser/renderer_host/sync_resource_handler.cc
index 1b9a8f6..7b19a08 100644
--- a/content/browser/renderer_host/sync_resource_handler.cc
+++ b/content/browser/renderer_host/sync_resource_handler.cc
@@ -11,6 +11,7 @@
 #include "content/browser/renderer_host/global_request_id.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_message_filter.h"
+#include "content/common/resource_messages.h"
 #include "net/base/io_buffer.h"
 #include "net/http/http_response_headers.h"
 
@@ -102,7 +103,7 @@
     const std::string& security_info) {
   result_.status = status;
 
-  ViewHostMsg_SyncLoad::WriteReplyParams(result_message_, result_);
+  ResourceHostMsg_SyncLoad::WriteReplyParams(result_message_, result_);
   filter_->Send(result_message_);
   result_message_ = NULL;
   return true;
diff --git a/content/browser/renderer_host/sync_resource_handler.h b/content/browser/renderer_host/sync_resource_handler.h
index 95e8bfe..c07064c 100644
--- a/content/browser/renderer_host/sync_resource_handler.h
+++ b/content/browser/renderer_host/sync_resource_handler.h
@@ -9,7 +9,7 @@
 #include <string>
 
 #include "content/browser/renderer_host/resource_handler.h"
-#include "chrome/common/resource_response.h"
+#include "content/common/resource_response.h"
 
 class ResourceDispatcherHost;
 class ResourceMessageFilter;
diff --git a/content/browser/renderer_host/x509_user_cert_resource_handler.cc b/content/browser/renderer_host/x509_user_cert_resource_handler.cc
index 7393e73..188538d 100644
--- a/content/browser/renderer_host/x509_user_cert_resource_handler.cc
+++ b/content/browser/renderer_host/x509_user_cert_resource_handler.cc
@@ -7,10 +7,10 @@
 #include "base/string_util.h"
 #include "chrome/browser/download/download_types.h"
 #include "chrome/browser/ssl/ssl_add_cert_handler.h"
-#include "chrome/common/resource_response.h"
 #include "chrome/common/url_constants.h"
 #include "content/browser/renderer_host/resource_dispatcher_host.h"
 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h"
+#include "content/common/resource_response.h"
 #include "net/base/io_buffer.h"
 #include "net/base/mime_sniffer.h"
 #include "net/base/mime_util.h"
diff --git a/content/browser/worker_host/worker_process_host.cc b/content/browser/worker_host/worker_process_host.cc
index 0a38d507..dfc90ae 100644
--- a/content/browser/worker_host/worker_process_host.cc
+++ b/content/browser/worker_host/worker_process_host.cc
@@ -55,7 +55,7 @@
   virtual ~URLRequestContextOverride() {}
 
   virtual net::URLRequestContext* GetRequestContext(
-      const ViewHostMsg_Resource_Request& resource_request) {
+      const ResourceHostMsg_Request& resource_request) {
     return url_request_context_;
   }
 
diff --git a/content/common/common_param_traits.cc b/content/common/common_param_traits.cc
index d25cb5b..fe92765 100644
--- a/content/common/common_param_traits.cc
+++ b/content/common/common_param_traits.cc
@@ -5,6 +5,10 @@
 #include "content/common/common_param_traits.h"
 
 #include "content/common/content_constants.h"
+#include "net/base/host_port_pair.h"
+#include "net/base/upload_data.h"
+#include "net/http/http_response_headers.h"
+#include "webkit/glue/resource_loader_bridge.h"
 
 namespace IPC {
 
@@ -27,4 +31,400 @@
   l->append(p.spec());
 }
 
+
+void ParamTraits<ResourceType::Type>::Write(Message* m, const param_type& p) {
+  m->WriteInt(p);
+}
+
+bool ParamTraits<ResourceType::Type>::Read(const Message* m,
+                                           void** iter,
+                                           param_type* p) {
+  int type;
+  if (!m->ReadInt(iter, &type) || !ResourceType::ValidType(type))
+    return false;
+  *p = ResourceType::FromInt(type);
+  return true;
+}
+
+void ParamTraits<ResourceType::Type>::Log(const param_type& p, std::string* l) {
+  std::string type;
+  switch (p) {
+    case ResourceType::MAIN_FRAME:
+      type = "MAIN_FRAME";
+      break;
+    case ResourceType::SUB_FRAME:
+      type = "SUB_FRAME";
+      break;
+    case ResourceType::SUB_RESOURCE:
+      type = "SUB_RESOURCE";
+      break;
+    case ResourceType::OBJECT:
+      type = "OBJECT";
+      break;
+    case ResourceType::MEDIA:
+      type = "MEDIA";
+      break;
+    default:
+      type = "UNKNOWN";
+      break;
+  }
+
+  LogParam(type, l);
+}
+
+void ParamTraits<net::URLRequestStatus>::Write(Message* m,
+                                               const param_type& p) {
+  WriteParam(m, static_cast<int>(p.status()));
+  WriteParam(m, p.os_error());
+}
+
+bool ParamTraits<net::URLRequestStatus>::Read(const Message* m, void** iter,
+                                              param_type* r) {
+  int status, os_error;
+  if (!ReadParam(m, iter, &status) ||
+      !ReadParam(m, iter, &os_error))
+    return false;
+  r->set_status(static_cast<net::URLRequestStatus::Status>(status));
+  r->set_os_error(os_error);
+  return true;
+}
+
+void ParamTraits<net::URLRequestStatus>::Log(const param_type& p,
+                                             std::string* l) {
+  std::string status;
+  switch (p.status()) {
+    case net::URLRequestStatus::SUCCESS:
+      status = "SUCCESS";
+      break;
+    case net::URLRequestStatus::IO_PENDING:
+      status = "IO_PENDING ";
+      break;
+    case net::URLRequestStatus::HANDLED_EXTERNALLY:
+      status = "HANDLED_EXTERNALLY";
+      break;
+    case net::URLRequestStatus::CANCELED:
+      status = "CANCELED";
+      break;
+    case net::URLRequestStatus::FAILED:
+      status = "FAILED";
+      break;
+    default:
+      status = "UNKNOWN";
+      break;
+  }
+  if (p.status() == net::URLRequestStatus::FAILED)
+    l->append("(");
+
+  LogParam(status, l);
+
+  if (p.status() == net::URLRequestStatus::FAILED) {
+    l->append(", ");
+    LogParam(p.os_error(), l);
+    l->append(")");
+  }
+}
+
+// Only the net::UploadData ParamTraits<> definition needs this definition, so
+// keep this in the implementation file so we can forward declare UploadData in
+// the header.
+template <>
+struct ParamTraits<net::UploadData::Element> {
+  typedef net::UploadData::Element param_type;
+  static void Write(Message* m, const param_type& p) {
+    WriteParam(m, static_cast<int>(p.type()));
+    switch (p.type()) {
+      case net::UploadData::TYPE_BYTES: {
+        m->WriteData(&p.bytes()[0], static_cast<int>(p.bytes().size()));
+        break;
+      }
+      case net::UploadData::TYPE_CHUNK: {
+        std::string chunk_length = StringPrintf(
+            "%X\r\n", static_cast<unsigned int>(p.bytes().size()));
+        std::vector<char> bytes;
+        bytes.insert(bytes.end(), chunk_length.data(),
+                     chunk_length.data() + chunk_length.length());
+        const char* data = &p.bytes()[0];
+        bytes.insert(bytes.end(), data, data + p.bytes().size());
+        const char* crlf = "\r\n";
+        bytes.insert(bytes.end(), crlf, crlf + strlen(crlf));
+        if (p.is_last_chunk()) {
+          const char* end_of_data = "0\r\n\r\n";
+          bytes.insert(bytes.end(), end_of_data,
+                       end_of_data + strlen(end_of_data));
+        }
+        m->WriteData(&bytes[0], static_cast<int>(bytes.size()));
+        // If this element is part of a chunk upload then send over information
+        // indicating if this is the last chunk.
+        WriteParam(m, p.is_last_chunk());
+        break;
+      }
+      case net::UploadData::TYPE_FILE: {
+        WriteParam(m, p.file_path());
+        WriteParam(m, p.file_range_offset());
+        WriteParam(m, p.file_range_length());
+        WriteParam(m, p.expected_file_modification_time());
+        break;
+      }
+      default: {
+        WriteParam(m, p.blob_url());
+        break;
+      }
+    }
+  }
+  static bool Read(const Message* m, void** iter, param_type* r) {
+    int type;
+    if (!ReadParam(m, iter, &type))
+      return false;
+    switch (type) {
+      case net::UploadData::TYPE_BYTES: {
+        const char* data;
+        int len;
+        if (!m->ReadData(iter, &data, &len))
+          return false;
+        r->SetToBytes(data, len);
+        break;
+      }
+      case net::UploadData::TYPE_CHUNK: {
+        const char* data;
+        int len;
+        if (!m->ReadData(iter, &data, &len))
+          return false;
+        r->SetToBytes(data, len);
+        // If this element is part of a chunk upload then we need to explicitly
+        // set the type of the element and whether it is the last chunk.
+        bool is_last_chunk = false;
+        if (!ReadParam(m, iter, &is_last_chunk))
+          return false;
+        r->set_type(net::UploadData::TYPE_CHUNK);
+        r->set_is_last_chunk(is_last_chunk);
+        break;
+      }
+      case net::UploadData::TYPE_FILE: {
+        FilePath file_path;
+        uint64 offset, length;
+        base::Time expected_modification_time;
+        if (!ReadParam(m, iter, &file_path))
+          return false;
+        if (!ReadParam(m, iter, &offset))
+          return false;
+        if (!ReadParam(m, iter, &length))
+          return false;
+        if (!ReadParam(m, iter, &expected_modification_time))
+          return false;
+        r->SetToFilePathRange(file_path, offset, length,
+                              expected_modification_time);
+        break;
+      }
+      default: {
+        DCHECK(type == net::UploadData::TYPE_BLOB);
+        GURL blob_url;
+        if (!ReadParam(m, iter, &blob_url))
+          return false;
+        r->SetToBlobUrl(blob_url);
+        break;
+      }
+    }
+    return true;
+  }
+  static void Log(const param_type& p, std::string* l) {
+    l->append("<net::UploadData::Element>");
+  }
+};
+
+void ParamTraits<scoped_refptr<net::UploadData> >::Write(Message* m,
+                                                         const param_type& p) {
+  WriteParam(m, p.get() != NULL);
+  if (p) {
+    WriteParam(m, *p->elements());
+    WriteParam(m, p->identifier());
+    WriteParam(m, p->is_chunked());
+  }
+}
+
+bool ParamTraits<scoped_refptr<net::UploadData> >::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;
+  std::vector<net::UploadData::Element> elements;
+  if (!ReadParam(m, iter, &elements))
+    return false;
+  int64 identifier;
+  if (!ReadParam(m, iter, &identifier))
+    return false;
+  bool is_chunked = false;
+  if (!ReadParam(m, iter, &is_chunked))
+    return false;
+  *r = new net::UploadData;
+  (*r)->swap_elements(&elements);
+  (*r)->set_identifier(identifier);
+  (*r)->set_is_chunked(is_chunked);
+  return true;
+}
+
+void ParamTraits<scoped_refptr<net::UploadData> >::Log(const param_type& p,
+                                                       std::string* l) {
+  l->append("<net::UploadData>");
+}
+
+void ParamTraits<net::HostPortPair>::Write(Message* m, const param_type& p) {
+  WriteParam(m, p.host());
+  WriteParam(m, p.port());
+}
+
+bool ParamTraits<net::HostPortPair>::Read(const Message* m, void** iter,
+                                          param_type* r) {
+  std::string host;
+  uint16 port;
+  if (!ReadParam(m, iter, &host) || !ReadParam(m, iter, &port))
+    return false;
+
+  r->set_host(host);
+  r->set_port(port);
+  return true;
+}
+
+void ParamTraits<net::HostPortPair>::Log(const param_type& p, std::string* l) {
+  l->append(p.ToString());
+}
+
+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(")");
+}
+
 }  // namespace IPC
diff --git a/content/common/common_param_traits.h b/content/common/common_param_traits.h
index 9717dcc9..1ecb5bb 100644
--- a/content/common/common_param_traits.h
+++ b/content/common/common_param_traits.h
@@ -14,17 +14,34 @@
 #define CONTENT_COMMON_COMMON_PARAM_TRAITS_H_
 #pragma once
 
+#include "base/ref_counted.h"
 #include "googleurl/src/gurl.h"
 #include "ipc/ipc_message_utils.h"
+#include "net/url_request/url_request_status.h"
 // !!! WARNING: DO NOT ADD NEW WEBKIT DEPENDENCIES !!!
 //
 // That means don't add #includes to any file in 'webkit/' or
 // 'third_party/WebKit/'. Chrome Frame and NACL build parts of base/ and
 // content/common/ for a mini-library that doesn't depend on webkit.
 
+// TODO(erg): The following headers are historical and only work because
+// their definitions are inlined, which also needs to be fixed.
+#include "webkit/glue/resource_type.h"
+
 // Forward declarations.
 class GURL;
 
+namespace net {
+class HttpResponseHeaders;
+class HostPortPair;
+class UploadData;
+}
+
+namespace webkit_glue {
+struct ResourceDevToolsInfo;
+struct ResourceLoadTimingInfo;
+}
+
 namespace IPC {
 
 template <>
@@ -35,6 +52,62 @@
   static void Log(const param_type& p, std::string* l);
 };
 
+template <>
+struct ParamTraits<ResourceType::Type> {
+  typedef ResourceType::Type param_type;
+  static void Write(Message* m, const param_type& p);
+  static bool Read(const Message* m, void** iter, param_type* p);
+  static void Log(const param_type& p, std::string* l);
+};
+
+template <>
+struct ParamTraits<net::URLRequestStatus> {
+  typedef net::URLRequestStatus 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<net::UploadData> > {
+  typedef scoped_refptr<net::UploadData> 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<net::HostPortPair> {
+  typedef net::HostPortPair 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<net::HttpResponseHeaders> > {
+  typedef scoped_refptr<net::HttpResponseHeaders> 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<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::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);
+};
+
 }  // namespace IPC
 
 #endif  // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_
diff --git a/content/common/content_message_generator.h b/content/common/content_message_generator.h
index bcda993..ac64b0da 100644
--- a/content/common/content_message_generator.h
+++ b/content/common/content_message_generator.h
@@ -5,4 +5,5 @@
 // Multiply-included file, hence no include guard.
 
 #include "content/common/p2p_messages.h"
+#include "content/common/resource_messages.h"
 #include "content/common/socket_stream_messages.h"
diff --git a/content/common/resource_messages.h b/content/common/resource_messages.h
new file mode 100644
index 0000000..73b9f8a
--- /dev/null
+++ b/content/common/resource_messages.h
@@ -0,0 +1,196 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// IPC messages for resource loading.
+// Multiply-included message file, hence no include guard.
+
+#include "base/shared_memory.h"
+#include "content/common/resource_response.h"
+#include "ipc/ipc_message_macros.h"
+#include "net/base/upload_data.h"
+
+namespace net {
+class UploadData;
+}
+
+#define IPC_MESSAGE_START ResourceMsgStart
+
+IPC_STRUCT_TRAITS_BEGIN(webkit_glue::ResourceResponseInfo)
+  IPC_STRUCT_TRAITS_MEMBER(request_time)
+  IPC_STRUCT_TRAITS_MEMBER(response_time)
+  IPC_STRUCT_TRAITS_MEMBER(headers)
+  IPC_STRUCT_TRAITS_MEMBER(mime_type)
+  IPC_STRUCT_TRAITS_MEMBER(charset)
+  IPC_STRUCT_TRAITS_MEMBER(security_info)
+  IPC_STRUCT_TRAITS_MEMBER(content_length)
+  IPC_STRUCT_TRAITS_MEMBER(appcache_id)
+  IPC_STRUCT_TRAITS_MEMBER(appcache_manifest_url)
+  IPC_STRUCT_TRAITS_MEMBER(connection_id)
+  IPC_STRUCT_TRAITS_MEMBER(connection_reused)
+  IPC_STRUCT_TRAITS_MEMBER(load_timing)
+  IPC_STRUCT_TRAITS_MEMBER(devtools_info)
+  IPC_STRUCT_TRAITS_MEMBER(download_file_path)
+  IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_spdy)
+  IPC_STRUCT_TRAITS_MEMBER(was_npn_negotiated)
+  IPC_STRUCT_TRAITS_MEMBER(was_alternate_protocol_available)
+  IPC_STRUCT_TRAITS_MEMBER(was_fetched_via_proxy)
+  IPC_STRUCT_TRAITS_MEMBER(socket_address)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(ResourceResponseHead)
+  IPC_STRUCT_TRAITS_PARENT(webkit_glue::ResourceResponseInfo)
+  IPC_STRUCT_TRAITS_MEMBER(status)
+IPC_STRUCT_TRAITS_END()
+
+IPC_STRUCT_TRAITS_BEGIN(SyncLoadResult)
+  IPC_STRUCT_TRAITS_PARENT(ResourceResponseHead)
+  IPC_STRUCT_TRAITS_MEMBER(final_url)
+  IPC_STRUCT_TRAITS_MEMBER(data)
+IPC_STRUCT_TRAITS_END()
+
+// Parameters for a resource request.
+IPC_STRUCT_BEGIN(ResourceHostMsg_Request)
+  // The request method: GET, POST, etc.
+  IPC_STRUCT_MEMBER(std::string, method)
+
+  // The requested URL.
+  IPC_STRUCT_MEMBER(GURL, url)
+
+  // Usually the URL of the document in the top-level window, which may be
+  // checked by the third-party cookie blocking policy. Leaving it empty may
+  // lead to undesired cookie blocking. Third-party cookie blocking can be
+  // bypassed by setting first_party_for_cookies = url, but this should ideally
+  // only be done if there really is no way to determine the correct value.
+  IPC_STRUCT_MEMBER(GURL, first_party_for_cookies)
+
+  // The referrer to use (may be empty).
+  IPC_STRUCT_MEMBER(GURL, referrer)
+
+  // Additional HTTP request headers.
+  IPC_STRUCT_MEMBER(std::string, headers)
+
+  // net::URLRequest load flags (0 by default).
+  IPC_STRUCT_MEMBER(int, load_flags)
+
+  // Process ID from which this request originated, or zero if it originated
+  // in the renderer itself.
+  IPC_STRUCT_MEMBER(int, origin_pid)
+
+  // What this resource load is for (main frame, sub-frame, sub-resource,
+  // object).
+  IPC_STRUCT_MEMBER(ResourceType::Type, resource_type)
+
+  // Used by plugin->browser requests to get the correct net::URLRequestContext.
+  IPC_STRUCT_MEMBER(uint32, request_context)
+
+  // Indicates which frame (or worker context) the request is being loaded into,
+  // or kNoHostId.
+  IPC_STRUCT_MEMBER(int, appcache_host_id)
+
+  // Optional upload data (may be null).
+  IPC_STRUCT_MEMBER(scoped_refptr<net::UploadData>, upload_data)
+
+  IPC_STRUCT_MEMBER(bool, download_to_file)
+
+  // True if the request was user initiated.
+  IPC_STRUCT_MEMBER(bool, has_user_gesture)
+
+  // The following two members are specified if the request is initiated by
+  // a plugin like Gears.
+
+  // Contains the id of the host renderer.
+  IPC_STRUCT_MEMBER(int, host_renderer_id)
+
+  // Contains the id of the host render view.
+  IPC_STRUCT_MEMBER(int, host_render_view_id)
+IPC_STRUCT_END()
+
+// Resource messages sent from the browser to the renderer.
+
+// Sent when the headers are available for a resource request.
+IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedResponse,
+                    int /* request_id */,
+                    ResourceResponseHead)
+
+// Sent when cached metadata from a resource request is ready.
+IPC_MESSAGE_ROUTED2(ResourceMsg_ReceivedCachedMetadata,
+                    int /* request_id */,
+                    std::vector<char> /* data */)
+
+// Sent as upload progress is being made.
+IPC_MESSAGE_ROUTED3(ResourceMsg_UploadProgress,
+                    int /* request_id */,
+                    int64 /* position */,
+                    int64 /* size */)
+
+// Sent when the request has been redirected.  The receiver is expected to
+// respond with either a FollowRedirect message (if the redirect is to be
+// followed) or a CancelRequest message (if it should not be followed).
+IPC_MESSAGE_ROUTED3(ResourceMsg_ReceivedRedirect,
+                    int /* request_id */,
+                    GURL /* new_url */,
+                    ResourceResponseHead)
+
+// Sent when some data from a resource request is ready. The handle should
+// already be mapped into the process that receives this message.
+IPC_MESSAGE_ROUTED3(ResourceMsg_DataReceived,
+                    int /* request_id */,
+                    base::SharedMemoryHandle /* data */,
+                    int /* data_len */)
+
+// Sent when some data from a resource request has been downloaded to
+// file. This is only called in the 'download_to_file' case and replaces
+// ResourceMsg_DataReceived in the call sequence in that case.
+IPC_MESSAGE_ROUTED2(ResourceMsg_DataDownloaded,
+                    int /* request_id */,
+                    int /* data_len */)
+
+// Sent when the request has been completed.
+IPC_MESSAGE_ROUTED4(ResourceMsg_RequestComplete,
+                    int /* request_id */,
+                    net::URLRequestStatus /* status */,
+                    std::string /* security info */,
+                    base::Time /* completion_time */)
+
+// Resource messages sent from the renderer to the browser.
+
+// Makes a resource request via the browser.
+IPC_MESSAGE_ROUTED2(ResourceHostMsg_RequestResource,
+                    int /* request_id */,
+                    ResourceHostMsg_Request)
+
+// Cancels a resource request with the ID given as the parameter.
+IPC_MESSAGE_ROUTED1(ResourceHostMsg_CancelRequest,
+                    int /* request_id */)
+
+// Follows a redirect that occured for the resource request with the ID given
+// as the parameter.
+IPC_MESSAGE_ROUTED3(ResourceHostMsg_FollowRedirect,
+                    int /* request_id */,
+                    bool /* has_new_first_party_for_cookies */,
+                    GURL /* new_first_party_for_cookies */)
+
+// Makes a synchronous resource request via the browser.
+IPC_SYNC_MESSAGE_ROUTED2_1(ResourceHostMsg_SyncLoad,
+                           int /* request_id */,
+                           ResourceHostMsg_Request,
+                           SyncLoadResult)
+
+// Sent when the renderer process is done processing a DataReceived
+// message.
+IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataReceived_ACK,
+                    int /* request_id */)
+
+// Sent when the renderer has processed a DataDownloaded message.
+IPC_MESSAGE_ROUTED1(ResourceHostMsg_DataDownloaded_ACK,
+                    int /* request_id */)
+
+// Sent by the renderer process to acknowledge receipt of a
+// UploadProgress message.
+IPC_MESSAGE_ROUTED1(ResourceHostMsg_UploadProgress_ACK,
+                    int /* request_id */)
+
+// Sent when the renderer process deletes a resource loader.
+IPC_MESSAGE_CONTROL1(ResourceHostMsg_ReleaseDownloadedFile,
+                     int /* request_id */)
diff --git a/chrome/common/resource_response.h b/content/common/resource_response.h
similarity index 78%
rename from chrome/common/resource_response.h
rename to content/common/resource_response.h
index c9cbadaf0..e58e1069 100644
--- a/chrome/common/resource_response.h
+++ b/content/common/resource_response.h
@@ -4,8 +4,8 @@
 
 // See http://dev.chromium.org/developers/design-documents/multi-process-resource-loading
 
-#ifndef CHROME_COMMON_RESOURCE_RESPONSE_H_
-#define CHROME_COMMON_RESOURCE_RESPONSE_H_
+#ifndef CONTENT_COMMON_RESOURCE_RESPONSE_H_
+#define CONTENT_COMMON_RESOURCE_RESPONSE_H_
 #pragma once
 
 #include <string>
@@ -17,18 +17,12 @@
 
 // Parameters for a resource response header.
 struct ResourceResponseHead : webkit_glue::ResourceResponseInfo {
-  ResourceResponseHead();
-  ~ResourceResponseHead();
-
   // The response status.
   net::URLRequestStatus status;
 };
 
 // Parameters for a synchronous resource response.
 struct SyncLoadResult : ResourceResponseHead {
-  SyncLoadResult();
-  ~SyncLoadResult();
-
   // The final URL after any redirects.
   GURL final_url;
 
@@ -40,11 +34,8 @@
 struct ResourceResponse : public base::RefCounted<ResourceResponse> {
   ResourceResponseHead response_head;
 
-  ResourceResponse();
  private:
   friend class base::RefCounted<ResourceResponse>;
-
-  virtual ~ResourceResponse();
 };
 
-#endif  // CHROME_COMMON_RESOURCE_RESPONSE_H_
+#endif  // CONTENT_COMMON_RESOURCE_RESPONSE_H_
diff --git a/content/content_common.gypi b/content/content_common.gypi
index 8b8753e..dc430e7e 100644
--- a/content/content_common.gypi
+++ b/content/content_common.gypi
@@ -27,6 +27,8 @@
         'common/p2p_messages.h',
         'common/p2p_sockets.cc',
         'common/p2p_sockets.h',
+        'common/resource_messages.h',
+        'common/resource_response.h',
         'common/socket_stream.h',
         'common/socket_stream_messages.h',
       ],
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index de1132e..b8885dc5 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -130,9 +130,11 @@
 //
 // Externally-defined structs are registered with IPC_STRUCT_TRAITS_BEGIN(),
 // IPC_STRUCT_TRAITS_MEMBER(), and IPC_STRUCT_TRAITS_END() macros. These
-// cause registration of the types with message generation only.  Note that
-// IPC_STRUCT_TRAITS_MEMBER() is only permitted inside matching calls
-// to IPC_STRUCT_TRAITS_BEGIN() / IPC_STRUCT_TRAITS_END().
+// cause registration of the types with message generation only.
+// There's also IPC_STRUCT_TRAITS_PARENT, which is used to register a parent
+// class (whose own traits are already defined). Note that
+// IPC_STRUCT_TRAITS_MEMBER() and IPC_STRUCT_TRAITS_PARENT are only permitted
+// inside matching calls to IPC_STRUCT_TRAITS_BEGIN() / IPC_STRUCT_TRAITS_END().
 //
 // Enum types are registered with a single IPC_ENUM_TRAITS() macro.  There
 // is no need to enumerate each value to the IPC mechanism.
diff --git a/ipc/ipc_message_null_macros.h b/ipc/ipc_message_null_macros.h
index 2c33172..fb57df57 100644
--- a/ipc/ipc_message_null_macros.h
+++ b/ipc/ipc_message_null_macros.h
@@ -11,6 +11,7 @@
 #undef IPC_STRUCT_END
 #undef IPC_STRUCT_TRAITS_BEGIN
 #undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
 #undef IPC_STRUCT_TRAITS_END
 #undef IPC_ENUM_TRAITS
 #undef IPC_MESSAGE_CONTROL0
@@ -91,6 +92,7 @@
 #define IPC_STRUCT_END()
 #define IPC_STRUCT_TRAITS_BEGIN(struct_name)
 #define IPC_STRUCT_TRAITS_MEMBER(name)
+#define IPC_STRUCT_TRAITS_PARENT(type)
 #define IPC_STRUCT_TRAITS_END()
 #define IPC_ENUM_TRAITS(enum_name)
 #define IPC_MESSAGE_CONTROL0(msg_class)
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index f7bf49a0..800daaf 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -71,6 +71,7 @@
   SafeBrowsingMsgStart,
   P2PMsgStart,
   SocketStreamMsgStart,
+  ResourceMsgStart,
 };
 
 class DictionaryValue;
diff --git a/ipc/param_traits_log_macros.h b/ipc/param_traits_log_macros.h
index 40f8ec4..de2006c 100644
--- a/ipc/param_traits_log_macros.h
+++ b/ipc/param_traits_log_macros.h
@@ -21,6 +21,7 @@
 // Set up so next include will generate log methods.
 #undef IPC_STRUCT_TRAITS_BEGIN
 #undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
 #undef IPC_STRUCT_TRAITS_END
 #define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
   void ParamTraits<struct_name>::Log(const param_type& p, std::string* l) { \
@@ -31,6 +32,11 @@
       l->append(", "); \
     LogParam(p.name, l); \
     needs_comma = true;
+#define IPC_STRUCT_TRAITS_PARENT(type) \
+    if (needs_comma) \
+      l->append(", "); \
+      ParamTraits<type>::Log(p, l); \
+      needs_comma = true;
 #define IPC_STRUCT_TRAITS_END() \
     l->append(")"); \
   }
diff --git a/ipc/param_traits_macros.h b/ipc/param_traits_macros.h
index f22376a5..df57adf 100644
--- a/ipc/param_traits_macros.h
+++ b/ipc/param_traits_macros.h
@@ -20,6 +20,7 @@
   }
 
 #define IPC_STRUCT_TRAITS_MEMBER(name)
+#define IPC_STRUCT_TRAITS_PARENT(type)
 #define IPC_STRUCT_TRAITS_END()
 
 // Traits generation for enums.
diff --git a/ipc/param_traits_read_macros.h b/ipc/param_traits_read_macros.h
index a4fc2f94..ffcdf8ee 100644
--- a/ipc/param_traits_read_macros.h
+++ b/ipc/param_traits_read_macros.h
@@ -19,12 +19,14 @@
 // Set up so next include will generate read methods.
 #undef IPC_STRUCT_TRAITS_BEGIN
 #undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
 #undef IPC_STRUCT_TRAITS_END
 #define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
   bool ParamTraits<struct_name>:: \
       Read(const Message* m, void** iter, param_type* p) { \
     return
 #define IPC_STRUCT_TRAITS_MEMBER(name) ReadParam(m, iter, &p->name) &&
+#define IPC_STRUCT_TRAITS_PARENT(type) ParamTraits<type>::Read(m, iter, p) &&
 #define IPC_STRUCT_TRAITS_END() 1; }
 
 #undef IPC_ENUM_TRAITS
diff --git a/ipc/param_traits_write_macros.h b/ipc/param_traits_write_macros.h
index 84e63f79..2ac52492 100644
--- a/ipc/param_traits_write_macros.h
+++ b/ipc/param_traits_write_macros.h
@@ -19,10 +19,12 @@
 // Set up so next include will generate write methods.
 #undef IPC_STRUCT_TRAITS_BEGIN
 #undef IPC_STRUCT_TRAITS_MEMBER
+#undef IPC_STRUCT_TRAITS_PARENT
 #undef IPC_STRUCT_TRAITS_END
 #define IPC_STRUCT_TRAITS_BEGIN(struct_name) \
   void ParamTraits<struct_name>::Write(Message* m, const param_type& p) {
 #define IPC_STRUCT_TRAITS_MEMBER(name) WriteParam(m, p.name);
+#define IPC_STRUCT_TRAITS_PARENT(type) ParamTraits<type>::Write(m, p);
 #define IPC_STRUCT_TRAITS_END() }
 
 #undef IPC_ENUM_TRAITS