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..0033207df91df3ac6d47b15bdd14606464dd5454 100644 |
--- a/content/child/service_worker/service_worker_message_filter.cc |
+++ b/content/child/service_worker/service_worker_message_filter.cc |
@@ -19,7 +19,7 @@ namespace { |
// Sends a ServiceWorkerObjectDestroyed message to the browser so it can delete |
// the ServiceWorker handle. |
void SendServiceWorkerObjectDestroyed( |
- scoped_refptr<ThreadSafeSender> sender, |
+ ThreadSafeSender* sender, |
int handle_id) { |
if (handle_id == kInvalidServiceWorkerHandleId) |
return; |
@@ -27,6 +27,15 @@ void SendServiceWorkerObjectDestroyed( |
new ServiceWorkerHostMsg_DecrementServiceWorkerRefCount(handle_id)); |
} |
+void SendRegistrationObjectDestroyed( |
+ ThreadSafeSender* sender, |
+ 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( |