| Index: content/renderer/service_worker/service_worker_cache_storage_dispatcher.cc
|
| diff --git a/content/renderer/service_worker/service_worker_cache_storage_dispatcher.cc b/content/renderer/service_worker/service_worker_cache_storage_dispatcher.cc
|
| index 596d7c562e90f691fe615d253591aa159379952f..b483b7d8f39b939079761c5bf865ca36774a3dc1 100644
|
| --- a/content/renderer/service_worker/service_worker_cache_storage_dispatcher.cc
|
| +++ b/content/renderer/service_worker/service_worker_cache_storage_dispatcher.cc
|
| @@ -204,9 +204,7 @@ ServiceWorkerCacheStorageDispatcher::ServiceWorkerCacheStorageDispatcher(
|
| weak_factory_(this) {}
|
|
|
| ServiceWorkerCacheStorageDispatcher::~ServiceWorkerCacheStorageDispatcher() {
|
| - ClearCallbacksMapWithErrors(&get_callbacks_);
|
| ClearCallbacksMapWithErrors(&has_callbacks_);
|
| - ClearCallbacksMapWithErrors(&create_callbacks_);
|
| ClearCallbacksMapWithErrors(&open_callbacks_);
|
| ClearCallbacksMapWithErrors(&delete_callbacks_);
|
| ClearCallbacksMapWithErrors(&keys_callbacks_);
|
| @@ -221,24 +219,16 @@ bool ServiceWorkerCacheStorageDispatcher::OnMessageReceived(
|
| const IPC::Message& message) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(ServiceWorkerCacheStorageDispatcher, message)
|
| - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageGetSuccess,
|
| - OnCacheStorageGetSuccess)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageHasSuccess,
|
| OnCacheStorageHasSuccess)
|
| - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageCreateSuccess,
|
| - OnCacheStorageCreateSuccess)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageOpenSuccess,
|
| OnCacheStorageOpenSuccess)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageDeleteSuccess,
|
| OnCacheStorageDeleteSuccess)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageKeysSuccess,
|
| OnCacheStorageKeysSuccess)
|
| - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageGetError,
|
| - OnCacheStorageGetError)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageHasError,
|
| OnCacheStorageHasError)
|
| - IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageCreateError,
|
| - OnCacheStorageCreateError)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageOpenError,
|
| OnCacheStorageOpenError)
|
| IPC_MESSAGE_HANDLER(ServiceWorkerMsg_CacheStorageDeleteError,
|
| @@ -267,16 +257,6 @@ bool ServiceWorkerCacheStorageDispatcher::OnMessageReceived(
|
| return handled;
|
| }
|
|
|
| -void ServiceWorkerCacheStorageDispatcher::OnCacheStorageGetSuccess(
|
| - int request_id,
|
| - int cache_id) {
|
| - WebCache* web_cache = new WebCache(weak_factory_.GetWeakPtr(), cache_id);
|
| - web_caches_.AddWithID(web_cache, cache_id);
|
| - CacheStorageWithCacheCallbacks* callbacks = get_callbacks_.Lookup(request_id);
|
| - callbacks->onSuccess(web_cache);
|
| - get_callbacks_.Remove(request_id);
|
| -}
|
| -
|
| void ServiceWorkerCacheStorageDispatcher::OnCacheStorageHasSuccess(
|
| int request_id) {
|
| CacheStorageCallbacks* callbacks = has_callbacks_.Lookup(request_id);
|
| @@ -284,17 +264,6 @@ void ServiceWorkerCacheStorageDispatcher::OnCacheStorageHasSuccess(
|
| has_callbacks_.Remove(request_id);
|
| }
|
|
|
| -void ServiceWorkerCacheStorageDispatcher::OnCacheStorageCreateSuccess(
|
| - int request_id,
|
| - int cache_id) {
|
| - WebCache* web_cache = new WebCache(weak_factory_.GetWeakPtr(), cache_id);
|
| - web_caches_.AddWithID(web_cache, cache_id);
|
| - CacheStorageWithCacheCallbacks* callbacks =
|
| - create_callbacks_.Lookup(request_id);
|
| - callbacks->onSuccess(web_cache);
|
| - create_callbacks_.Remove(request_id);
|
| -}
|
| -
|
| void ServiceWorkerCacheStorageDispatcher::OnCacheStorageOpenSuccess(
|
| int request_id,
|
| int cache_id) {
|
| @@ -325,15 +294,6 @@ void ServiceWorkerCacheStorageDispatcher::OnCacheStorageKeysSuccess(
|
| keys_callbacks_.Remove(request_id);
|
| }
|
|
|
| -void ServiceWorkerCacheStorageDispatcher::OnCacheStorageGetError(
|
| - int request_id,
|
| - blink::WebServiceWorkerCacheError reason) {
|
| - CacheStorageWithCacheCallbacks* callbacks =
|
| - get_callbacks_.Lookup(request_id);
|
| - callbacks->onError(&reason);
|
| - get_callbacks_.Remove(request_id);
|
| -}
|
| -
|
| void ServiceWorkerCacheStorageDispatcher::OnCacheStorageHasError(
|
| int request_id,
|
| blink::WebServiceWorkerCacheError reason) {
|
| @@ -342,15 +302,6 @@ void ServiceWorkerCacheStorageDispatcher::OnCacheStorageHasError(
|
| has_callbacks_.Remove(request_id);
|
| }
|
|
|
| -void ServiceWorkerCacheStorageDispatcher::OnCacheStorageCreateError(
|
| - int request_id,
|
| - blink::WebServiceWorkerCacheError reason) {
|
| - CacheStorageWithCacheCallbacks* callbacks =
|
| - create_callbacks_.Lookup(request_id);
|
| - callbacks->onError(&reason);
|
| - create_callbacks_.Remove(request_id);
|
| -}
|
| -
|
| void ServiceWorkerCacheStorageDispatcher::OnCacheStorageOpenError(
|
| int request_id,
|
| blink::WebServiceWorkerCacheError reason) {
|
| @@ -461,14 +412,6 @@ void ServiceWorkerCacheStorageDispatcher::OnCacheBatchError(
|
| cache_batch_callbacks_.Remove(request_id);
|
| }
|
|
|
| -void ServiceWorkerCacheStorageDispatcher::dispatchGet(
|
| - CacheStorageWithCacheCallbacks* callbacks,
|
| - const blink::WebString& cacheName) {
|
| - int request_id = get_callbacks_.Add(callbacks);
|
| - script_context_->Send(new ServiceWorkerHostMsg_CacheStorageGet(
|
| - script_context_->GetRoutingID(), request_id, cacheName));
|
| -}
|
| -
|
| void ServiceWorkerCacheStorageDispatcher::dispatchHas(
|
| CacheStorageCallbacks* callbacks,
|
| const blink::WebString& cacheName) {
|
| @@ -477,14 +420,6 @@ void ServiceWorkerCacheStorageDispatcher::dispatchHas(
|
| script_context_->GetRoutingID(), request_id, cacheName));
|
| }
|
|
|
| -void ServiceWorkerCacheStorageDispatcher::dispatchCreate(
|
| - CacheStorageWithCacheCallbacks* callbacks,
|
| - const blink::WebString& cacheName) {
|
| - int request_id = create_callbacks_.Add(callbacks);
|
| - script_context_->Send(new ServiceWorkerHostMsg_CacheStorageCreate(
|
| - script_context_->GetRoutingID(), request_id, cacheName));
|
| -}
|
| -
|
| void ServiceWorkerCacheStorageDispatcher::dispatchOpen(
|
| CacheStorageWithCacheCallbacks* callbacks,
|
| const blink::WebString& cacheName) {
|
|
|