Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Unified Diff: webkit/appcache/web_application_cache_host_impl.cc

Issue 6546004: Defend against selectCache() being called multiple times.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/appcache/web_application_cache_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/appcache/web_application_cache_host_impl.cc
===================================================================
--- webkit/appcache/web_application_cache_host_impl.cc (revision 75330)
+++ webkit/appcache/web_application_cache_host_impl.cc (working copy)
@@ -72,7 +72,8 @@
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::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 @@
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
« no previous file with comments | « webkit/appcache/web_application_cache_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698