| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_H_ | 5 #ifndef CONTENT_RENDERER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_H_ |
| 6 #define CONTENT_RENDERER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_H_ | 6 #define CONTENT_RENDERER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> |
| 9 |
| 8 #include <vector> | 10 #include <vector> |
| 9 | 11 |
| 10 #include "base/id_map.h" | 12 #include "base/id_map.h" |
| 11 #include "base/macros.h" | 13 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 14 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 15 #include "content/public/child/worker_thread.h" | 17 #include "content/public/child/worker_thread.h" |
| 16 #include "content/public/renderer/render_process_observer.h" | 18 #include "content/public/renderer/render_process_observer.h" |
| 17 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerCache.h" | 19 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerCache.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 typedef IDMap<blink::WebServiceWorkerCacheStorage::CacheStorageCallbacks, | 157 typedef IDMap<blink::WebServiceWorkerCacheStorage::CacheStorageCallbacks, |
| 156 IDMapOwnPointer> CallbacksMap; | 158 IDMapOwnPointer> CallbacksMap; |
| 157 typedef IDMap< | 159 typedef IDMap< |
| 158 blink::WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks, | 160 blink::WebServiceWorkerCacheStorage::CacheStorageWithCacheCallbacks, |
| 159 IDMapOwnPointer> WithCacheCallbacksMap; | 161 IDMapOwnPointer> WithCacheCallbacksMap; |
| 160 typedef IDMap<blink::WebServiceWorkerCacheStorage::CacheStorageKeysCallbacks, | 162 typedef IDMap<blink::WebServiceWorkerCacheStorage::CacheStorageKeysCallbacks, |
| 161 IDMapOwnPointer> KeysCallbacksMap; | 163 IDMapOwnPointer> KeysCallbacksMap; |
| 162 typedef IDMap<blink::WebServiceWorkerCacheStorage::CacheStorageMatchCallbacks, | 164 typedef IDMap<blink::WebServiceWorkerCacheStorage::CacheStorageMatchCallbacks, |
| 163 IDMapOwnPointer> StorageMatchCallbacksMap; | 165 IDMapOwnPointer> StorageMatchCallbacksMap; |
| 164 | 166 |
| 165 typedef base::hash_map<int32, base::TimeTicks> TimeMap; | 167 typedef base::hash_map<int32_t, base::TimeTicks> TimeMap; |
| 166 | 168 |
| 167 typedef IDMap<blink::WebServiceWorkerCache::CacheMatchCallbacks, | 169 typedef IDMap<blink::WebServiceWorkerCache::CacheMatchCallbacks, |
| 168 IDMapOwnPointer> MatchCallbacksMap; | 170 IDMapOwnPointer> MatchCallbacksMap; |
| 169 typedef IDMap<blink::WebServiceWorkerCache::CacheWithResponsesCallbacks, | 171 typedef IDMap<blink::WebServiceWorkerCache::CacheWithResponsesCallbacks, |
| 170 IDMapOwnPointer> WithResponsesCallbacksMap; | 172 IDMapOwnPointer> WithResponsesCallbacksMap; |
| 171 typedef IDMap<blink::WebServiceWorkerCache::CacheWithRequestsCallbacks, | 173 typedef IDMap<blink::WebServiceWorkerCache::CacheWithRequestsCallbacks, |
| 172 IDMapOwnPointer> WithRequestsCallbacksMap; | 174 IDMapOwnPointer> WithRequestsCallbacksMap; |
| 173 using BatchCallbacksMap = | 175 using BatchCallbacksMap = |
| 174 IDMap<blink::WebServiceWorkerCache::CacheBatchCallbacks, IDMapOwnPointer>; | 176 IDMap<blink::WebServiceWorkerCache::CacheBatchCallbacks, IDMapOwnPointer>; |
| 175 | 177 |
| 176 static int32 CurrentWorkerId() { return WorkerThread::GetCurrentId(); } | 178 static int32_t CurrentWorkerId() { return WorkerThread::GetCurrentId(); } |
| 177 | 179 |
| 178 void PopulateWebResponseFromResponse( | 180 void PopulateWebResponseFromResponse( |
| 179 const ServiceWorkerResponse& response, | 181 const ServiceWorkerResponse& response, |
| 180 blink::WebServiceWorkerResponse* web_response); | 182 blink::WebServiceWorkerResponse* web_response); |
| 181 | 183 |
| 182 blink::WebVector<blink::WebServiceWorkerResponse> WebResponsesFromResponses( | 184 blink::WebVector<blink::WebServiceWorkerResponse> WebResponsesFromResponses( |
| 183 const std::vector<ServiceWorkerResponse>& responses); | 185 const std::vector<ServiceWorkerResponse>& responses); |
| 184 | 186 |
| 185 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 187 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 186 | 188 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 212 TimeMap cache_batch_times_; | 214 TimeMap cache_batch_times_; |
| 213 | 215 |
| 214 base::WeakPtrFactory<CacheStorageDispatcher> weak_factory_; | 216 base::WeakPtrFactory<CacheStorageDispatcher> weak_factory_; |
| 215 | 217 |
| 216 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcher); | 218 DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcher); |
| 217 }; | 219 }; |
| 218 | 220 |
| 219 } // namespace content | 221 } // namespace content |
| 220 | 222 |
| 221 #endif // CONTENT_RENDERER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_H_ | 223 #endif // CONTENT_RENDERER_CACHE_STORAGE_CACHE_STORAGE_DISPATCHER_H_ |
| OLD | NEW |