summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
Diffstat (limited to 'webkit')
-rw-r--r--webkit/appcache/appcache_host.cc22
-rw-r--r--webkit/appcache/web_application_cache_host_impl.cc11
-rw-r--r--webkit/appcache/web_application_cache_host_impl.h1
3 files changed, 13 insertions, 21 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.
diff --git a/webkit/appcache/web_application_cache_host_impl.cc b/webkit/appcache/web_application_cache_host_impl.cc
index 3d9deb9..0bdc11f 100644
--- a/webkit/appcache/web_application_cache_host_impl.cc
+++ b/webkit/appcache/web_application_cache_host_impl.cc
@@ -72,7 +72,8 @@ WebApplicationCacheHostImpl::WebApplicationCacheHostImpl(
status_(UNCACHED),
is_scheme_supported_(false),
is_get_method_(false),
- is_new_master_entry_(MAYBE) {
+ is_new_master_entry_(MAYBE),
+ was_select_cache_called_(false) {
DCHECK(client && backend && (host_id_ != kNoHostId));
backend_->RegisterHost(host_id_);
@@ -171,6 +172,10 @@ void WebApplicationCacheHostImpl::willStartSubResourceRequest(
}
void WebApplicationCacheHostImpl::selectCacheWithoutManifest() {
+ if (was_select_cache_called_)
+ return;
+ was_select_cache_called_ = true;
+
status_ = (document_response_.appCacheID() == kNoCacheId) ?
UNCACHED : CHECKING;
is_new_master_entry_ = NO;
@@ -181,6 +186,10 @@ void WebApplicationCacheHostImpl::selectCacheWithoutManifest() {
bool WebApplicationCacheHostImpl::selectCacheWithManifest(
const WebURL& manifest_url) {
+ if (was_select_cache_called_)
+ return true;
+ was_select_cache_called_ = true;
+
GURL manifest_gurl(ClearUrlRef(manifest_url));
// 6.9.6 The application cache selection algorithm
diff --git a/webkit/appcache/web_application_cache_host_impl.h b/webkit/appcache/web_application_cache_host_impl.h
index 4304783..c7af54a 100644
--- a/webkit/appcache/web_application_cache_host_impl.h
+++ b/webkit/appcache/web_application_cache_host_impl.h
@@ -75,6 +75,7 @@ class WebApplicationCacheHostImpl : public WebKit::WebApplicationCacheHost {
IsNewMasterEntry is_new_master_entry_;
appcache::AppCacheInfo cache_info_;
GURL original_main_resource_url_; // Used to detect redirection.
+ bool was_select_cache_called_;
};
} // namespace