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:
Andrew Sutherland 2024-11-15 16:45:41 +00:00
parent 411d09c294
commit 49670b2a3b
2 changed files with 0 additions and 39 deletions

View File

@ -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 {

View File

@ -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";