summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 17:45:54 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-07 17:45:54 +0000
commit1edc16b82bd98eb06188a94e62c668d439035e6e (patch)
tree3edaea7ad20c2981febbc5e081bb2d499d97e671 /chrome/browser/renderer_host
parent7d769c36ccaf6663c49e3c89d959a47b9449f68a (diff)
downloadchromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.zip
chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.tar.gz
chromium_src-1edc16b82bd98eb06188a94e62c668d439035e6e.tar.bz2
Adds new messages and widens some existing messages between the renderer and browser processes to support an implementation of the HTML5AppCache spec with most of the logic running in the browser process. The gist of most of the changes are to indicate which frame each resource request is coming from, and to indicate which appcache each response was retrieved from (if any).See https://docs.google.com/a/google.com/Doc?docid=agv6ghfsqr_15f749cgt3&hl=en
Review URL: http://codereview.chromium.org/9712 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13258 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host.cc2
-rw-r--r--chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc2
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.cc8
-rw-r--r--chrome/browser/renderer_host/resource_message_filter.h4
4 files changed, 14 insertions, 2 deletions
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host.cc b/chrome/browser/renderer_host/resource_dispatcher_host.cc
index 1a73ca5..2cb0431 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host.cc
@@ -42,6 +42,7 @@
#include "net/base/mime_util.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_request.h"
+#include "webkit/glue/webappcachecontext.h"
// TODO(port): Move these includes to the above section when porting is done.
#if defined(OS_POSIX)
@@ -909,6 +910,7 @@ bool ResourceDispatcherHost::CompleteResponseStarted(URLRequest* request) {
request->GetCharset(&response->response_head.charset);
response->response_head.filter_policy = info->filter_policy;
response->response_head.content_length = request->GetExpectedContentSize();
+ response->response_head.app_cache_id = WebAppCacheContext::kNoAppCacheId;
request->GetMimeType(&response->response_head.mime_type);
// Make sure we don't get a file handle if LOAD_ENABLE_FILE is not set.
diff --git a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
index bfd2d2c..1e2b458 100644
--- a/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
+++ b/chrome/browser/renderer_host/resource_dispatcher_host_unittest.cc
@@ -15,6 +15,7 @@
#include "net/url_request/url_request_job.h"
#include "net/url_request/url_request_test_job.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/glue/webappcachecontext.h"
static int RequestIDForMessage(const IPC::Message& msg) {
int request_id = -1;
@@ -43,6 +44,7 @@ static ViewHostMsg_Resource_Request CreateResourceRequest(const char* method,
request.origin_pid = 0;
request.resource_type = ResourceType::SUB_RESOURCE;
request.request_context = 0;
+ request.app_cache_context_id = WebAppCacheContext::kNoAppCacheContextId;
return request;
}
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc
index 549fc6a..1bffc6a 100644
--- a/chrome/browser/renderer_host/resource_message_filter.cc
+++ b/chrome/browser/renderer_host/resource_message_filter.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/renderer_host/render_widget_helper.h"
#include "chrome/browser/spellchecker.h"
#include "chrome/browser/worker_host/worker_service.h"
+#include "chrome/common/app_cache/app_cache_dispatcher_host.h"
#include "chrome/common/chrome_plugin_lib.h"
#include "chrome/common/chrome_plugin_util.h"
#include "chrome/common/clipboard_service.h"
@@ -128,6 +129,7 @@ ResourceMessageFilter::ResourceMessageFilter(
profile_(profile),
render_widget_helper_(render_widget_helper),
audio_renderer_host_(audio_renderer_host),
+ app_cache_dispatcher_host_(new AppCacheDispatcherHost),
off_the_record_(profile->IsOffTheRecord()) {
DCHECK(request_context_.get());
DCHECK(request_context_->cookie_store());
@@ -155,7 +157,7 @@ ResourceMessageFilter::~ResourceMessageFilter() {
void ResourceMessageFilter::Init(int render_process_id) {
render_process_id_ = render_process_id;
render_widget_helper_->Init(render_process_id, resource_dispatcher_host_);
-
+ app_cache_dispatcher_host_->Initialize(this);
ExtensionMessageService::GetInstance()->RendererReady(this);
}
@@ -199,7 +201,9 @@ void ResourceMessageFilter::OnChannelClosing() {
bool ResourceMessageFilter::OnMessageReceived(const IPC::Message& message) {
bool msg_is_ok = true;
bool handled = resource_dispatcher_host_->OnMessageReceived(
- message, this, &msg_is_ok);
+ message, this, &msg_is_ok) ||
+ app_cache_dispatcher_host_->OnMessageReceived(
+ message, &msg_is_ok);
if (!handled) {
handled = true;
IPC_BEGIN_MESSAGE_MAP_EX(ResourceMessageFilter, message, msg_is_ok)
diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h
index db7c60b..d801583 100644
--- a/chrome/browser/renderer_host/resource_message_filter.h
+++ b/chrome/browser/renderer_host/resource_message_filter.h
@@ -32,6 +32,7 @@
#include "chrome/common/temp_scaffolding_stubs.h"
#endif
+class AppCacheDispatcherHost;
class AudioRendererHost;
class ClipboardService;
class Profile;
@@ -269,6 +270,9 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter,
// Object that should take care of audio related resource requests.
scoped_refptr<AudioRendererHost> audio_renderer_host_;
+ // Handles appcache related messages
+ scoped_ptr<AppCacheDispatcherHost> app_cache_dispatcher_host_;
+
// Whether this process is used for off the record tabs.
bool off_the_record_;