зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1456466 P1 Expose a GetPrincipal() convenience method on service worker descriptor classes. r=baku
This commit is contained in:
Родитель
6df5d73ab0
Коммит
c87c8a28af
|
@ -12,6 +12,9 @@
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
using mozilla::ipc::PrincipalInfo;
|
||||
using mozilla::ipc::PrincipalInfoToPrincipal;
|
||||
|
||||
ServiceWorkerDescriptor::ServiceWorkerDescriptor(uint64_t aId,
|
||||
nsIPrincipal* aPrincipal,
|
||||
const nsACString& aScope,
|
||||
|
@ -95,6 +98,14 @@ ServiceWorkerDescriptor::PrincipalInfo() const
|
|||
return mData->principalInfo();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrincipal>
|
||||
ServiceWorkerDescriptor::GetPrincipal() const
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo());
|
||||
return Move(ref);
|
||||
}
|
||||
|
||||
const nsCString&
|
||||
ServiceWorkerDescriptor::Scope() const
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#define _mozilla_dom_ServiceWorkerDescriptor_h
|
||||
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsIPrincipal;
|
||||
|
@ -69,6 +70,9 @@ public:
|
|||
const mozilla::ipc::PrincipalInfo&
|
||||
PrincipalInfo() const;
|
||||
|
||||
nsCOMPtr<nsIPrincipal>
|
||||
GetPrincipal() const;
|
||||
|
||||
const nsCString&
|
||||
Scope() const;
|
||||
|
||||
|
|
|
@ -13,6 +13,9 @@
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
using mozilla::ipc::PrincipalInfo;
|
||||
using mozilla::ipc::PrincipalInfoToPrincipal;
|
||||
|
||||
Maybe<IPCServiceWorkerDescriptor>
|
||||
ServiceWorkerRegistrationDescriptor::NewestInternal() const
|
||||
{
|
||||
|
@ -130,6 +133,14 @@ ServiceWorkerRegistrationDescriptor::PrincipalInfo() const
|
|||
return mData->principalInfo();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrincipal>
|
||||
ServiceWorkerRegistrationDescriptor::GetPrincipal() const
|
||||
{
|
||||
AssertIsOnMainThread();
|
||||
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo());
|
||||
return Move(ref);
|
||||
}
|
||||
|
||||
const nsCString&
|
||||
ServiceWorkerRegistrationDescriptor::Scope() const
|
||||
{
|
||||
|
|
|
@ -73,6 +73,9 @@ public:
|
|||
const mozilla::ipc::PrincipalInfo&
|
||||
PrincipalInfo() const;
|
||||
|
||||
nsCOMPtr<nsIPrincipal>
|
||||
GetPrincipal() const;
|
||||
|
||||
const nsCString&
|
||||
Scope() const;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче