summaryrefslogtreecommitdiffstats
path: root/chrome/common
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/common
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/common')
-rw-r--r--chrome/common/app_cache/app_cache_context_impl.cc84
-rw-r--r--chrome/common/app_cache/app_cache_context_impl.h48
-rw-r--r--chrome/common/app_cache/app_cache_dispatcher.cc26
-rw-r--r--chrome/common/app_cache/app_cache_dispatcher.h26
-rw-r--r--chrome/common/app_cache/app_cache_dispatcher_host.cc60
-rw-r--r--chrome/common/app_cache/app_cache_dispatcher_host.h43
-rw-r--r--chrome/common/common.vcproj28
-rw-r--r--chrome/common/render_messages.h49
-rw-r--r--chrome/common/render_messages_internal.h37
-rw-r--r--chrome/common/resource_dispatcher.cc8
-rw-r--r--chrome/common/resource_dispatcher.h3
-rw-r--r--chrome/common/resource_dispatcher_unittest.cc3
12 files changed, 412 insertions, 3 deletions
diff --git a/chrome/common/app_cache/app_cache_context_impl.cc b/chrome/common/app_cache/app_cache_context_impl.cc
new file mode 100644
index 0000000..d50b467
--- /dev/null
+++ b/chrome/common/app_cache/app_cache_context_impl.cc
@@ -0,0 +1,84 @@
+// Copyright (c) 2009 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/app_cache/app_cache_context_impl.h"
+
+#include "base/logging.h"
+#include "chrome/common/render_messages.h"
+#include "chrome/common/child_thread.h"
+#include "googleurl/src/gurl.h"
+
+IDMap<AppCacheContextImpl> AppCacheContextImpl::all_contexts;
+
+// static
+AppCacheContextImpl* AppCacheContextImpl::FromContextId(int id) {
+ return all_contexts.Lookup(id);
+}
+
+AppCacheContextImpl::AppCacheContextImpl(IPC::Message::Sender *sender)
+ : context_id_(kNoAppCacheContextId),
+ app_cache_id_(kUnknownAppCacheId),
+ pending_select_request_id_(0),
+ sender_(sender) {
+ DCHECK(sender_);
+}
+
+AppCacheContextImpl::~AppCacheContextImpl() {
+ UnInitializeContext();
+}
+
+void AppCacheContextImpl::Initialize(ContextType context_type,
+ WebAppCacheContext *parent) {
+ DCHECK(context_id_ == kNoAppCacheContextId);
+ DCHECK(((context_type == MAIN_FRAME) && !parent) ||
+ ((context_type != MAIN_FRAME) && parent));
+
+ context_id_ = all_contexts.Add(this);
+ CHECK(context_id_ != kNoAppCacheContextId);
+
+ sender_->Send(new AppCacheMsg_ContextCreated(context_type,
+ context_id_,
+ parent ? parent->context_id()
+ : kNoAppCacheContextId));
+}
+
+void AppCacheContextImpl::UnInitializeContext() {
+ if (context_id_ != kNoAppCacheContextId) {
+ sender_->Send(new AppCacheMsg_ContextDestroyed(context_id_));
+ all_contexts.Remove(context_id_);
+ context_id_ = kNoAppCacheContextId;
+ }
+}
+
+void AppCacheContextImpl::SelectAppCacheWithoutManifest(
+ const GURL &document_url,
+ int64 cache_document_was_loaded_from) {
+ DCHECK(context_id_ != kNoAppCacheContextId);
+ app_cache_id_ = kUnknownAppCacheId; // unknown until we get a response
+ sender_->Send(new AppCacheMsg_SelectAppCache(
+ context_id_, ++pending_select_request_id_,
+ document_url, cache_document_was_loaded_from,
+ GURL::EmptyGURL()));
+}
+
+void AppCacheContextImpl::SelectAppCacheWithManifest(
+ const GURL &document_url,
+ int64 cache_document_was_loaded_from,
+ const GURL &manifest_url) {
+ DCHECK(context_id_ != kNoAppCacheContextId);
+ app_cache_id_ = kUnknownAppCacheId; // unknown until we get a response
+ sender_->Send(new AppCacheMsg_SelectAppCache(
+ context_id_, ++pending_select_request_id_,
+ document_url, cache_document_was_loaded_from,
+ manifest_url));
+}
+
+void AppCacheContextImpl::OnAppCacheSelected(int select_request_id,
+ int64 app_cache_id) {
+ if (select_request_id == pending_select_request_id_) {
+ DCHECK(app_cache_id_ == kUnknownAppCacheId);
+ DCHECK(app_cache_id != kUnknownAppCacheId);
+ app_cache_id_ = app_cache_id;
+ }
+}
diff --git a/chrome/common/app_cache/app_cache_context_impl.h b/chrome/common/app_cache/app_cache_context_impl.h
new file mode 100644
index 0000000..7ca7ee3
--- /dev/null
+++ b/chrome/common/app_cache/app_cache_context_impl.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2009 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.
+
+#ifndef CHROME_COMMON_APP_CACHE_APP_CACHE_CONTEXT_IMPL_H_
+#define CHROME_COMMON_APP_CACHE_APP_CACHE_CONTEXT_IMPL_H_
+
+#include "base/id_map.h"
+#include "chrome/common/ipc_message.h"
+#include "webkit/glue/webappcachecontext.h"
+
+// A concrete implemenation of WebAppCacheContext for use in a child process.
+class AppCacheContextImpl : public WebAppCacheContext {
+ public:
+ // Returns the context having given id or NULL if there is no such context.
+ static AppCacheContextImpl* FromContextId(int id);
+
+ AppCacheContextImpl(IPC::Message::Sender* sender);
+ virtual ~AppCacheContextImpl();
+
+ // WebAppCacheContext implementation
+ virtual int context_id() { return context_id_; }
+ virtual int64 app_cache_id() { return app_cache_id_; }
+ virtual void Initialize(WebAppCacheContext::ContextType context_type,
+ WebAppCacheContext* opt_parent);
+ virtual void SelectAppCacheWithoutManifest(
+ const GURL& document_url,
+ int64 cache_document_was_loaded_from);
+ virtual void SelectAppCacheWithManifest(
+ const GURL& document_url,
+ int64 cache_document_was_loaded_from,
+ const GURL& manifest_url);
+
+ // Called by AppCacheDispatcher when the browser has selected an appcache.
+ void OnAppCacheSelected(int select_request_id, int64 app_cache_id);
+
+ private:
+ void UnInitializeContext();
+
+ int context_id_;
+ int64 app_cache_id_;
+ int pending_select_request_id_;
+ IPC::Message::Sender* sender_;
+
+ static IDMap<AppCacheContextImpl> all_contexts;
+};
+
+#endif // CHROME_COMMON_APP_CACHE_APP_CACHE_CONTEXT_IMPL_H_
diff --git a/chrome/common/app_cache/app_cache_dispatcher.cc b/chrome/common/app_cache/app_cache_dispatcher.cc
new file mode 100644
index 0000000..ba81243
--- /dev/null
+++ b/chrome/common/app_cache/app_cache_dispatcher.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 2009 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/app_cache/app_cache_dispatcher.h"
+
+#include "chrome/common/app_cache/app_cache_context_impl.h"
+#include "chrome/common/render_messages.h"
+
+bool AppCacheDispatcher::OnMessageReceived(const IPC::Message& msg) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP(AppCacheDispatcher, msg)
+ IPC_MESSAGE_HANDLER(AppCacheMsg_AppCacheSelected, OnAppCacheSelected)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP()
+ return handled;
+}
+
+void AppCacheDispatcher::OnAppCacheSelected(int context_id,
+ int select_request_id,
+ int64 app_cache_id) {
+ AppCacheContextImpl *context = AppCacheContextImpl::FromContextId(context_id);
+ if (context) {
+ context->OnAppCacheSelected(select_request_id, app_cache_id);
+ }
+}
diff --git a/chrome/common/app_cache/app_cache_dispatcher.h b/chrome/common/app_cache/app_cache_dispatcher.h
new file mode 100644
index 0000000..c8baf28
--- /dev/null
+++ b/chrome/common/app_cache/app_cache_dispatcher.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2009 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.
+
+#ifndef CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_H_
+#define CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_H_
+
+#include "base/basictypes.h"
+#include "chrome/common/ipc_message.h"
+
+// Dispatches app cache related messages sent to a child process from the
+// main browser process. There is one instance per child process. Messages
+// are dispatched on the main child thread. The ChildThread base class
+// creates an instance and delegates calls to it.
+class AppCacheDispatcher {
+ public:
+ bool OnMessageReceived(const IPC::Message& msg);
+
+ private:
+ // AppCacheContextImpl related messages
+ void OnAppCacheSelected(int context_id,
+ int select_request_id,
+ int64 app_cache_id);
+};
+
+#endif // CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_H_
diff --git a/chrome/common/app_cache/app_cache_dispatcher_host.cc b/chrome/common/app_cache/app_cache_dispatcher_host.cc
new file mode 100644
index 0000000..98c774d
--- /dev/null
+++ b/chrome/common/app_cache/app_cache_dispatcher_host.cc
@@ -0,0 +1,60 @@
+// Copyright (c) 2009 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/app_cache/app_cache_dispatcher_host.h"
+
+#include "chrome/common/render_messages.h"
+
+AppCacheDispatcherHost::~AppCacheDispatcherHost() {
+ if (sender_) {
+ // TODO(michaeln): plumb to request_context_->app_cache_service
+ // to remove contexts for the child process that is going away.
+ }
+}
+
+void AppCacheDispatcherHost::Initialize(IPC::Message::Sender* sender) {
+ DCHECK(sender);
+ sender_ = sender;
+ // TODO(michaeln): plumb to request_context_->app_cache_service to
+ // tell it about this child process coming into existance
+}
+
+bool AppCacheDispatcherHost::OnMessageReceived(const IPC::Message& msg,
+ bool *msg_ok) {
+ DCHECK(sender_);
+ *msg_ok = true;
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP_EX(AppCacheDispatcherHost, msg, *msg_ok)
+ IPC_MESSAGE_HANDLER(AppCacheMsg_ContextCreated, OnContextCreated);
+ IPC_MESSAGE_HANDLER(AppCacheMsg_ContextDestroyed, OnContextDestroyed);
+ IPC_MESSAGE_HANDLER(AppCacheMsg_SelectAppCache, OnSelectAppCache);
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP_EX()
+ return handled;
+}
+
+void AppCacheDispatcherHost::OnContextCreated(
+ WebAppCacheContext::ContextType context_type,
+ int context_id,
+ int opt_parent_id) {
+ // TODO(michaeln): implement me, plumb to request_context->app_cache_service
+ DCHECK(context_id != WebAppCacheContext::kNoAppCacheContextId);
+}
+
+void AppCacheDispatcherHost::OnContextDestroyed(int context_id) {
+ // TODO(michaeln): implement me, plumb to request_context->app_cache_service
+ DCHECK(context_id != WebAppCacheContext::kNoAppCacheContextId);
+}
+
+void AppCacheDispatcherHost::OnSelectAppCache(
+ int context_id,
+ int select_request_id,
+ const GURL& document_url,
+ int64 cache_document_was_loaded_from,
+ const GURL& opt_manifest_url) {
+ // TODO(michaeln): implement me, plumb to request_context->app_cache_service
+ DCHECK(context_id != WebAppCacheContext::kNoAppCacheContextId);
+ Send(new AppCacheMsg_AppCacheSelected(context_id, select_request_id,
+ WebAppCacheContext::kNoAppCacheId));
+}
diff --git a/chrome/common/app_cache/app_cache_dispatcher_host.h b/chrome/common/app_cache/app_cache_dispatcher_host.h
new file mode 100644
index 0000000..e84a7fd
--- /dev/null
+++ b/chrome/common/app_cache/app_cache_dispatcher_host.h
@@ -0,0 +1,43 @@
+// Copyright (c) 2009 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.
+
+#ifndef CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_HOST_H_
+#define CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_HOST_H_
+
+#include "base/id_map.h"
+#include "chrome/common/ipc_message.h"
+#include "webkit/glue/webappcachecontext.h"
+
+class GURL;
+
+// Handles app cache related messages sent to the main browser process from
+// its child processes. There is a distinct host for each child process.
+// Messages are handled on the IO thread. The ResourceMessageFilter creates
+// an instance and delegates calls to it.
+class AppCacheDispatcherHost {
+ public:
+ AppCacheDispatcherHost() : sender_(NULL) {}
+ ~AppCacheDispatcherHost();
+ void Initialize(IPC::Message::Sender* sender);
+ bool OnMessageReceived(const IPC::Message& msg, bool* msg_is_ok);
+
+ private:
+ // AppCacheContextImpl related messages
+ void OnContextCreated(WebAppCacheContext::ContextType context_type,
+ int context_id, int opt_parent_id);
+ void OnContextDestroyed(int context_id);
+ void OnSelectAppCache(int context_id,
+ int select_request_id,
+ const GURL& document_url,
+ int64 cache_document_was_loaded_from,
+ const GURL& opt_manifest_url);
+
+ bool Send(IPC::Message* msg) {
+ return sender_->Send(msg);
+ }
+
+ IPC::Message::Sender* sender_;
+};
+
+#endif // CHROME_COMMON_APP_CACHE_APP_CACHE_DISPATCHER_HOST_H_
diff --git a/chrome/common/common.vcproj b/chrome/common/common.vcproj
index 19dc26a..a5ec901 100644
--- a/chrome/common/common.vcproj
+++ b/chrome/common/common.vcproj
@@ -329,6 +329,34 @@
>
</File>
</Filter>
+ <Filter
+ Name="app_cache"
+ >
+ <File
+ RelativePath=".\app_cache\app_cache_context_impl.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\app_cache\app_cache_context_impl.h"
+ >
+ </File>
+ <File
+ RelativePath=".\app_cache\app_cache_dispatcher.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\app_cache\app_cache_dispatcher.h"
+ >
+ </File>
+ <File
+ RelativePath=".\app_cache\app_cache_dispatcher_host.cc"
+ >
+ </File>
+ <File
+ RelativePath=".\app_cache\app_cache_dispatcher_host.h"
+ >
+ </File>
+ </Filter>
<File
RelativePath=".\animation.cc"
>
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 0d5404a..32f8f57 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -33,6 +33,7 @@
#include "webkit/glue/password_form_dom_manager.h"
#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/glue/webaccessibility.h"
+#include "webkit/glue/webappcachecontext.h"
#include "webkit/glue/webdropdata.h"
#include "webkit/glue/webplugin.h"
#include "webkit/glue/webpreferences.h"
@@ -275,6 +276,10 @@ struct ViewHostMsg_Resource_Request {
// Used by plugin->browser requests to get the correct URLRequestContext.
uint32 request_context;
+ // Indicates which frame (or worker context) the request is being loaded into,
+ // or kNoAppCacheContextId.
+ int32 app_cache_context_id;
+
// Optional upload data (may be null).
scoped_refptr<net::UploadData> upload_data;
};
@@ -1222,6 +1227,7 @@ struct ParamTraits<ViewHostMsg_Resource_Request> {
WriteParam(m, p.origin_pid);
WriteParam(m, p.resource_type);
WriteParam(m, p.request_context);
+ WriteParam(m, p.app_cache_context_id);
WriteParam(m, p.upload_data);
}
static bool Read(const Message* m, void** iter, param_type* r) {
@@ -1238,6 +1244,7 @@ struct ParamTraits<ViewHostMsg_Resource_Request> {
ReadParam(m, iter, &r->origin_pid) &&
ReadParam(m, iter, &r->resource_type) &&
ReadParam(m, iter, &r->request_context) &&
+ ReadParam(m, iter, &r->app_cache_context_id) &&
ReadParam(m, iter, &r->upload_data);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -1261,6 +1268,8 @@ struct ParamTraits<ViewHostMsg_Resource_Request> {
LogParam(p.resource_type, l);
l->append(L", ");
LogParam(p.request_context, l);
+ l->append(L", ");
+ LogParam(p.app_cache_context_id, l);
l->append(L")");
}
};
@@ -1352,6 +1361,7 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
WriteParam(m, p.charset);
WriteParam(m, p.security_info);
WriteParam(m, p.content_length);
+ WriteParam(m, p.app_cache_id);
WriteParam(m, p.response_data_file);
}
static bool Read(const Message* m, void** iter, param_type* r) {
@@ -1363,6 +1373,7 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
ReadParam(m, iter, &r->charset) &&
ReadParam(m, iter, &r->security_info) &&
ReadParam(m, iter, &r->content_length) &&
+ ReadParam(m, iter, &r->app_cache_id) &&
ReadParam(m, iter, &r->response_data_file);
}
static void Log(const param_type& p, std::wstring* l) {
@@ -1378,6 +1389,10 @@ struct ParamTraits<webkit_glue::ResourceLoaderBridge::ResponseInfo> {
LogParam(p.charset, l);
l->append(L", ");
LogParam(p.security_info, l);
+ l->append(L", ");
+ LogParam(p.content_length, l);
+ l->append(L", ");
+ LogParam(p.app_cache_id, l);
l->append(L")");
}
};
@@ -1779,6 +1794,40 @@ struct ParamTraits<AudioOutputStream::State> {
}
};
+template <>
+struct ParamTraits<WebAppCacheContext::ContextType> {
+ typedef WebAppCacheContext::ContextType param_type;
+ static void Write(Message* m, const param_type& p) {
+ m->WriteInt(static_cast<int>(p));
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ int type;
+ if (!m->ReadInt(iter, &type))
+ return false;
+ *p = static_cast<param_type>(type);
+ return true;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ std::wstring state;
+ switch (p) {
+ case WebAppCacheContext::MAIN_FRAME:
+ state = L"MAIN_FRAME";
+ break;
+ case WebAppCacheContext::CHILD_FRAME:
+ state = L"CHILD_FRAME";
+ break;
+ case WebAppCacheContext::DEDICATED_WORKER:
+ state = L"DECICATED_WORKER";
+ break;
+ default:
+ state = L"UNKNOWN";
+ break;
+ }
+
+ LogParam(state, l);
+ }
+};
+
} // namespace IPC
diff --git a/chrome/common/render_messages_internal.h b/chrome/common/render_messages_internal.h
index a39dca8..cec72e5 100644
--- a/chrome/common/render_messages_internal.h
+++ b/chrome/common/render_messages_internal.h
@@ -20,6 +20,7 @@
#include "chrome/common/transport_dib.h"
#include "skia/include/SkBitmap.h"
#include "webkit/glue/dom_operations.h"
+#include "webkit/glue/webappcachecontext.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webplugin.h"
@@ -484,6 +485,14 @@ IPC_BEGIN_MESSAGES(View)
// into a full window).
IPC_MESSAGE_ROUTED0(ViewMsg_DisassociateFromPopupCount)
+ // Notifies the renderer of the AppCache that has been selected for a
+ // a particular context (or frame). This is sent in reply to
+ // one of the two AppCacheMsg_SelectAppCache messages.
+ IPC_MESSAGE_CONTROL3(AppCacheMsg_AppCacheSelected,
+ int /* context_id */,
+ int /* select_request_id */,
+ int64 /* cache_id */)
+
// Reply to the ViewHostMsg_QueryFormFieldAutofill message with the autofill
// suggestions.
IPC_MESSAGE_ROUTED4(ViewMsg_AutofillSuggestions,
@@ -1196,6 +1205,34 @@ IPC_BEGIN_MESSAGES(ViewHost)
gfx::NativeViewId /* window */,
gfx::Rect /* Out: Window location */)
+ // Informs the browser of a new context.
+ IPC_MESSAGE_CONTROL3(AppCacheMsg_ContextCreated,
+ WebAppCacheContext::ContextType,
+ int /* context_id */,
+ int /* opt_parent_context_id */)
+
+ // Informs the browser of a context being destroyed.
+ IPC_MESSAGE_CONTROL1(AppCacheMsg_ContextDestroyed,
+ int /* context_id */)
+
+ // Initiates the cache selection algorithm for the given context.
+ // This is sent after new content has been committed, but prior to
+ // any subresource loads. An AppCacheMsg_AppCacheSelected message will
+ // be sent in response.
+ // 'context_id' indentifies a specific frame or worker
+ // 'select_request_id' indentifies this particular invocation the algorithm
+ // and will be returned to the caller with the response
+ // 'document_url' the url of the main resource commited to the frame
+ // 'cache_document_was_loaded_frame' the id of the appcache the main resource
+ // was loaded from or kNoAppCacheId
+ // 'opt_manifest_url' the manifest url specified in the <html> tag if any
+ IPC_MESSAGE_CONTROL5(AppCacheMsg_SelectAppCache,
+ int /* context_id */,
+ int /* select_request_id */,
+ GURL /* document_url */,
+ int64 /* cache_document_was_loaded_from */,
+ GURL /* opt_manifest_url */)
+
// Returns the resizer box location in the window this widget is embeded.
// Important for Mac OS X, but not Win or Linux.
IPC_SYNC_MESSAGE_ROUTED1_1(ViewHostMsg_GetRootWindowResizerRect,
diff --git a/chrome/common/resource_dispatcher.cc b/chrome/common/resource_dispatcher.cc
index c507510..c5712ea 100644
--- a/chrome/common/resource_dispatcher.cc
+++ b/chrome/common/resource_dispatcher.cc
@@ -56,6 +56,7 @@ class IPCResourceLoaderBridge : public ResourceLoaderBridge {
int origin_pid,
ResourceType::Type resource_type,
uint32 request_context,
+ int app_cache_context_id,
int route_id);
virtual ~IPCResourceLoaderBridge();
@@ -110,6 +111,7 @@ IPCResourceLoaderBridge::IPCResourceLoaderBridge(
int origin_pid,
ResourceType::Type resource_type,
uint32 request_context,
+ int app_cache_context_id,
int route_id)
: peer_(NULL),
dispatcher_(dispatcher),
@@ -128,6 +130,7 @@ IPCResourceLoaderBridge::IPCResourceLoaderBridge(
request_.origin_pid = origin_pid;
request_.resource_type = resource_type;
request_.request_context = request_context;
+ request_.app_cache_context_id = app_cache_context_id;
#ifdef LOG_RESOURCE_REQUESTS
url_ = url.possibly_invalid_spec();
@@ -531,6 +534,7 @@ webkit_glue::ResourceLoaderBridge* ResourceDispatcher::CreateBridge(
int origin_pid,
ResourceType::Type resource_type,
uint32 request_context,
+ int app_cache_context_id,
int route_id) {
return new webkit_glue::IPCResourceLoaderBridge(this, method, url, policy_url,
referrer, frame_origin,
@@ -538,7 +542,9 @@ webkit_glue::ResourceLoaderBridge* ResourceDispatcher::CreateBridge(
default_mime_type,
flags, origin_pid,
resource_type,
- request_context, route_id);
+ request_context,
+ app_cache_context_id,
+ route_id);
}
bool ResourceDispatcher::IsResourceDispatcherMessage(
diff --git a/chrome/common/resource_dispatcher.h b/chrome/common/resource_dispatcher.h
index 73d0a8b3..bc511e94 100644
--- a/chrome/common/resource_dispatcher.h
+++ b/chrome/common/resource_dispatcher.h
@@ -32,7 +32,7 @@ class ResourceDispatcher {
// handled, else false.
bool OnMessageReceived(const IPC::Message& message);
- // creates a ResourceLoaderBridge for this type of dispatcher, this is so
+ // Creates a ResourceLoaderBridge for this type of dispatcher, this is so
// this can be tested regardless of the ResourceLoaderBridge::Create
// implementation.
webkit_glue::ResourceLoaderBridge* CreateBridge(const std::string& method,
@@ -47,6 +47,7 @@ class ResourceDispatcher {
int origin_pid,
ResourceType::Type resource_type,
uint32 request_context /* used for plugin->browser requests */,
+ int app_cache_context_id,
int route_id);
// Adds a request from the pending_requests_ list, returning the new
diff --git a/chrome/common/resource_dispatcher_unittest.cc b/chrome/common/resource_dispatcher_unittest.cc
index 00a5f4d..e079364 100644
--- a/chrome/common/resource_dispatcher_unittest.cc
+++ b/chrome/common/resource_dispatcher_unittest.cc
@@ -10,8 +10,8 @@
#include "chrome/common/filter_policy.h"
#include "chrome/common/render_messages.h"
#include "chrome/common/resource_dispatcher.h"
-
#include "testing/gtest/include/gtest/gtest.h"
+#include "webkit/glue/webappcachecontext.h"
using webkit_glue::ResourceLoaderBridge;
@@ -157,6 +157,7 @@ TEST_F(ResourceDispatcherTest, RoundTrip) {
dispatcher_->CreateBridge("GET", GURL(test_page_url), GURL(test_page_url),
GURL(), "null", "null", std::string(), "", 0, 0,
ResourceType::SUB_RESOURCE, 0,
+ WebAppCacheContext::kNoAppCacheContextId,
MSG_ROUTING_CONTROL);
bridge->Start(&callback);