Index: content/browser/service_worker/service_worker_job_coordinator.h |
diff --git a/content/browser/service_worker/service_worker_job_coordinator.h b/content/browser/service_worker/service_worker_job_coordinator.h |
index c3d9c9c3c5bced482743336b9b6ee41f6a1299c3..d82ef095f71ee91e365d23cb2154788ffa861cfb 100644 |
--- a/content/browser/service_worker/service_worker_job_coordinator.h |
+++ b/content/browser/service_worker/service_worker_job_coordinator.h |
@@ -5,6 +5,8 @@ |
#ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_JOB_COORDINATOR_H_ |
#define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_JOB_COORDINATOR_H_ |
+#include <map> |
+ |
#include "base/bind.h" |
#include "base/memory/scoped_vector.h" |
#include "content/browser/service_worker/service_worker_register_job.h" |
@@ -33,13 +35,14 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator { |
const GURL& pattern, |
const ServiceWorkerRegisterJob::UnregistrationCallback& callback); |
+ // Jobs are removed whenever they are finished or canceled. |
+ void FinishJob(ServiceWorkerRegisterJob* job); |
+ |
private: |
friend class ServiceWorkerRegisterJob; |
- typedef ScopedVector<ServiceWorkerRegisterJob> RegistrationJobList; |
- |
- // Jobs are removed whenever they are finished or canceled. |
- void EraseJob(ServiceWorkerRegisterJob* job); |
+ typedef std::map<GURL, std::vector<ServiceWorkerRegisterJob*> > |
+ RegistrationJobMap; |
kinuko
2014/01/08 08:38:36
A question, what flow is expected when we have con
alecflett
2014/01/08 23:59:16
That doesn't happen - registrations are keyed by p
|
// Called at ServiceWorkerRegisterJob completion. |
void RegisterComplete( |
@@ -55,11 +58,14 @@ class CONTENT_EXPORT ServiceWorkerJobCoordinator { |
ServiceWorkerRegistrationStatus status, |
ServiceWorkerRegistration* registration); |
+ bool MostRecentJobEquals(const GURL& pattern, |
+ const GURL& script_url, |
+ ServiceWorkerRegisterJob::RegistrationType type); |
+ |
const base::WeakPtr<ServiceWorkerStorage> storage_; |
base::WeakPtrFactory<ServiceWorkerJobCoordinator> weak_factory_; |
- // A list of currently running jobs. This is a temporary structure until we |
- // start managing overlapping registrations explicitly. |
- RegistrationJobList registration_jobs_; |
+ |
+ RegistrationJobMap jobs_; |
}; |
} // namespace content |