Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Unified Diff: content/child/service_worker/service_worker_message_filter.cc

Issue 463013002: ServiceWorker: Implement updatefound event and version attributes (Chromium) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add browser-side implementation and wiring part Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(

Powered by Google App Engine
This is Rietveld 408576698