Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1342)

Unified Diff: content/browser/service_worker/service_worker_register_job.h

Issue 380093002: Update installed ServiceWorkers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 f005c8c1bab810113ee4d81bce1d23a682e9afb3..cc8a4a98f376f4cda6b64b0aa531980dd731b44a 100644
--- a/content/browser/service_worker/service_worker_register_job.h
+++ b/content/browser/service_worker/service_worker_register_job.h
@@ -41,10 +41,16 @@ class ServiceWorkerRegisterJob
ServiceWorkerVersion* version)>
RegistrationCallback;
+ // For registration jobs.
CONTENT_EXPORT ServiceWorkerRegisterJob(
base::WeakPtr<ServiceWorkerContextCore> context,
const GURL& pattern,
const GURL& script_url);
+
+ // For update jobs.
+ CONTENT_EXPORT ServiceWorkerRegisterJob(
+ base::WeakPtr<ServiceWorkerContextCore> context,
+ ServiceWorkerRegistration* registration);
virtual ~ServiceWorkerRegisterJob();
// Registers a callback to be called when the promise would resolve (whether
@@ -96,7 +102,10 @@ class ServiceWorkerRegisterJob
void SetPhase(Phase phase);
- void HandleExistingRegistrationAndContinue(
+ void ContinueWithRegistration(
+ ServiceWorkerStatusCode status,
+ const scoped_refptr<ServiceWorkerRegistration>& registration);
+ void ContinueWithUpdate(
ServiceWorkerStatusCode status,
const scoped_refptr<ServiceWorkerRegistration>& registration);
void RegisterAndContinue(ServiceWorkerStatusCode status);
@@ -109,7 +118,6 @@ class ServiceWorkerRegisterJob
void OnActivateFinished(ServiceWorkerStatusCode status);
void Complete(ServiceWorkerStatusCode status);
void CompleteInternal(ServiceWorkerStatusCode status);
-
void ResolvePromise(ServiceWorkerStatusCode status,
ServiceWorkerRegistration* registration,
ServiceWorkerVersion* version);
@@ -118,6 +126,11 @@ class ServiceWorkerRegisterJob
virtual void OnPausedAfterDownload() OVERRIDE;
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ void OnCompareScriptResourcesComplete(
+ ServiceWorkerVersion* current_version,
+ ServiceWorkerStatusCode status,
+ int compare_result);
+
// Associates an installing version to documents matched with a scope of the
// version.
CONTENT_EXPORT static void AssociateInstallingVersionToDocuments(
@@ -144,6 +157,7 @@ class ServiceWorkerRegisterJob
// The ServiceWorkerContextCore object should always outlive this.
base::WeakPtr<ServiceWorkerContextCore> context_;
+ RegistrationJobType job_type_;
const GURL pattern_;
const GURL script_url_;
std::vector<RegistrationCallback> callbacks_;

Powered by Google App Engine
This is Rietveld 408576698