2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsPermission.h"
|
2013-06-06 12:59:31 -07:00
|
|
|
#include "nsIClassInfoImpl.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// nsPermission Implementation
|
|
|
|
|
2013-06-06 12:59:31 -07:00
|
|
|
NS_IMPL_CLASSINFO(nsPermission, nullptr, 0, {0})
|
|
|
|
NS_IMPL_ISUPPORTS1_CI(nsPermission, nsIPermission)
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
nsPermission::nsPermission(const nsACString &aHost,
|
2012-08-23 11:37:31 -07:00
|
|
|
uint32_t aAppId,
|
|
|
|
bool aIsInBrowserElement,
|
2007-03-22 10:30:00 -07:00
|
|
|
const nsACString &aType,
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t aCapability,
|
|
|
|
uint32_t aExpireType,
|
|
|
|
int64_t aExpireTime)
|
2007-03-22 10:30:00 -07:00
|
|
|
: mHost(aHost)
|
|
|
|
, mType(aType)
|
|
|
|
, mCapability(aCapability)
|
2009-10-16 14:01:04 -07:00
|
|
|
, mExpireType(aExpireType)
|
|
|
|
, mExpireTime(aExpireTime)
|
2012-08-23 11:37:31 -07:00
|
|
|
, mAppId(aAppId)
|
|
|
|
, mIsInBrowserElement(aIsInBrowserElement)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-08-23 11:37:31 -07:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsPermission::GetHost(nsACString &aHost)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-08-23 11:37:31 -07:00
|
|
|
aHost = mHost;
|
|
|
|
return NS_OK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-23 11:37:31 -07:00
|
|
|
nsPermission::GetAppId(uint32_t* aAppId)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2012-08-23 11:37:31 -07:00
|
|
|
*aAppId = mAppId;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsPermission::GetIsInBrowserElement(bool* aIsInBrowserElement)
|
|
|
|
{
|
|
|
|
*aIsInBrowserElement = mIsInBrowserElement;
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsPermission::GetType(nsACString &aType)
|
|
|
|
{
|
|
|
|
aType = mType;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-22 08:56:38 -07:00
|
|
|
nsPermission::GetCapability(uint32_t *aCapability)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
*aCapability = mCapability;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
2009-10-16 14:01:04 -07:00
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-22 08:56:38 -07:00
|
|
|
nsPermission::GetExpireType(uint32_t *aExpireType)
|
2009-10-16 14:01:04 -07:00
|
|
|
{
|
|
|
|
*aExpireType = mExpireType;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2012-08-22 08:56:38 -07:00
|
|
|
nsPermission::GetExpireTime(int64_t *aExpireTime)
|
2009-10-16 14:01:04 -07:00
|
|
|
{
|
|
|
|
*aExpireTime = mExpireTime;
|
|
|
|
return NS_OK;
|
|
|
|
}
|