summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_host.cc
diff options
context:
space:
mode:
authormichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 02:29:14 +0000
committermichaeln@chromium.org <michaeln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-03 02:29:14 +0000
commit6ed2a5a54b7bb8ccd33da7bc948fee169f128459 (patch)
tree3752c15899760eef346dc2c1f66768aa2f3e676a /webkit/appcache/appcache_host.cc
parentd6bb669008e0308f3ee6e04e77fe903698864e7b (diff)
downloadchromium_src-6ed2a5a54b7bb8ccd33da7bc948fee169f128459.zip
chromium_src-6ed2a5a54b7bb8ccd33da7bc948fee169f128459.tar.gz
chromium_src-6ed2a5a54b7bb8ccd33da7bc948fee169f128459.tar.bz2
Fix for WKBug 47000: a failure mode given bad content (in an unlikely form). The error occurs when an html page is put in an appcache as a fallback resource (so it's listed in a fallback section), but it contains a manifest attribute that refers to a different manifest file. The system should mark the resource as foreign and exclude it from main resource loads, but it was failing to do so. The fix is to do that.
BUG=WK47000 TEST=http/tests/appcache/foreign-fallback.html Review URL: http://codereview.chromium.org/3529009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@64868 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_host.cc')
-rw-r--r--webkit/appcache/appcache_host.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc
index f11293d..e954e80 100644
--- a/webkit/appcache/appcache_host.cc
+++ b/webkit/appcache/appcache_host.cc
@@ -39,7 +39,8 @@ AppCacheHost::AppCacheHost(int host_id, AppCacheFrontend* frontend,
frontend_(frontend), service_(service),
pending_get_status_callback_(NULL), pending_start_update_callback_(NULL),
pending_swap_cache_callback_(NULL), pending_callback_param_(NULL),
- main_resource_blocked_(false), associated_cache_info_pending_(false) {
+ main_resource_was_fallback_(false), main_resource_blocked_(false),
+ associated_cache_info_pending_(false) {
}
AppCacheHost::~AppCacheHost() {
@@ -144,8 +145,10 @@ void AppCacheHost::SelectCacheForSharedWorker(int64 appcache_id) {
// TODO(michaeln): change method name to MarkEntryAsForeign for consistency
void AppCacheHost::MarkAsForeignEntry(const GURL& document_url,
int64 cache_document_was_loaded_from) {
+ // The document url is not the resource url in the fallback case.
service_->storage()->MarkEntryAsForeign(
- document_url, cache_document_was_loaded_from);
+ main_resource_was_fallback_ ? fallback_url_ : document_url,
+ cache_document_was_loaded_from);
SelectCache(document_url, kNoCacheId, GURL());
}
@@ -452,6 +455,11 @@ void AppCacheHost::LoadMainResourceCache(int64 cache_id) {
service_->storage()->LoadCache(cache_id, this);
}
+void AppCacheHost::NotifyMainResourceFallback(const GURL& fallback_url) {
+ main_resource_was_fallback_ = true;
+ fallback_url_ = fallback_url;
+}
+
void AppCacheHost::NotifyMainResourceBlocked(const GURL& manifest_url) {
main_resource_blocked_ = true;
blocked_manifest_url_ = manifest_url;