summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_host.cc
diff options
context:
space:
mode:
authormichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-19 00:49:15 +0000
committermichaeln@google.com <michaeln@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-19 00:49:15 +0000
commitc034941e26f9e62e7f5c9b58cd7a3f52bac1b1db (patch)
treef30ac577ee0832957e9df113393ab33e307b6697 /webkit/appcache/appcache_host.cc
parent2f69b38816cc86ffff8c255a6984376e2aa02c10 (diff)
downloadchromium_src-c034941e26f9e62e7f5c9b58cd7a3f52bac1b1db.zip
chromium_src-c034941e26f9e62e7f5c9b58cd7a3f52bac1b1db.tar.gz
chromium_src-c034941e26f9e62e7f5c9b58cd7a3f52bac1b1db.tar.bz2
Defend against selectCache() being called multiple times. There is a bug filed upstream to fix the HTML parser such that
it won't generate multiple calls to this, but given the complexity of the parser I'm putting this defense directly in the appcache system. BUG=72986,73118 TEST=manually run Poppit Review URL: http://codereview.chromium.org/6546004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75481 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_host.cc')
-rw-r--r--webkit/appcache/appcache_host.cc22
1 files changed, 2 insertions, 20 deletions
diff --git a/webkit/appcache/appcache_host.cc b/webkit/appcache/appcache_host.cc
index 5e8e4db..2bc463f 100644
--- a/webkit/appcache/appcache_host.cc
+++ b/webkit/appcache/appcache_host.cc
@@ -65,31 +65,13 @@ void AppCacheHost::SelectCache(const GURL& document_url,
const GURL& manifest_url) {
DCHECK(!pending_start_update_callback_ &&
!pending_swap_cache_callback_ &&
- !pending_get_status_callback_);
+ !pending_get_status_callback_ &&
+ !is_selection_pending());
if (main_resource_blocked_)
frontend_->OnContentBlocked(host_id_,
blocked_manifest_url_);
- // First we handle an unusual case of SelectCache being called a second
- // time. Generally this shouldn't happen, but with bad content I think
- // this can occur... <html manifest=foo> <html manifest=bar></html></html>
- // We handle this by killing whatever loading we have initiated, and by
- // unassociating any hosts we currently have associated... and starting
- // anew with the inputs to this SelectCache call.
- // TODO(michaeln): at some point determine what behavior the algorithms
- // described in the HTML5 draft produce and have our impl produce those
- // results (or suggest changes to the algorihtms described in the spec
- // if the resulting behavior is just too insane).
- if (is_selection_pending()) {
- service_->storage()->CancelDelegateCallbacks(this);
- pending_selected_manifest_url_ = GURL();
- pending_selected_cache_id_ = kNoCacheId;
- } else if (associated_cache()) {
- AssociateCache(NULL);
- }
- new_master_entry_url_ = GURL();
-
// 6.9.6 The application cache selection algorithm.
// The algorithm is started here and continues in FinishCacheSelection,
// after cache or group loading is complete.