зеркало из https://github.com/mozilla/gecko-dev.git
Bug 577976 - Part 5: Remove AddRef from GetStyleSheet, r=bzbarsky
This commit is contained in:
Родитель
d78fcbd193
Коммит
8bbf26beb9
|
@ -83,7 +83,7 @@ protected:
|
|||
NS_DECL_OWNINGTHREAD
|
||||
public:
|
||||
|
||||
virtual already_AddRefed<nsIStyleSheet> GetStyleSheet() const;
|
||||
virtual nsIStyleSheet* GetStyleSheet() const;
|
||||
virtual void SetStyleSheet(nsCSSStyleSheet* aSheet);
|
||||
|
||||
virtual void SetParentRule(GroupRule* aRule);
|
||||
|
|
|
@ -1074,9 +1074,8 @@ DOMCSSDeclarationImpl::GetCSSParsingEnvironment(nsIURI** aSheetURI,
|
|||
*aSheetPrincipal = nsnull;
|
||||
*aCSSLoader = nsnull;
|
||||
|
||||
nsCOMPtr<nsIStyleSheet> sheet;
|
||||
if (mRule) {
|
||||
sheet = mRule->GetStyleSheet();
|
||||
nsIStyleSheet* sheet = mRule->GetStyleSheet();
|
||||
if (sheet) {
|
||||
NS_IF_ADDREF(*aSheetURI = sheet->GetSheetURI());
|
||||
NS_IF_ADDREF(*aBaseURI = sheet->GetBaseURI());
|
||||
|
|
|
@ -86,10 +86,9 @@ namespace css {
|
|||
NS_IMPL_ADDREF(Rule)
|
||||
NS_IMPL_RELEASE(Rule)
|
||||
|
||||
/* virtual */ already_AddRefed<nsIStyleSheet>
|
||||
/* virtual */ nsIStyleSheet*
|
||||
Rule::GetStyleSheet() const
|
||||
{
|
||||
NS_IF_ADDREF(mSheet);
|
||||
return mSheet;
|
||||
}
|
||||
|
||||
|
|
|
@ -1943,8 +1943,7 @@ nsCSSStyleSheet::DeleteRuleFromGroup(css::GroupRule* aGroup, PRUint32 aIndex)
|
|||
NS_ENSURE_TRUE(rule, NS_ERROR_ILLEGAL_VALUE);
|
||||
|
||||
// check that the rule actually belongs to this sheet!
|
||||
nsCOMPtr<nsIStyleSheet> ruleSheet = rule->GetStyleSheet();
|
||||
if (this != ruleSheet) {
|
||||
if (this != rule->GetStyleSheet()) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
@ -1976,8 +1975,7 @@ nsCSSStyleSheet::InsertRuleIntoGroup(const nsAString & aRule,
|
|||
nsresult result;
|
||||
NS_ASSERTION(mInner->mComplete, "No inserting into an incomplete sheet!");
|
||||
// check that the group actually belongs to this sheet!
|
||||
nsCOMPtr<nsIStyleSheet> groupSheet = aGroup->GetStyleSheet();
|
||||
if (this != groupSheet) {
|
||||
if (this != aGroup->GetStyleSheet()) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
|
@ -2047,12 +2045,7 @@ nsCSSStyleSheet::ReplaceRuleInGroup(css::GroupRule* aGroup,
|
|||
{
|
||||
nsresult result;
|
||||
NS_PRECONDITION(mInner->mComplete, "No replacing in an incomplete sheet!");
|
||||
#ifdef DEBUG
|
||||
{
|
||||
nsCOMPtr<nsIStyleSheet> groupSheet = aGroup->GetStyleSheet();
|
||||
NS_ASSERTION(this == groupSheet, "group doesn't belong to this sheet");
|
||||
}
|
||||
#endif
|
||||
NS_ASSERTION(this == aGroup->GetStyleSheet(), "group doesn't belong to this sheet");
|
||||
result = WillDirty();
|
||||
NS_ENSURE_SUCCESS(result, result);
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
|
||||
virtual PRInt32 GetType() const = 0;
|
||||
|
||||
virtual already_AddRefed<nsIStyleSheet> GetStyleSheet() const = 0;
|
||||
virtual nsIStyleSheet* GetStyleSheet() const = 0;
|
||||
virtual void SetStyleSheet(nsCSSStyleSheet* aSheet) = 0;
|
||||
virtual void SetParentRule(mozilla::css::GroupRule* aRule) = 0;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче