summaryrefslogtreecommitdiffstats
path: root/webkit/appcache/appcache_update_job.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-01 01:17:22 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-01 01:17:22 +0000
commit9c00acacfbd2742ff923b6f819c5aaf828348ca7 (patch)
tree2e7d81896791e0b914c0fa646ac798fea66c582b /webkit/appcache/appcache_update_job.h
parent60253bdae0411c6660b907744d10174a3c7d524a (diff)
downloadchromium_src-9c00acacfbd2742ff923b6f819c5aaf828348ca7.zip
chromium_src-9c00acacfbd2742ff923b6f819c5aaf828348ca7.tar.gz
chromium_src-9c00acacfbd2742ff923b6f819c5aaf828348ca7.tar.bz2
Revert 33394 (due to valgrind errors) - Appcache update support for pending master entries:
Update process issues a URL request to fetch pending master entries. Pending master entry fetch logic kept separate from regular url fetching as this will be the case in the longterm solution. No optimizations to avoid issuing URL request if pending master entry is also listed in the manifest. (simpler) Only optimized to prevent refetching something that has already been successfully fetched. Longterm optimized solution should be to siphon the responses as the master resource is downloaded instead of having the update job issue URL requests. TEST=new tests for update jobs with pending master entries BUG=none Review URL: http://codereview.chromium.org/402098 TBR=jennb@chromium.org Review URL: http://codereview.chromium.org/449036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33405 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/appcache/appcache_update_job.h')
-rw-r--r--webkit/appcache/appcache_update_job.h39
1 files changed, 1 insertions, 38 deletions
diff --git a/webkit/appcache/appcache_update_job.h b/webkit/appcache/appcache_update_job.h
index 7c60ef1..b60ca0b 100644
--- a/webkit/appcache/appcache_update_job.h
+++ b/webkit/appcache/appcache_update_job.h
@@ -7,16 +7,12 @@
#include <deque>
#include <map>
-#include <set>
-#include <string>
-#include <vector>
#include "base/ref_counted.h"
#include "base/task.h"
#include "googleurl/src/gurl.h"
#include "net/url_request/url_request.h"
#include "webkit/appcache/appcache.h"
-#include "webkit/appcache/appcache_host.h"
#include "webkit/appcache/appcache_interfaces.h"
#include "webkit/appcache/appcache_storage.h"
@@ -26,8 +22,7 @@ class UpdateJobInfo;
// Application cache Update algorithm and state.
class AppCacheUpdateJob : public URLRequest::Delegate,
- public AppCacheStorage::Delegate,
- public AppCacheHost::Observer {
+ public AppCacheStorage::Delegate {
public:
AppCacheUpdateJob(AppCacheService* service, AppCacheGroup* group);
~AppCacheUpdateJob();
@@ -61,8 +56,6 @@ class AppCacheUpdateJob : public URLRequest::Delegate,
FETCH_MANIFEST,
NO_UPDATE,
DOWNLOADING,
-
- // Every state after this comment indicates the update is terminating.
REFETCH_MANIFEST,
CACHE_FAILURE,
CANCELLED,
@@ -81,10 +74,6 @@ class AppCacheUpdateJob : public URLRequest::Delegate,
void OnGroupAndNewestCacheStored(AppCacheGroup* group, bool success);
void OnGroupMadeObsolete(AppCacheGroup* group, bool success);
- // Methods for AppCacheHost::Observer.
- void OnCacheSelectionComplete(AppCacheHost* host) {} // N/A
- void OnDestructionImminent(AppCacheHost* host);
-
void FetchManifest(bool is_first_fetch);
void OnResponseCompleted(URLRequest* request);
@@ -108,7 +97,6 @@ class AppCacheUpdateJob : public URLRequest::Delegate,
void ContinueHandleManifestFetchCompleted(bool changed);
void HandleUrlFetchCompleted(URLRequest* request);
- void HandleMasterEntryFetchCompleted(URLRequest* request);
void HandleManifestRefetchCompleted(URLRequest* request);
void OnManifestInfoWriteComplete(int result);
@@ -130,22 +118,8 @@ class AppCacheUpdateJob : public URLRequest::Delegate,
void BuildUrlFileList(const Manifest& manifest);
void AddUrlToFileList(const GURL& url, int type);
void FetchUrls();
- void CancelAllUrlFetches();
bool ShouldSkipUrlFetch(const AppCacheEntry& entry);
- // If entry already exists in the cache currently being updated, merge
- // the entry type information with the existing entry.
- // Returns true if entry exists in cache currently being updated.
- bool AlreadyFetchedEntry(const GURL& url, int entry_type);
-
- // TODO(jennb): Delete when update no longer fetches master entries directly.
- // Creates the list of master entries that need to be fetched and initiates
- // fetches.
- void AddMasterEntryToFetchList(AppCacheHost* host, const GURL& url,
- bool is_new);
- void FetchMasterEntries();
- void CancelAllMasterEntryFetches();
-
// Asynchronously loads the entry from the newest complete cache if the
// HTTP caching semantics allow.
// Returns false if immediately obvious that data cannot be loaded from
@@ -170,14 +144,11 @@ class AppCacheUpdateJob : public URLRequest::Delegate,
void ScheduleUpdateRetry(int delay_ms);
void Cancel();
- void ClearPendingMasterEntries();
void DiscardInprogressCache();
// Deletes this object after letting the stack unwind.
void DeleteSoon();
- bool IsTerminating() { return internal_state_ >= REFETCH_MANIFEST; }
-
// This factory will be used to schedule invocations of various methods.
ScopedRunnableMethodFactory<AppCacheUpdateJob> method_factory_;
@@ -200,14 +171,6 @@ class AppCacheUpdateJob : public URLRequest::Delegate,
PendingMasters pending_master_entries_;
size_t master_entries_completed_;
- // TODO(jennb): Delete when update no longer fetches master entries directly.
- // Helper containers to track which pending master entries have yet to be
- // fetched and which are currently being fetched. Master entries that
- // are listed in the manifest may be fetched as a regular URL instead of
- // as a separate master entry fetch to optimize against duplicate fetches.
- std::set<GURL> master_entries_to_fetch_;
- PendingUrlFetches master_entry_fetches_;
-
// URLs of files to fetch along with their flags.
AppCache::EntryMap url_file_list_;
size_t url_fetches_completed_;