Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / content / browser / service_worker / service_worker_job_coordinator.cc
index 13e4b4b..c3bfb39 100644 (file)
@@ -71,14 +71,14 @@ ServiceWorkerJobCoordinator::~ServiceWorkerJobCoordinator() {
 void ServiceWorkerJobCoordinator::Register(
     const GURL& pattern,
     const GURL& script_url,
-    int source_process_id,
+    ServiceWorkerProviderHost* provider_host,
     const ServiceWorkerRegisterJob::RegistrationCallback& callback) {
   scoped_ptr<ServiceWorkerRegisterJobBase> job(
       new ServiceWorkerRegisterJob(context_, pattern, script_url));
   ServiceWorkerRegisterJob* queued_job =
       static_cast<ServiceWorkerRegisterJob*>(
           job_queues_[pattern].Push(job.Pass()));
-  queued_job->AddCallback(callback, source_process_id);
+  queued_job->AddCallback(callback, provider_host);
 }
 
 void ServiceWorkerJobCoordinator::Unregister(
@@ -94,6 +94,8 @@ void ServiceWorkerJobCoordinator::Unregister(
 
 void ServiceWorkerJobCoordinator::Update(
     ServiceWorkerRegistration* registration) {
+  DCHECK(registration);
+  DCHECK(registration->GetNewestVersion());
   job_queues_[registration->pattern()].Push(
       make_scoped_ptr<ServiceWorkerRegisterJobBase>(
           new ServiceWorkerRegisterJob(context_, registration)));