Bug 1182966 - Part 2: Stop referring to the nsI class for no apparent reason in DomainPolicy. r=mrbkap

This commit is contained in:
Andrew McCreight 2015-07-14 07:59:00 -04:00
parent c5970e3cbb
commit d2abc78961
2 changed files with 24 additions and 24 deletions

View File

@ -62,7 +62,7 @@ DomainPolicy::~DomainPolicy()
NS_IMETHODIMP NS_IMETHODIMP
DomainPolicy::GetBlacklist(nsIDomainSet** aSet) DomainPolicy::GetBlacklist(nsIDomainSet** aSet)
{ {
nsCOMPtr<nsIDomainSet> set = mBlacklist; nsCOMPtr<nsIDomainSet> set = mBlacklist.get();
set.forget(aSet); set.forget(aSet);
return NS_OK; return NS_OK;
} }
@ -70,7 +70,7 @@ DomainPolicy::GetBlacklist(nsIDomainSet** aSet)
NS_IMETHODIMP NS_IMETHODIMP
DomainPolicy::GetSuperBlacklist(nsIDomainSet** aSet) DomainPolicy::GetSuperBlacklist(nsIDomainSet** aSet)
{ {
nsCOMPtr<nsIDomainSet> set = mSuperBlacklist; nsCOMPtr<nsIDomainSet> set = mSuperBlacklist.get();
set.forget(aSet); set.forget(aSet);
return NS_OK; return NS_OK;
} }
@ -78,7 +78,7 @@ DomainPolicy::GetSuperBlacklist(nsIDomainSet** aSet)
NS_IMETHODIMP NS_IMETHODIMP
DomainPolicy::GetWhitelist(nsIDomainSet** aSet) DomainPolicy::GetWhitelist(nsIDomainSet** aSet)
{ {
nsCOMPtr<nsIDomainSet> set = mWhitelist; nsCOMPtr<nsIDomainSet> set = mWhitelist.get();
set.forget(aSet); set.forget(aSet);
return NS_OK; return NS_OK;
} }
@ -86,7 +86,7 @@ DomainPolicy::GetWhitelist(nsIDomainSet** aSet)
NS_IMETHODIMP NS_IMETHODIMP
DomainPolicy::GetSuperWhitelist(nsIDomainSet** aSet) DomainPolicy::GetSuperWhitelist(nsIDomainSet** aSet)
{ {
nsCOMPtr<nsIDomainSet> set = mSuperWhitelist; nsCOMPtr<nsIDomainSet> set = mSuperWhitelist.get();
set.forget(aSet); set.forget(aSet);
return NS_OK; return NS_OK;
} }
@ -122,10 +122,10 @@ void
DomainPolicy::CloneDomainPolicy(DomainPolicyClone* aClone) DomainPolicy::CloneDomainPolicy(DomainPolicyClone* aClone)
{ {
aClone->active() = true; aClone->active() = true;
static_cast<DomainSet*>(mBlacklist.get())->CloneSet(&aClone->blacklist()); mBlacklist->CloneSet(&aClone->blacklist());
static_cast<DomainSet*>(mSuperBlacklist.get())->CloneSet(&aClone->superBlacklist()); mSuperBlacklist->CloneSet(&aClone->superBlacklist());
static_cast<DomainSet*>(mWhitelist.get())->CloneSet(&aClone->whitelist()); mWhitelist->CloneSet(&aClone->whitelist());
static_cast<DomainSet*>(mSuperWhitelist.get())->CloneSet(&aClone->superWhitelist()); mSuperWhitelist->CloneSet(&aClone->superWhitelist());
} }
static static

View File

@ -33,22 +33,6 @@ enum DomainSetType{
SUPER_WHITELIST SUPER_WHITELIST
}; };
class DomainPolicy : public nsIDomainPolicy
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMAINPOLICY
DomainPolicy();
private:
virtual ~DomainPolicy();
nsCOMPtr<nsIDomainSet> mBlacklist;
nsCOMPtr<nsIDomainSet> mSuperBlacklist;
nsCOMPtr<nsIDomainSet> mWhitelist;
nsCOMPtr<nsIDomainSet> mSuperWhitelist;
};
class DomainSet : public nsIDomainSet class DomainSet : public nsIDomainSet
{ {
public: public:
@ -67,6 +51,22 @@ protected:
DomainSetType mType; DomainSetType mType;
}; };
class DomainPolicy : public nsIDomainPolicy
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIDOMAINPOLICY
DomainPolicy();
private:
virtual ~DomainPolicy();
nsRefPtr<DomainSet> mBlacklist;
nsRefPtr<DomainSet> mSuperBlacklist;
nsRefPtr<DomainSet> mWhitelist;
nsRefPtr<DomainSet> mSuperWhitelist;
};
} /* namespace mozilla */ } /* namespace mozilla */
#endif /* DomainPolicy_h__ */ #endif /* DomainPolicy_h__ */