Index: content/browser/service_worker/service_worker_provider_host.cc |
diff --git a/content/browser/service_worker/service_worker_provider_host.cc b/content/browser/service_worker/service_worker_provider_host.cc |
index 340b8cfa4cf330ad9c0400463c8d0766391ae9c6..d13702e155e33c21164b3da96332f7a441f6773c 100644 |
--- a/content/browser/service_worker/service_worker_provider_host.cc |
+++ b/content/browser/service_worker/service_worker_provider_host.cc |
@@ -11,6 +11,7 @@ |
#include "content/browser/service_worker/service_worker_controllee_request_handler.h" |
#include "content/browser/service_worker/service_worker_dispatcher_host.h" |
#include "content/browser/service_worker/service_worker_handle.h" |
+#include "content/browser/service_worker/service_worker_registration_handle.h" |
#include "content/browser/service_worker/service_worker_utils.h" |
#include "content/browser/service_worker/service_worker_version.h" |
#include "content/common/service_worker/service_worker_messages.h" |
@@ -99,7 +100,11 @@ void ServiceWorkerProviderHost::SetVersionAttributes( |
attributes.active = CreateHandleAndPass(active_version); |
dispatcher_host_->Send(new ServiceWorkerMsg_SetVersionAttributes( |
- kDocumentMainThreadId, provider_id(), mask.changed(), attributes)); |
+ kDocumentMainThreadId, |
+ provider_id(), |
+ kInvalidServiceWorkerRegistrationHandleId, |
michaeln
2014/08/13 04:18:16
why invalid?
ok, now i see why (so handlrefs inst
|
+ mask.changed(), |
+ attributes)); |
} |
void ServiceWorkerProviderHost::SetVersionAttributesInternal( |
@@ -242,6 +247,21 @@ ServiceWorkerObjectInfo ServiceWorkerProviderHost::CreateHandleAndPass( |
return info; |
} |
+int ServiceWorkerProviderHost::CreateRegistrationHandleAndPass( |
+ ServiceWorkerRegistration* registration) { |
+ if (!context_ || !registration) |
+ return kInvalidServiceWorkerRegistrationHandleId; |
+ scoped_ptr<ServiceWorkerRegistrationHandle> handle( |
+ new ServiceWorkerRegistrationHandle(context_, |
+ dispatcher_host_, |
+ kDocumentMainThreadId, |
+ provider_id_, |
+ registration)); |
+ int handle_id = handle->handle_id(); |
+ dispatcher_host_->RegisterServiceWorkerRegistrationHandle(handle.Pass()); |
+ return handle_id; |
+} |
+ |
bool ServiceWorkerProviderHost::IsContextAlive() { |
return context_ != NULL; |
} |