Index: extensions/browser/service_worker_manager.cc |
diff --git a/extensions/browser/service_worker_manager.cc b/extensions/browser/service_worker_manager.cc |
index 16167d4e3d9cfa31b25e5602c9fbb32d4b68f1b3..e85e9c8e3e6ecb130f0ec0c0d3da3a81239842d5 100644 |
--- a/extensions/browser/service_worker_manager.cc |
+++ b/extensions/browser/service_worker_manager.cc |
@@ -48,4 +48,18 @@ void ServiceWorkerManager::OnExtensionUninstalled( |
->DeleteForOrigin(extension->url(), base::Bind(&EmptySuccessCallback)); |
} |
+void ServiceWorkerManager::OnExtensionWillBeInstalled( |
+ content::BrowserContext* browser_context, |
+ const Extension* extension, |
+ bool is_update, |
+ bool from_ephemeral, |
+ const std::string& old_name) { |
+ if (is_update) { |
Devlin
2015/11/11 17:10:29
nit: A brief comment saying why we do this would p
lazyboy
2015/11/11 22:34:03
Done.
|
+ content::BrowserContext::GetStoragePartitionForSite(browser_context_, |
+ extension->url()) |
+ ->GetServiceWorkerContext() |
+ ->SetForceUpdateOnPageLoadForOrigin(extension->url()); |
+ } |
+} |
+ |
} // namespace extensions |