| Index: webkit/appcache/appcache_update_job.h
|
| ===================================================================
|
| --- webkit/appcache/appcache_update_job.h (revision 52941)
|
| +++ webkit/appcache/appcache_update_job.h (working copy)
|
| @@ -20,6 +20,7 @@
|
| #include "webkit/appcache/appcache.h"
|
| #include "webkit/appcache/appcache_host.h"
|
| #include "webkit/appcache/appcache_interfaces.h"
|
| +#include "webkit/appcache/appcache_response.h"
|
| #include "webkit/appcache/appcache_storage.h"
|
|
|
| namespace appcache {
|
| @@ -49,7 +50,6 @@
|
| typedef std::vector<AppCacheHost*> PendingHosts;
|
| typedef std::map<GURL, PendingHosts> PendingMasters;
|
| typedef std::map<GURL, URLRequest*> PendingUrlFetches;
|
| - typedef std::pair<GURL, bool> UrlsToFetch; // flag TRUE if storage checked
|
| typedef std::map<int64, GURL> LoadingResponses;
|
|
|
| static const int kRerunDelayMs = 1000;
|
| @@ -82,6 +82,16 @@
|
| STORED,
|
| };
|
|
|
| + struct UrlToFetch {
|
| + GURL url;
|
| + bool storage_checked;
|
| + scoped_refptr<AppCacheResponseInfo> existing_response_info;
|
| + UrlToFetch(const GURL& url, bool checked, AppCacheResponseInfo* info)
|
| + : url(url), storage_checked(checked), existing_response_info(info) {}
|
| + };
|
| +
|
| + UpdateJobInfo* GetUpdateJobInfo(URLRequest* request);
|
| +
|
| // Methods for URLRequest::Delegate.
|
| void OnResponseStarted(URLRequest* request);
|
| void OnReadCompleted(URLRequest* request, int bytes_read);
|
| @@ -108,10 +118,10 @@
|
|
|
| void FetchManifest(bool is_first_fetch);
|
|
|
| - // Add extra HTTP headers to the request based on the response info and
|
| - // start the URL request.
|
| - void AddHttpHeadersAndFetch(URLRequest* request,
|
| - const net::HttpResponseInfo* info);
|
| + // Add extra conditional HTTP headers to the request based on the
|
| + // currently cached response headers.
|
| + void AddConditionalHeaders(URLRequest* request,
|
| + const net::HttpResponseInfo* info);
|
|
|
| void OnResponseCompleted(URLRequest* request);
|
|
|
| @@ -180,7 +190,8 @@
|
| // Returns false if immediately obvious that data cannot be loaded from
|
| // newest complete cache.
|
| bool MaybeLoadFromNewestCache(const GURL& url, AppCacheEntry& entry);
|
| - void LoadFromNewestCacheFailed(const GURL& url);
|
| + void LoadFromNewestCacheFailed(const GURL& url,
|
| + AppCacheResponseInfo* newest_response_info);
|
|
|
| // Does nothing if update process is still waiting for pending master
|
| // entries or URL fetches to complete downloading. Otherwise, completes
|
| @@ -233,7 +244,7 @@
|
| // Helper container to track which urls have not been fetched yet. URLs are
|
| // removed when the fetch is initiated. Flag indicates whether an attempt
|
| // to load the URL from storage has already been tried and failed.
|
| - std::deque<UrlsToFetch> urls_to_fetch_;
|
| + std::deque<UrlToFetch> urls_to_fetch_;
|
|
|
| // Helper container to track which urls are being loaded from response
|
| // storage.
|
|
|