2001-03-29 02:11:48 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2001-03-29 02:11:48 +00:00
|
|
|
|
|
|
|
#include "nsPermission.h"
|
2013-06-06 19:59:31 +00:00
|
|
|
#include "nsIClassInfoImpl.h"
|
2001-03-29 02:11:48 +00:00
|
|
|
|
|
|
|
// nsPermission Implementation
|
|
|
|
|
2013-06-06 19:59:31 +00:00
|
|
|
NS_IMPL_CLASSINFO(nsPermission, nullptr, 0, {0})
|
2014-04-27 07:06:00 +00:00
|
|
|
NS_IMPL_ISUPPORTS_CI(nsPermission, nsIPermission)
|
2001-03-29 02:11:48 +00:00
|
|
|
|
2003-06-18 00:52:59 +00:00
|
|
|
nsPermission::nsPermission(const nsACString &aHost,
|
2012-08-23 18:37:31 +00:00
|
|
|
uint32_t aAppId,
|
|
|
|
bool aIsInBrowserElement,
|
2003-07-09 00:20:57 +00:00
|
|
|
const nsACString &aType,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aCapability,
|
|
|
|
uint32_t aExpireType,
|
|
|
|
int64_t aExpireTime)
|
2003-06-18 00:52:59 +00:00
|
|
|
: mHost(aHost)
|
|
|
|
, mType(aType)
|
|
|
|
, mCapability(aCapability)
|
2009-10-16 21:01:04 +00:00
|
|
|
, mExpireType(aExpireType)
|
|
|
|
, mExpireTime(aExpireTime)
|
2012-08-23 18:37:31 +00:00
|
|
|
, mAppId(aAppId)
|
|
|
|
, mIsInBrowserElement(aIsInBrowserElement)
|
2003-03-21 02:50:58 +00:00
|
|
|
{
|
2001-03-29 02:11:48 +00:00
|
|
|
}
|
|
|
|
|
2012-08-23 18:37:31 +00:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsPermission::GetHost(nsACString &aHost)
|
2003-03-22 01:24:51 +00:00
|
|
|
{
|
2012-08-23 18:37:31 +00:00
|
|
|
aHost = mHost;
|
|
|
|
return NS_OK;
|
2001-03-29 02:11:48 +00:00
|
|
|
}
|
|
|
|
|
2003-06-18 00:52:59 +00:00
|
|
|
NS_IMETHODIMP
|
2012-08-23 18:37:31 +00:00
|
|
|
nsPermission::GetAppId(uint32_t* aAppId)
|
2003-06-18 00:52:59 +00:00
|
|
|
{
|
2012-08-23 18:37:31 +00:00
|
|
|
*aAppId = mAppId;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsPermission::GetIsInBrowserElement(bool* aIsInBrowserElement)
|
|
|
|
{
|
|
|
|
*aIsInBrowserElement = mIsInBrowserElement;
|
2003-03-22 01:24:51 +00:00
|
|
|
return NS_OK;
|
2001-03-29 02:11:48 +00:00
|
|
|
}
|
|
|
|
|
2003-06-18 00:52:59 +00:00
|
|
|
NS_IMETHODIMP
|
2003-07-09 00:20:57 +00:00
|
|
|
nsPermission::GetType(nsACString &aType)
|
2003-06-18 00:52:59 +00:00
|
|
|
{
|
2003-07-09 00:20:57 +00:00
|
|
|
aType = mType;
|
2001-03-29 02:11:48 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2003-06-18 00:52:59 +00:00
|
|
|
NS_IMETHODIMP
|
2012-08-22 15:56:38 +00:00
|
|
|
nsPermission::GetCapability(uint32_t *aCapability)
|
2003-06-18 00:52:59 +00:00
|
|
|
{
|
2003-03-22 01:24:51 +00:00
|
|
|
*aCapability = mCapability;
|
2001-03-29 02:11:48 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2009-10-16 21:01:04 +00:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-22 15:56:38 +00:00
|
|
|
nsPermission::GetExpireType(uint32_t *aExpireType)
|
2009-10-16 21:01:04 +00:00
|
|
|
{
|
|
|
|
*aExpireType = mExpireType;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-22 15:56:38 +00:00
|
|
|
nsPermission::GetExpireTime(int64_t *aExpireTime)
|
2009-10-16 21:01:04 +00:00
|
|
|
{
|
|
|
|
*aExpireTime = mExpireTime;
|
|
|
|
return NS_OK;
|
|
|
|
}
|