Index: content/browser/service_worker/service_worker_registration_handle.cc |
diff --git a/content/browser/service_worker/service_worker_registration_handle.cc b/content/browser/service_worker/service_worker_registration_handle.cc |
index b32f5a92b9fe3f3a70bbc72674c686eb612632dd..21aa31ef16924f90d6e1900d484cd4a7fa5d169f 100644 |
--- a/content/browser/service_worker/service_worker_registration_handle.cc |
+++ b/content/browser/service_worker/service_worker_registration_handle.cc |
@@ -45,6 +45,23 @@ ServiceWorkerRegistrationHandle::GetObjectInfo() { |
return info; |
} |
+ServiceWorkerObjectInfo |
+ServiceWorkerRegistrationHandle::CreateServiceWorkerHandleAndPass( |
+ ServiceWorkerVersion* version) { |
+ ServiceWorkerObjectInfo info; |
+ if (context_ && version) { |
+ scoped_ptr<ServiceWorkerHandle> handle = |
+ ServiceWorkerHandle::Create(context_, |
+ dispatcher_host_, |
+ kDocumentMainThreadId, |
+ provider_id_, |
+ version); |
+ info = handle->GetObjectInfo(); |
+ dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); |
+ } |
+ return info; |
+} |
+ |
void ServiceWorkerRegistrationHandle::IncrementRefCount() { |
DCHECK_GT(ref_count_, 0); |
++ref_count_; |
@@ -71,6 +88,14 @@ void ServiceWorkerRegistrationHandle::OnRegistrationFailed( |
ClearVersionAttributes(); |
} |
+void ServiceWorkerRegistrationHandle::OnUpdateFound( |
+ ServiceWorkerRegistration* registration) { |
+ if (!dispatcher_host_) |
+ return; // Could be NULL in some tests. |
+ dispatcher_host_->Send(new ServiceWorkerMsg_UpdateFound( |
+ kDocumentMainThreadId, GetObjectInfo())); |
+} |
+ |
void ServiceWorkerRegistrationHandle::SetVersionAttributes( |
ServiceWorkerVersion* installing_version, |
ServiceWorkerVersion* waiting_version, |
@@ -118,21 +143,4 @@ void ServiceWorkerRegistrationHandle::ClearVersionAttributes() { |
SetVersionAttributes(NULL, NULL, NULL); |
} |
-ServiceWorkerObjectInfo |
-ServiceWorkerRegistrationHandle::CreateServiceWorkerHandleAndPass( |
- ServiceWorkerVersion* version) { |
- ServiceWorkerObjectInfo info; |
- if (context_ && version) { |
- scoped_ptr<ServiceWorkerHandle> handle = |
- ServiceWorkerHandle::Create(context_, |
- dispatcher_host_, |
- kDocumentMainThreadId, |
- provider_id_, |
- version); |
- info = handle->GetObjectInfo(); |
- dispatcher_host_->RegisterServiceWorkerHandle(handle.Pass()); |
- } |
- return info; |
-} |
- |
} // namespace content |