mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-11 08:13:35 +00:00
Bug 1731982 - Part 5: Using foreign partitioned principal when creating clientSource in ServiceWorkerManager. r=asuth
Currently, the ServiceWorkerManager creates a content prinipcal based on the regular originAttributes when dispatch the fetch event. This patch changes to use the foreign partitioned originAttributs. Note that we don't add tests for this because the change doesn't change the behavior. And we don't enable partitioned third-party Service Worker. So, the existing test cases is enough for this. Differential Revision: https://phabricator.services.mozilla.com/D127632
This commit is contained in:
parent
2997f5f4a1
commit
e65d0db962
@ -61,6 +61,7 @@
|
||||
#include "mozilla/PermissionManager.h"
|
||||
#include "mozilla/ScopeExit.h"
|
||||
#include "mozilla/StaticPrefs_extensions.h"
|
||||
#include "mozilla/StoragePrincipalHelper.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/EnumSet.h"
|
||||
|
||||
@ -2042,8 +2043,13 @@ void ServiceWorkerManager::DispatchFetchEvent(nsIInterceptedChannel* aChannel,
|
||||
}
|
||||
|
||||
// non-subresource request means the URI contains the principal
|
||||
nsCOMPtr<nsIPrincipal> principal = BasePrincipal::CreateContentPrincipal(
|
||||
uri, loadInfo->GetOriginAttributes());
|
||||
OriginAttributes attrs = loadInfo->GetOriginAttributes();
|
||||
StoragePrincipalHelper::GetOriginAttributes(
|
||||
internalChannel, attrs,
|
||||
StoragePrincipalHelper::eForeignPartitionedPrincipal);
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal =
|
||||
BasePrincipal::CreateContentPrincipal(uri, attrs);
|
||||
|
||||
RefPtr<ServiceWorkerRegistrationInfo> registration =
|
||||
GetServiceWorkerRegistrationInfo(principal, uri);
|
||||
|
Loading…
Reference in New Issue
Block a user