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

Unified Diff: content/browser/service_worker/service_worker_job_coordinator.cc

Issue 1270513002: Service Worker: Make ServiceWorkerRegistration.update() return a promise. (Chromium 2/3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass a raw ptr to callback's onError instead of a scoped_ptr. Created 5 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_job_coordinator.cc
diff --git a/content/browser/service_worker/service_worker_job_coordinator.cc b/content/browser/service_worker/service_worker_job_coordinator.cc
index 71cc1e1347e6c4b28078716a76fb9449ca3fea43..e2e73ff1775a339b19ce7b6a50824f8da8c30037 100644
--- a/content/browser/service_worker/service_worker_job_coordinator.cc
+++ b/content/browser/service_worker/service_worker_job_coordinator.cc
@@ -133,6 +133,21 @@ void ServiceWorkerJobCoordinator::Update(
force_bypass_cache)));
}
+void ServiceWorkerJobCoordinator::Update(
+ ServiceWorkerRegistration* registration,
+ bool force_bypass_cache,
+ ServiceWorkerProviderHost* provider_host,
+ const ServiceWorkerRegisterJob::RegistrationCallback& callback) {
+ DCHECK(registration);
+ DCHECK(registration->GetNewestVersion());
+ ServiceWorkerRegisterJob* queued_job = static_cast<ServiceWorkerRegisterJob*>(
+ job_queues_[registration->pattern()].Push(
+ make_scoped_ptr<ServiceWorkerRegisterJobBase>(
+ new ServiceWorkerRegisterJob(context_, registration,
+ force_bypass_cache))));
+ queued_job->AddCallback(callback, provider_host);
+}
+
void ServiceWorkerJobCoordinator::AbortAll() {
for (RegistrationJobMap::iterator it = job_queues_.begin();
it != job_queues_.end(); ++it) {

Powered by Google App Engine
This is Rietveld 408576698