Chromium Code Reviews| Index: content/browser/service_worker/service_worker_cache_listener.h |
| diff --git a/content/browser/service_worker/service_worker_cache_listener.h b/content/browser/service_worker/service_worker_cache_listener.h |
| index 27a6089019946382624155b3db88bf1eb8933ba0..9408f4f0a57733cc60ca83626e7417fc019e1bd6 100644 |
| --- a/content/browser/service_worker/service_worker_cache_listener.h |
| +++ b/content/browser/service_worker/service_worker_cache_listener.h |
| @@ -35,12 +35,18 @@ class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener { |
| const base::string16& cache_name); |
| void OnCacheStorageKeys(int request_id); |
| + // TODO(gavinp,jkarlin): Plumb a message up from the renderer saying that the |
| + // renderer is done with a cache id. |
| + |
| private: |
| + typedef int32_t CacheID; // TODO(jkarlin): Bump to 64 bit. |
|
michaeln
2014/09/09 20:04:58
Up till now cacheID uniquely identified a particul
jkarlin
2014/09/10 15:06:13
Nice catch. Fixed. CacheListener now only stores
|
| + typedef std::map<CacheID, scoped_refptr<ServiceWorkerCache> > IDToCacheMap; |
| + |
| void Send(const IPC::Message& message); |
| void OnCacheStorageGetCallback( |
| int request_id, |
| - int cache_id, |
| + const scoped_refptr<ServiceWorkerCache>& cache, |
| ServiceWorkerCacheStorage::CacheStorageError error); |
| void OnCacheStorageHasCallback( |
| int request_id, |
| @@ -48,7 +54,7 @@ class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener { |
| ServiceWorkerCacheStorage::CacheStorageError error); |
| void OnCacheStorageCreateCallback( |
| int request_id, |
| - int cache_id, |
| + const scoped_refptr<ServiceWorkerCache>& cache, |
| ServiceWorkerCacheStorage::CacheStorageError error); |
| void OnCacheStorageDeleteCallback( |
| int request_id, |
| @@ -65,6 +71,9 @@ class ServiceWorkerCacheListener : public EmbeddedWorkerInstance::Listener { |
| // The ServiceWorkerContextCore should always outlive this. |
| base::WeakPtr<ServiceWorkerContextCore> context_; |
| + IDToCacheMap cache_map_; |
| + CacheID next_cache_id_; |
| + |
| base::WeakPtrFactory<ServiceWorkerCacheListener> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerCacheListener); |