| Index: content/browser/service_worker/service_worker_script_cache_map.h
|
| diff --git a/content/browser/service_worker/service_worker_script_cache_map.h b/content/browser/service_worker/service_worker_script_cache_map.h
|
| index 7bcbf09eca68837229391c71e95c3b7f2704b0cf..de814c210b17d6d579ecd79b4f92b04a02d363ec 100644
|
| --- a/content/browser/service_worker/service_worker_script_cache_map.h
|
| +++ b/content/browser/service_worker/service_worker_script_cache_map.h
|
| @@ -25,12 +25,16 @@ class ServiceWorkerVersion;
|
| // for a particular version's implicit script resources.
|
| class CONTENT_EXPORT ServiceWorkerScriptCacheMap {
|
| public:
|
| - int64 Lookup(const GURL& url);
|
| + int64 LookupResourceId(const GURL& url);
|
| + // A size of -1 means that we don't know the size yet
|
| + // (it has not finished caching).
|
| + int64 LookupResourceSize(const GURL& url);
|
|
|
| // Used during the initial run of a new version to build the map
|
| // of resources ids.
|
| void NotifyStartedCaching(const GURL& url, int64 resource_id);
|
| void NotifyFinishedCaching(const GURL& url,
|
| + int64 size_bytes,
|
| const net::URLRequestStatus& status);
|
|
|
| // Used to retrieve the results of the initial run of a new version.
|
| @@ -41,14 +45,14 @@ class CONTENT_EXPORT ServiceWorkerScriptCacheMap {
|
| void SetResources(
|
| const std::vector<ServiceWorkerDatabase::ResourceRecord>& resources);
|
|
|
| - size_t size() const { return resource_ids_.size(); }
|
| + size_t size() const { return resource_map_.size(); }
|
|
|
| const net::URLRequestStatus& main_script_status() const {
|
| return main_script_status_;
|
| }
|
|
|
| private:
|
| - typedef std::map<GURL, int64> ResourceIDMap;
|
| + typedef std::map<GURL, ServiceWorkerDatabase::ResourceRecord> ResourceMap;
|
|
|
| // The version objects owns its script cache and provides a rawptr to it.
|
| friend class ServiceWorkerVersion;
|
| @@ -59,7 +63,7 @@ class CONTENT_EXPORT ServiceWorkerScriptCacheMap {
|
|
|
| ServiceWorkerVersion* owner_;
|
| base::WeakPtr<ServiceWorkerContextCore> context_;
|
| - ResourceIDMap resource_ids_;
|
| + ResourceMap resource_map_;
|
| net::URLRequestStatus main_script_status_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptCacheMap);
|
|
|