mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1930983 - Remove unused test-only ServiceWorkerContainer.getScopeForUrl helper. r=saschanaz,dom-worker-reviewers,webidl,edenchuang
Differential Revision: https://phabricator.services.mozilla.com/D229063
This commit is contained in:
parent
411d09c294
commit
49670b2a3b
@ -606,39 +606,6 @@ Promise* ServiceWorkerContainer::GetReady(ErrorResult& aRv) {
|
||||
return mReadyPromise;
|
||||
}
|
||||
|
||||
// Testing only.
|
||||
void ServiceWorkerContainer::GetScopeForUrl(const nsAString& aUrl,
|
||||
nsString& aScope,
|
||||
ErrorResult& aRv) {
|
||||
nsCOMPtr<nsIServiceWorkerManager> swm =
|
||||
mozilla::components::ServiceWorkerManager::Service();
|
||||
if (!swm) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsPIDOMWindowInner> window = GetOwnerWindow();
|
||||
if (NS_WARN_IF(!window)) {
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
nsresult rv = StoragePrincipalHelper::GetPrincipal(
|
||||
window,
|
||||
StaticPrefs::privacy_partition_serviceWorkers()
|
||||
? StoragePrincipalHelper::eForeignPartitionedPrincipal
|
||||
: StoragePrincipalHelper::eRegularPrincipal,
|
||||
getter_AddRefs(principal));
|
||||
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
aRv.Throw(rv);
|
||||
return;
|
||||
}
|
||||
|
||||
aRv = swm->GetScopeForUrl(principal, aUrl, aScope);
|
||||
}
|
||||
|
||||
nsIGlobalObject* ServiceWorkerContainer::GetGlobalIfValid(
|
||||
ErrorResult& aRv,
|
||||
const std::function<void(nsIGlobalObject*)>&& aStorageFailureCB) const {
|
||||
|
@ -35,12 +35,6 @@ interface ServiceWorkerContainer : EventTarget {
|
||||
attribute EventHandler onmessageerror;
|
||||
};
|
||||
|
||||
// Testing only.
|
||||
partial interface ServiceWorkerContainer {
|
||||
[Throws,Pref="dom.serviceWorkers.testing.enabled"]
|
||||
DOMString getScopeForUrl(DOMString url);
|
||||
};
|
||||
|
||||
dictionary RegistrationOptions {
|
||||
USVString scope;
|
||||
ServiceWorkerUpdateViaCache updateViaCache = "imports";
|
||||
|
Loading…
Reference in New Issue
Block a user