Chromium Code Reviews| Index: content/child/service_worker/service_worker_message_filter.cc |
| diff --git a/content/child/service_worker/service_worker_message_filter.cc b/content/child/service_worker/service_worker_message_filter.cc |
| index 14dc6d758c451277c1fe38e1eebd17dc190496a1..71e783f35ff8041a3c711870c63ce2713e6464e9 100644 |
| --- a/content/child/service_worker/service_worker_message_filter.cc |
| +++ b/content/child/service_worker/service_worker_message_filter.cc |
| @@ -27,6 +27,15 @@ void SendServiceWorkerObjectDestroyed( |
| new ServiceWorkerHostMsg_DecrementServiceWorkerRefCount(handle_id)); |
| } |
| +void SendRegistrationObjectDestroyed( |
| + scoped_refptr<ThreadSafeSender> sender, |
|
michaeln
2014/08/13 04:18:17
can this be a raw ptr instead of pass by scoped_re
nhiroki
2014/08/13 13:15:05
Done.
|
| + int handle_id) { |
| + if (handle_id == kInvalidServiceWorkerRegistrationHandleId) |
| + return; |
| + sender->Send( |
| + new ServiceWorkerHostMsg_DecrementRegistrationRefCount(handle_id)); |
| +} |
| + |
| } // namespace |
| ServiceWorkerMessageFilter::ServiceWorkerMessageFilter(ThreadSafeSender* sender) |
| @@ -72,13 +81,16 @@ void ServiceWorkerMessageFilter::OnStaleMessageReceived( |
| void ServiceWorkerMessageFilter::OnStaleRegistered( |
| int thread_id, |
| int request_id, |
| + int registration_handle_id, |
| const ServiceWorkerObjectInfo& info) { |
| SendServiceWorkerObjectDestroyed(thread_safe_sender_, info.handle_id); |
| + SendRegistrationObjectDestroyed(thread_safe_sender_, registration_handle_id); |
| } |
| void ServiceWorkerMessageFilter::OnStaleSetVersionAttributes( |
| int thread_id, |
| int provider_id, |
| + int registration_handle_id, |
| int changed_mask, |
| const ServiceWorkerVersionAttributes& attributes) { |
| SendServiceWorkerObjectDestroyed(thread_safe_sender_, |
| @@ -87,6 +99,7 @@ void ServiceWorkerMessageFilter::OnStaleSetVersionAttributes( |
| attributes.waiting.handle_id); |
| SendServiceWorkerObjectDestroyed(thread_safe_sender_, |
| attributes.active.handle_id); |
| + SendRegistrationObjectDestroyed(thread_safe_sender_, registration_handle_id); |
| } |
| void ServiceWorkerMessageFilter::OnStaleSetControllerServiceWorker( |