| Index: content/browser/service_worker/service_worker_dispatcher_host.cc
|
| diff --git a/content/browser/service_worker/service_worker_dispatcher_host.cc b/content/browser/service_worker/service_worker_dispatcher_host.cc
|
| index 8fe3ebe6adbea7608fed708445cec34228bbaa3e..d832fd28a1b2065d35bfa03cb0b48a455702da6a 100644
|
| --- a/content/browser/service_worker/service_worker_dispatcher_host.cc
|
| +++ b/content/browser/service_worker/service_worker_dispatcher_host.cc
|
| @@ -88,6 +88,7 @@ bool ServiceWorkerDispatcherHost::OnMessageReceived(
|
| void ServiceWorkerDispatcherHost::OnRegisterServiceWorker(
|
| int32 thread_id,
|
| int32 request_id,
|
| + int32 provider_id,
|
| const GURL& pattern,
|
| const GURL& script_url) {
|
| if (!context_ || !context_->IsEnabled()) {
|
| @@ -111,9 +112,16 @@ void ServiceWorkerDispatcherHost::OnRegisterServiceWorker(
|
| return;
|
| }
|
|
|
| + ServiceWorkerProviderHost* provider_host =
|
| + context_->GetProviderHost(render_process_id_, provider_id);
|
| + if (!provider_host) {
|
| + BadMessageReceived();
|
| + return;
|
| + }
|
| context_->RegisterServiceWorker(
|
| pattern,
|
| script_url,
|
| + provider_host,
|
| base::Bind(&ServiceWorkerDispatcherHost::RegistrationComplete,
|
| this,
|
| thread_id,
|
| @@ -123,6 +131,7 @@ void ServiceWorkerDispatcherHost::OnRegisterServiceWorker(
|
| void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(
|
| int32 thread_id,
|
| int32 request_id,
|
| + int32 provider_id,
|
| const GURL& pattern) {
|
| // TODO(alecflett): This check is insufficient for release. Add a
|
| // ServiceWorker-specific policy query in
|
| @@ -136,8 +145,15 @@ void ServiceWorkerDispatcherHost::OnUnregisterServiceWorker(
|
| return;
|
| }
|
|
|
| + ServiceWorkerProviderHost* provider_host =
|
| + context_->GetProviderHost(render_process_id_, provider_id);
|
| + if (!provider_host) {
|
| + BadMessageReceived();
|
| + return;
|
| + }
|
| context_->UnregisterServiceWorker(
|
| pattern,
|
| + provider_host,
|
| base::Bind(&ServiceWorkerDispatcherHost::UnregistrationComplete,
|
| this,
|
| thread_id,
|
|
|