Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsPermission.h" |
michael@0 | 7 | #include "nsIClassInfoImpl.h" |
michael@0 | 8 | |
michael@0 | 9 | // nsPermission Implementation |
michael@0 | 10 | |
michael@0 | 11 | NS_IMPL_CLASSINFO(nsPermission, nullptr, 0, {0}) |
michael@0 | 12 | NS_IMPL_ISUPPORTS_CI(nsPermission, nsIPermission) |
michael@0 | 13 | |
michael@0 | 14 | nsPermission::nsPermission(const nsACString &aHost, |
michael@0 | 15 | uint32_t aAppId, |
michael@0 | 16 | bool aIsInBrowserElement, |
michael@0 | 17 | const nsACString &aType, |
michael@0 | 18 | uint32_t aCapability, |
michael@0 | 19 | uint32_t aExpireType, |
michael@0 | 20 | int64_t aExpireTime) |
michael@0 | 21 | : mHost(aHost) |
michael@0 | 22 | , mType(aType) |
michael@0 | 23 | , mCapability(aCapability) |
michael@0 | 24 | , mExpireType(aExpireType) |
michael@0 | 25 | , mExpireTime(aExpireTime) |
michael@0 | 26 | , mAppId(aAppId) |
michael@0 | 27 | , mIsInBrowserElement(aIsInBrowserElement) |
michael@0 | 28 | { |
michael@0 | 29 | } |
michael@0 | 30 | |
michael@0 | 31 | NS_IMETHODIMP |
michael@0 | 32 | nsPermission::GetHost(nsACString &aHost) |
michael@0 | 33 | { |
michael@0 | 34 | aHost = mHost; |
michael@0 | 35 | return NS_OK; |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | NS_IMETHODIMP |
michael@0 | 39 | nsPermission::GetAppId(uint32_t* aAppId) |
michael@0 | 40 | { |
michael@0 | 41 | *aAppId = mAppId; |
michael@0 | 42 | return NS_OK; |
michael@0 | 43 | } |
michael@0 | 44 | |
michael@0 | 45 | NS_IMETHODIMP |
michael@0 | 46 | nsPermission::GetIsInBrowserElement(bool* aIsInBrowserElement) |
michael@0 | 47 | { |
michael@0 | 48 | *aIsInBrowserElement = mIsInBrowserElement; |
michael@0 | 49 | return NS_OK; |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | NS_IMETHODIMP |
michael@0 | 53 | nsPermission::GetType(nsACString &aType) |
michael@0 | 54 | { |
michael@0 | 55 | aType = mType; |
michael@0 | 56 | return NS_OK; |
michael@0 | 57 | } |
michael@0 | 58 | |
michael@0 | 59 | NS_IMETHODIMP |
michael@0 | 60 | nsPermission::GetCapability(uint32_t *aCapability) |
michael@0 | 61 | { |
michael@0 | 62 | *aCapability = mCapability; |
michael@0 | 63 | return NS_OK; |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | NS_IMETHODIMP |
michael@0 | 67 | nsPermission::GetExpireType(uint32_t *aExpireType) |
michael@0 | 68 | { |
michael@0 | 69 | *aExpireType = mExpireType; |
michael@0 | 70 | return NS_OK; |
michael@0 | 71 | } |
michael@0 | 72 | |
michael@0 | 73 | NS_IMETHODIMP |
michael@0 | 74 | nsPermission::GetExpireTime(int64_t *aExpireTime) |
michael@0 | 75 | { |
michael@0 | 76 | *aExpireTime = mExpireTime; |
michael@0 | 77 | return NS_OK; |
michael@0 | 78 | } |