| Index: content/browser/service_worker/service_worker_register_job.h
|
| diff --git a/content/browser/service_worker/service_worker_register_job.h b/content/browser/service_worker/service_worker_register_job.h
|
| index c0a7f4c9805a86fac33acc70f5c9b5b809e6a790..b47345af4685ed8b63c4381fe6d00b28d39ec3c5 100644
|
| --- a/content/browser/service_worker/service_worker_register_job.h
|
| +++ b/content/browser/service_worker/service_worker_register_job.h
|
| @@ -10,9 +10,11 @@
|
| #include "base/memory/weak_ptr.h"
|
| #include "content/browser/service_worker/service_worker_registration_status.h"
|
| #include "content/browser/service_worker/service_worker_storage.h"
|
| +#include "content/browser/service_worker/service_worker_version.h"
|
|
|
| namespace content {
|
|
|
| +class EmbeddedWorkerRegistry;
|
| class ServiceWorkerJobCoordinator;
|
|
|
| // A ServiceWorkerRegisterJob lives only for the lifetime of a single
|
| @@ -29,17 +31,22 @@ class ServiceWorkerRegisterJob {
|
| registration)> RegistrationCallback;
|
| typedef base::Callback<void(ServiceWorkerStatusCode status)>
|
| UnregistrationCallback;
|
| + // TODO(alecflett): Unify this with RegistrationCallback
|
| + typedef base::Callback<
|
| + void(const scoped_refptr<ServiceWorkerRegistration>& registration,
|
| + ServiceWorkerStatusCode status)> StatusCallback;
|
|
|
| // All type of jobs (Register and Unregister) complete through a
|
| // single call to this callback on the IO thread.
|
| ServiceWorkerRegisterJob(ServiceWorkerStorage* storage,
|
| + EmbeddedWorkerRegistry* worker_registry,
|
| ServiceWorkerJobCoordinator* coordinator,
|
| const GURL& pattern,
|
| const GURL& script_url,
|
| RegistrationType type);
|
| ~ServiceWorkerRegisterJob();
|
|
|
| - void AddCallback(const RegistrationCallback& callback);
|
| + void AddCallback(const RegistrationCallback& callback, int process_id);
|
|
|
| void Start();
|
|
|
| @@ -77,12 +84,17 @@ class ServiceWorkerRegisterJob {
|
| ServiceWorkerStatusCode previous_status,
|
| const scoped_refptr<ServiceWorkerRegistration>& previous_registration);
|
|
|
| + void StartWorkerAndContinue(
|
| + const StatusCallback& callback,
|
| + ServiceWorkerStatusCode status,
|
| + const scoped_refptr<ServiceWorkerRegistration>& registration);
|
| +
|
| // These methods are the last internal callback in the callback
|
| // chain, and ultimately call callback_.
|
| void UnregisterComplete(ServiceWorkerStatusCode status);
|
| void RegisterComplete(
|
| - ServiceWorkerStatusCode status,
|
| - const scoped_refptr<ServiceWorkerRegistration>& registration);
|
| + const scoped_refptr<ServiceWorkerRegistration>& registration,
|
| + ServiceWorkerStatusCode start_status);
|
|
|
| void RunCallbacks(
|
| ServiceWorkerStatusCode status,
|
| @@ -96,11 +108,14 @@ class ServiceWorkerRegisterJob {
|
| // because we may be cancelling while there are outstanding
|
| // callbacks that expect access to storage_.
|
| ServiceWorkerStorage* storage_;
|
| + EmbeddedWorkerRegistry* worker_registry_;
|
| ServiceWorkerJobCoordinator* coordinator_;
|
| + scoped_refptr<ServiceWorkerVersion> pending_version_;
|
| const GURL pattern_;
|
| const GURL script_url_;
|
| const RegistrationType type_;
|
| std::vector<RegistrationCallback> callbacks_;
|
| + std::vector<int> pending_process_ids_;
|
| base::WeakPtrFactory<ServiceWorkerRegisterJob> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRegisterJob);
|
|
|