Index: content/browser/service_worker/service_worker_context_wrapper.cc |
diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc |
index aaa375848dd8565094dce92a1fd6447833f22803..6095aab94d72a64e0eb27fe4420d89e1b0cd232c 100644 |
--- a/content/browser/service_worker/service_worker_context_wrapper.cc |
+++ b/content/browser/service_worker/service_worker_context_wrapper.cc |
@@ -332,6 +332,13 @@ void ServiceWorkerContextWrapper::DidGetAllRegistrationsForGetAllOrigins( |
callback.Run(usage_infos); |
} |
+void ServiceWorkerContextWrapper::DidGetRegistrationsForForceUpdateForOrigin( |
+ const std::vector<scoped_refptr<ServiceWorkerRegistration>>& |
+ registrations) { |
+ for (const auto& registration : registrations) |
+ registration->set_force_update_on_page_load(true); |
+} |
+ |
void ServiceWorkerContextWrapper::DidCheckHasServiceWorker( |
const CheckHasServiceWorkerCallback& callback, |
bool has_service_worker) { |
@@ -411,6 +418,27 @@ void ServiceWorkerContextWrapper::DeleteForOrigin( |
origin.GetOrigin(), base::Bind(&StatusCodeToBoolCallbackAdapter, result)); |
} |
+void ServiceWorkerContextWrapper::SetForceUpdateOnPageLoadForOrigin( |
+ const GURL& origin) { |
+ if (!BrowserThread::CurrentlyOn(BrowserThread::IO)) { |
+ BrowserThread::PostTask( |
+ BrowserThread::IO, FROM_HERE, |
+ base::Bind( |
+ &ServiceWorkerContextWrapper::SetForceUpdateOnPageLoadForOrigin, |
+ this, origin)); |
+ return; |
+ } |
+ |
+ if (!context_core_) |
+ return; |
+ |
+ context_core_->storage()->GetRegistrationsForOrigin( |
+ origin.GetOrigin(), |
+ base::Bind(&ServiceWorkerContextWrapper:: |
+ DidGetRegistrationsForForceUpdateForOrigin, |
+ this)); |
+} |
+ |
void ServiceWorkerContextWrapper::CheckHasServiceWorker( |
const GURL& url, |
const GURL& other_url, |