diff options
Diffstat (limited to 'components/script/dom/serviceworkerregistration.rs')
-rw-r--r-- | components/script/dom/serviceworkerregistration.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/components/script/dom/serviceworkerregistration.rs b/components/script/dom/serviceworkerregistration.rs index 3b1ca4fdab0..bd4f1dd03b9 100644 --- a/components/script/dom/serviceworkerregistration.rs +++ b/components/script/dom/serviceworkerregistration.rs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use crate::dom::bindings::codegen::Bindings::ServiceWorkerBinding::ServiceWorkerState; +use crate::dom::bindings::codegen::Bindings::ServiceWorkerRegistrationBinding::ServiceWorkerUpdateViaCache; use crate::dom::bindings::codegen::Bindings::ServiceWorkerRegistrationBinding::{ ServiceWorkerRegistrationMethods, Wrap, }; @@ -25,6 +26,7 @@ pub struct ServiceWorkerRegistration { installing: Option<Dom<ServiceWorker>>, waiting: Option<Dom<ServiceWorker>>, scope: ServoUrl, + update_via_cache: ServiceWorkerUpdateViaCache, uninstalling: Cell<bool>, } @@ -36,9 +38,11 @@ impl ServiceWorkerRegistration { installing: None, waiting: None, scope: scope, + update_via_cache: ServiceWorkerUpdateViaCache::Imports, uninstalling: Cell::new(false), } } + #[allow(unrooted_must_root)] pub fn new( global: &GlobalScope, @@ -138,4 +142,9 @@ impl ServiceWorkerRegistrationMethods for ServiceWorkerRegistration { fn Scope(&self) -> USVString { USVString(self.scope.as_str().to_owned()) } + + // https://w3c.github.io/ServiceWorker/#service-worker-registration-updateviacache + fn UpdateViaCache(&self) -> ServiceWorkerUpdateViaCache { + self.update_via_cache + } } |