mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
bug 1004746
- part 1 - Remove a bunch of usage of nsAutoPtr's copy ctor r=froydnj
This commit is contained in:
parent
23c1664fb7
commit
42ad93c2a2
@ -12,6 +12,7 @@
|
|||||||
#include "mozilla/EventStates.h"
|
#include "mozilla/EventStates.h"
|
||||||
#include "mozilla/dom/HTMLFormControlsCollection.h"
|
#include "mozilla/dom/HTMLFormControlsCollection.h"
|
||||||
#include "mozilla/dom/HTMLFormElementBinding.h"
|
#include "mozilla/dom/HTMLFormElementBinding.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "nsIHTMLDocument.h"
|
#include "nsIHTMLDocument.h"
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
#include "nsStyleConsts.h"
|
#include "nsStyleConsts.h"
|
||||||
@ -1511,7 +1512,7 @@ HTMLFormElement::FlushPendingSubmission()
|
|||||||
if (mPendingSubmission) {
|
if (mPendingSubmission) {
|
||||||
// Transfer owning reference so that the submissioin doesn't get deleted
|
// Transfer owning reference so that the submissioin doesn't get deleted
|
||||||
// if we reenter
|
// if we reenter
|
||||||
nsAutoPtr<nsFormSubmission> submission = mPendingSubmission;
|
nsAutoPtr<nsFormSubmission> submission = Move(mPendingSubmission);
|
||||||
|
|
||||||
SubmitSubmission(submission);
|
SubmitSubmission(submission);
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#ifndef NS_SMILCOMPOSITOR_H_
|
#ifndef NS_SMILCOMPOSITOR_H_
|
||||||
#define NS_SMILCOMPOSITOR_H_
|
#define NS_SMILCOMPOSITOR_H_
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "nsTHashtable.h"
|
#include "nsTHashtable.h"
|
||||||
#include "nsString.h"
|
#include "nsString.h"
|
||||||
#include "nsSMILAnimationFunction.h"
|
#include "nsSMILAnimationFunction.h"
|
||||||
@ -65,7 +66,7 @@ public:
|
|||||||
|
|
||||||
// Transfers |aOther|'s mCachedBaseValue to |this|
|
// Transfers |aOther|'s mCachedBaseValue to |this|
|
||||||
void StealCachedBaseValue(nsSMILCompositor* aOther) {
|
void StealCachedBaseValue(nsSMILCompositor* aOther) {
|
||||||
mCachedBaseValue = aOther->mCachedBaseValue;
|
mCachedBaseValue = mozilla::Move(aOther->mCachedBaseValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#ifndef NS_SMILTIMEDELEMENT_H_
|
#ifndef NS_SMILTIMEDELEMENT_H_
|
||||||
#define NS_SMILTIMEDELEMENT_H_
|
#define NS_SMILTIMEDELEMENT_H_
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "nsSMILInterval.h"
|
#include "nsSMILInterval.h"
|
||||||
#include "nsSMILInstanceTime.h"
|
#include "nsSMILInstanceTime.h"
|
||||||
#include "nsSMILMilestone.h"
|
#include "nsSMILMilestone.h"
|
||||||
@ -524,7 +525,7 @@ protected:
|
|||||||
{
|
{
|
||||||
if (mCurrentInterval) {
|
if (mCurrentInterval) {
|
||||||
// Transfer ownership to temp var. (This sets mCurrentInterval to null.)
|
// Transfer ownership to temp var. (This sets mCurrentInterval to null.)
|
||||||
nsAutoPtr<nsSMILInterval> interval(mCurrentInterval);
|
nsAutoPtr<nsSMILInterval> interval(mozilla::Move(mCurrentInterval));
|
||||||
interval->Unlink();
|
interval->Unlink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/dom/XPathEvaluator.h"
|
#include "mozilla/dom/XPathEvaluator.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsIAtom.h"
|
#include "nsIAtom.h"
|
||||||
#include "nsXPathExpression.h"
|
#include "nsXPathExpression.h"
|
||||||
@ -129,7 +130,7 @@ XPathEvaluator::CreateExpression(const nsAString & aExpression,
|
|||||||
|
|
||||||
nsCOMPtr<nsIDOMDocument> document = do_QueryReferent(mDocument);
|
nsCOMPtr<nsIDOMDocument> document = do_QueryReferent(mDocument);
|
||||||
|
|
||||||
*aResult = new nsXPathExpression(expression, mRecycler, document);
|
*aResult = new nsXPathExpression(Move(expression), mRecycler, document);
|
||||||
if (!*aResult) {
|
if (!*aResult) {
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "nsXPathExpression.h"
|
#include "nsXPathExpression.h"
|
||||||
#include "txExpr.h"
|
#include "txExpr.h"
|
||||||
#include "txExprResult.h"
|
#include "txExprResult.h"
|
||||||
@ -14,6 +15,8 @@
|
|||||||
#include "txURIUtils.h"
|
#include "txURIUtils.h"
|
||||||
#include "txXPathTreeWalker.h"
|
#include "txXPathTreeWalker.h"
|
||||||
|
|
||||||
|
using mozilla::Move;
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTION(nsXPathExpression, mDocument)
|
NS_IMPL_CYCLE_COLLECTION(nsXPathExpression, mDocument)
|
||||||
|
|
||||||
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXPathExpression)
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(nsXPathExpression)
|
||||||
@ -28,10 +31,10 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsXPathExpression)
|
|||||||
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XPathExpression)
|
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(XPathExpression)
|
||||||
NS_INTERFACE_MAP_END
|
NS_INTERFACE_MAP_END
|
||||||
|
|
||||||
nsXPathExpression::nsXPathExpression(nsAutoPtr<Expr>& aExpression,
|
nsXPathExpression::nsXPathExpression(nsAutoPtr<Expr>&& aExpression,
|
||||||
txResultRecycler* aRecycler,
|
txResultRecycler* aRecycler,
|
||||||
nsIDOMDocument *aDocument)
|
nsIDOMDocument *aDocument)
|
||||||
: mExpression(aExpression),
|
: mExpression(Move(aExpression)),
|
||||||
mRecycler(aRecycler),
|
mRecycler(aRecycler),
|
||||||
mDocument(aDocument)
|
mDocument(aDocument)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ class nsXPathExpression MOZ_FINAL : public nsIDOMXPathExpression,
|
|||||||
public nsIDOMNSXPathExpression
|
public nsIDOMNSXPathExpression
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
nsXPathExpression(nsAutoPtr<Expr>& aExpression, txResultRecycler* aRecycler,
|
nsXPathExpression(nsAutoPtr<Expr>&& aExpression, txResultRecycler* aRecycler,
|
||||||
nsIDOMDocument *aDocument);
|
nsIDOMDocument *aDocument);
|
||||||
|
|
||||||
// nsISupports interface
|
// nsISupports interface
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
* @see ExprLexer
|
* @see ExprLexer
|
||||||
**/
|
**/
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "txExprParser.h"
|
#include "txExprParser.h"
|
||||||
#include "txExprLexer.h"
|
#include "txExprLexer.h"
|
||||||
#include "txExpr.h"
|
#include "txExpr.h"
|
||||||
@ -20,6 +21,8 @@
|
|||||||
#include "txXPathNode.h"
|
#include "txXPathNode.h"
|
||||||
#include "txXPathOptimizer.h"
|
#include "txXPathOptimizer.h"
|
||||||
|
|
||||||
|
using mozilla::Move;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an Attribute Value Template using the given value
|
* Creates an Attribute Value Template using the given value
|
||||||
* This should move to XSLProcessor class
|
* This should move to XSLProcessor class
|
||||||
@ -113,7 +116,7 @@ txExprParser::createAVT(const nsSubstring& aAttrValue,
|
|||||||
|
|
||||||
// Add expression, create a concat() call if necessary
|
// Add expression, create a concat() call if necessary
|
||||||
if (!expr) {
|
if (!expr) {
|
||||||
expr = newExpr;
|
expr = Move(newExpr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!concat) {
|
if (!concat) {
|
||||||
@ -311,7 +314,7 @@ txExprParser::createExpr(txExprLexer& lexer, txIParseContext* aContext,
|
|||||||
<= precedence(static_cast<Token*>(ops.peek()))) {
|
<= precedence(static_cast<Token*>(ops.peek()))) {
|
||||||
// can't use expr as argument due to order of evaluation
|
// can't use expr as argument due to order of evaluation
|
||||||
nsAutoPtr<Expr> left(static_cast<Expr*>(exprs.pop()));
|
nsAutoPtr<Expr> left(static_cast<Expr*>(exprs.pop()));
|
||||||
nsAutoPtr<Expr> right(expr);
|
nsAutoPtr<Expr> right(Move(expr));
|
||||||
rv = createBinaryExpr(left, right,
|
rv = createBinaryExpr(left, right,
|
||||||
static_cast<Token*>(ops.pop()),
|
static_cast<Token*>(ops.pop()),
|
||||||
getter_Transfers(expr));
|
getter_Transfers(expr));
|
||||||
@ -330,7 +333,7 @@ txExprParser::createExpr(txExprLexer& lexer, txIParseContext* aContext,
|
|||||||
|
|
||||||
while (NS_SUCCEEDED(rv) && !exprs.isEmpty()) {
|
while (NS_SUCCEEDED(rv) && !exprs.isEmpty()) {
|
||||||
nsAutoPtr<Expr> left(static_cast<Expr*>(exprs.pop()));
|
nsAutoPtr<Expr> left(static_cast<Expr*>(exprs.pop()));
|
||||||
nsAutoPtr<Expr> right(expr);
|
nsAutoPtr<Expr> right(Move(expr));
|
||||||
rv = createBinaryExpr(left, right, static_cast<Token*>(ops.pop()),
|
rv = createBinaryExpr(left, right, static_cast<Token*>(ops.pop()),
|
||||||
getter_Transfers(expr));
|
getter_Transfers(expr));
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* 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/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "txInstructions.h"
|
#include "txInstructions.h"
|
||||||
#include "nsError.h"
|
#include "nsError.h"
|
||||||
#include "txExpr.h"
|
#include "txExpr.h"
|
||||||
@ -18,6 +19,8 @@
|
|||||||
#include "txXSLTNumber.h"
|
#include "txXSLTNumber.h"
|
||||||
#include "txExecutionState.h"
|
#include "txExecutionState.h"
|
||||||
|
|
||||||
|
using mozilla::Move;
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
txApplyDefaultElementTemplate::execute(txExecutionState& aEs)
|
txApplyDefaultElementTemplate::execute(txExecutionState& aEs)
|
||||||
{
|
{
|
||||||
@ -86,11 +89,9 @@ txApplyTemplates::execute(txExecutionState& aEs)
|
|||||||
return aEs.runTemplate(templ);
|
return aEs.runTemplate(templ);
|
||||||
}
|
}
|
||||||
|
|
||||||
txAttribute::txAttribute(nsAutoPtr<Expr> aName, nsAutoPtr<Expr> aNamespace,
|
txAttribute::txAttribute(nsAutoPtr<Expr>&& aName, nsAutoPtr<Expr>&& aNamespace,
|
||||||
txNamespaceMap* aMappings)
|
txNamespaceMap* aMappings)
|
||||||
: mName(aName),
|
: mName(Move(aName)), mNamespace(Move(aNamespace)), mMappings(aMappings)
|
||||||
mNamespace(aNamespace),
|
|
||||||
mMappings(aMappings)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,10 +180,9 @@ txCheckParam::execute(txExecutionState& aEs)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
txConditionalGoto::txConditionalGoto(nsAutoPtr<Expr> aCondition,
|
txConditionalGoto::txConditionalGoto(nsAutoPtr<Expr>&& aCondition,
|
||||||
txInstruction* aTarget)
|
txInstruction* aTarget)
|
||||||
: mCondition(aCondition),
|
: mCondition(Move(aCondition)), mTarget(aTarget)
|
||||||
mTarget(aTarget)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,8 +365,8 @@ txCopy::execute(txExecutionState& aEs)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
txCopyOf::txCopyOf(nsAutoPtr<Expr> aSelect)
|
txCopyOf::txCopyOf(nsAutoPtr<Expr>&& aSelect)
|
||||||
: mSelect(aSelect)
|
: mSelect(Move(aSelect))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -486,11 +486,11 @@ txLoopNodeSet::execute(txExecutionState& aEs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
txLREAttribute::txLREAttribute(int32_t aNamespaceID, nsIAtom* aLocalName,
|
txLREAttribute::txLREAttribute(int32_t aNamespaceID, nsIAtom* aLocalName,
|
||||||
nsIAtom* aPrefix, nsAutoPtr<Expr> aValue)
|
nsIAtom* aPrefix, nsAutoPtr<Expr>&& aValue)
|
||||||
: mNamespaceID(aNamespaceID),
|
: mNamespaceID(aNamespaceID),
|
||||||
mLocalName(aLocalName),
|
mLocalName(aLocalName),
|
||||||
mPrefix(aPrefix),
|
mPrefix(aPrefix),
|
||||||
mValue(aValue)
|
mValue(Move(aValue))
|
||||||
{
|
{
|
||||||
if (aNamespaceID == kNameSpaceID_None) {
|
if (aNamespaceID == kNameSpaceID_None) {
|
||||||
mLowercaseLocalName = TX_ToLowerCaseAtom(aLocalName);
|
mLowercaseLocalName = TX_ToLowerCaseAtom(aLocalName);
|
||||||
@ -541,13 +541,17 @@ txMessage::execute(txExecutionState& aEs)
|
|||||||
return mTerminate ? NS_ERROR_XSLT_ABORTED : NS_OK;
|
return mTerminate ? NS_ERROR_XSLT_ABORTED : NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
txNumber::txNumber(txXSLTNumber::LevelType aLevel, nsAutoPtr<txPattern> aCount,
|
txNumber::txNumber(txXSLTNumber::LevelType aLevel,
|
||||||
nsAutoPtr<txPattern> aFrom, nsAutoPtr<Expr> aValue,
|
nsAutoPtr<txPattern>&& aCount, nsAutoPtr<txPattern>&& aFrom,
|
||||||
nsAutoPtr<Expr> aFormat, nsAutoPtr<Expr> aGroupingSeparator,
|
nsAutoPtr<Expr>&& aValue, nsAutoPtr<Expr>&& aFormat,
|
||||||
nsAutoPtr<Expr> aGroupingSize)
|
nsAutoPtr<Expr>&& aGroupingSeparator,
|
||||||
: mLevel(aLevel), mCount(aCount), mFrom(aFrom), mValue(aValue),
|
nsAutoPtr<Expr>&& aGroupingSize)
|
||||||
mFormat(aFormat), mGroupingSeparator(aGroupingSeparator),
|
: mLevel(aLevel), mCount(Move(aCount)),
|
||||||
mGroupingSize(aGroupingSize)
|
mFrom(Move(aFrom)),
|
||||||
|
mValue(Move(aValue)),
|
||||||
|
mFormat(Move(aFormat)),
|
||||||
|
mGroupingSeparator(Move(aGroupingSeparator)),
|
||||||
|
mGroupingSize(Move(aGroupingSize))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,8 +576,8 @@ txPopParams::execute(txExecutionState& aEs)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
txProcessingInstruction::txProcessingInstruction(nsAutoPtr<Expr> aName)
|
txProcessingInstruction::txProcessingInstruction(nsAutoPtr<Expr>&& aName)
|
||||||
: mName(aName)
|
: mName(Move(aName))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -599,8 +603,8 @@ txProcessingInstruction::execute(txExecutionState& aEs)
|
|||||||
return aEs.mResultHandler->processingInstruction(name, handler->mValue);
|
return aEs.mResultHandler->processingInstruction(name, handler->mValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
txPushNewContext::txPushNewContext(nsAutoPtr<Expr> aSelect)
|
txPushNewContext::txPushNewContext(nsAutoPtr<Expr>&& aSelect)
|
||||||
: mSelect(aSelect), mBailTarget(nullptr)
|
: mSelect(Move(aSelect)), mBailTarget(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -660,19 +664,19 @@ txPushNewContext::execute(txExecutionState& aEs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
txPushNewContext::addSort(nsAutoPtr<Expr> aSelectExpr,
|
txPushNewContext::addSort(nsAutoPtr<Expr>&& aSelectExpr,
|
||||||
nsAutoPtr<Expr> aLangExpr,
|
nsAutoPtr<Expr>&& aLangExpr,
|
||||||
nsAutoPtr<Expr> aDataTypeExpr,
|
nsAutoPtr<Expr>&& aDataTypeExpr,
|
||||||
nsAutoPtr<Expr> aOrderExpr,
|
nsAutoPtr<Expr>&& aOrderExpr,
|
||||||
nsAutoPtr<Expr> aCaseOrderExpr)
|
nsAutoPtr<Expr>&& aCaseOrderExpr)
|
||||||
{
|
{
|
||||||
if (SortKey *key = mSortKeys.AppendElement()) {
|
if (SortKey *key = mSortKeys.AppendElement()) {
|
||||||
// workaround for not triggering the Copy Constructor
|
// workaround for not triggering the Copy Constructor
|
||||||
key->mSelectExpr = aSelectExpr;
|
key->mSelectExpr = Move(aSelectExpr);
|
||||||
key->mLangExpr = aLangExpr;
|
key->mLangExpr = Move(aLangExpr);
|
||||||
key->mDataTypeExpr = aDataTypeExpr;
|
key->mDataTypeExpr = Move(aDataTypeExpr);
|
||||||
key->mOrderExpr = aOrderExpr;
|
key->mOrderExpr = Move(aOrderExpr);
|
||||||
key->mCaseOrderExpr = aCaseOrderExpr;
|
key->mCaseOrderExpr = Move(aCaseOrderExpr);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
@ -748,8 +752,8 @@ txReturn::execute(txExecutionState& aEs)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
txSetParam::txSetParam(const txExpandedName& aName, nsAutoPtr<Expr> aValue)
|
txSetParam::txSetParam(const txExpandedName& aName, nsAutoPtr<Expr>&& aValue)
|
||||||
: mName(aName), mValue(aValue)
|
: mName(aName), mValue(Move(aValue))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -782,8 +786,8 @@ txSetParam::execute(txExecutionState& aEs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
txSetVariable::txSetVariable(const txExpandedName& aName,
|
txSetVariable::txSetVariable(const txExpandedName& aName,
|
||||||
nsAutoPtr<Expr> aValue)
|
nsAutoPtr<Expr>&& aValue)
|
||||||
: mName(aName), mValue(aValue)
|
: mName(aName), mValue(Move(aValue))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -806,11 +810,11 @@ txSetVariable::execute(txExecutionState& aEs)
|
|||||||
return aEs.bindVariable(mName, exprRes);
|
return aEs.bindVariable(mName, exprRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
txStartElement::txStartElement(nsAutoPtr<Expr> aName,
|
txStartElement::txStartElement(nsAutoPtr<Expr>&& aName,
|
||||||
nsAutoPtr<Expr> aNamespace,
|
nsAutoPtr<Expr>&& aNamespace,
|
||||||
txNamespaceMap* aMappings)
|
txNamespaceMap* aMappings)
|
||||||
: mName(aName),
|
: mName(Move(aName)),
|
||||||
mNamespace(aNamespace),
|
mNamespace(Move(aNamespace)),
|
||||||
mMappings(aMappings)
|
mMappings(aMappings)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -916,8 +920,8 @@ txText::execute(txExecutionState& aEs)
|
|||||||
return aEs.mResultHandler->characters(mStr, mDOE);
|
return aEs.mResultHandler->characters(mStr, mDOE);
|
||||||
}
|
}
|
||||||
|
|
||||||
txValueOf::txValueOf(nsAutoPtr<Expr> aExpr, bool aDOE)
|
txValueOf::txValueOf(nsAutoPtr<Expr>&& aExpr, bool aDOE)
|
||||||
: mExpr(aExpr),
|
: mExpr(Move(aExpr)),
|
||||||
mDOE(aDOE)
|
mDOE(aDOE)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ public:
|
|||||||
class txAttribute : public txInstruction
|
class txAttribute : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txAttribute(nsAutoPtr<Expr> aName, nsAutoPtr<Expr> aNamespace,
|
txAttribute(nsAutoPtr<Expr>&& aName, nsAutoPtr<Expr>&& aNamespace,
|
||||||
txNamespaceMap* aMappings);
|
txNamespaceMap* aMappings);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
@ -105,7 +105,7 @@ public:
|
|||||||
class txConditionalGoto : public txInstruction
|
class txConditionalGoto : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txConditionalGoto(nsAutoPtr<Expr> aCondition, txInstruction* aTarget);
|
txConditionalGoto(nsAutoPtr<Expr>&& aCondition, txInstruction* aTarget);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ public:
|
|||||||
class txCopyOf : public txCopyBase
|
class txCopyOf : public txCopyBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txCopyOf(nsAutoPtr<Expr> aSelect);
|
txCopyOf(nsAutoPtr<Expr>&& aSelect);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ class txLREAttribute : public txInstruction
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txLREAttribute(int32_t aNamespaceID, nsIAtom* aLocalName,
|
txLREAttribute(int32_t aNamespaceID, nsIAtom* aLocalName,
|
||||||
nsIAtom* aPrefix, nsAutoPtr<Expr> aValue);
|
nsIAtom* aPrefix, nsAutoPtr<Expr>&& aValue);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
@ -215,10 +215,10 @@ public:
|
|||||||
class txNumber : public txInstruction
|
class txNumber : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txNumber(txXSLTNumber::LevelType aLevel, nsAutoPtr<txPattern> aCount,
|
txNumber(txXSLTNumber::LevelType aLevel, nsAutoPtr<txPattern>&& aCount,
|
||||||
nsAutoPtr<txPattern> aFrom, nsAutoPtr<Expr> aValue,
|
nsAutoPtr<txPattern>&& aFrom, nsAutoPtr<Expr>&& aValue,
|
||||||
nsAutoPtr<Expr> aFormat, nsAutoPtr<Expr> aGroupingSeparator,
|
nsAutoPtr<Expr>&& aFormat, nsAutoPtr<Expr>&& aGroupingSeparator,
|
||||||
nsAutoPtr<Expr> aGroupingSize);
|
nsAutoPtr<Expr>&& aGroupingSize);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ public:
|
|||||||
class txProcessingInstruction : public txInstruction
|
class txProcessingInstruction : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txProcessingInstruction(nsAutoPtr<Expr> aName);
|
txProcessingInstruction(nsAutoPtr<Expr>&& aName);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
@ -250,15 +250,17 @@ public:
|
|||||||
class txPushNewContext : public txInstruction
|
class txPushNewContext : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txPushNewContext(nsAutoPtr<Expr> aSelect);
|
txPushNewContext(nsAutoPtr<Expr>&& aSelect);
|
||||||
~txPushNewContext();
|
~txPushNewContext();
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
|
|
||||||
nsresult addSort(nsAutoPtr<Expr> aSelectExpr, nsAutoPtr<Expr> aLangExpr,
|
nsresult addSort(nsAutoPtr<Expr>&& aSelectExpr,
|
||||||
nsAutoPtr<Expr> aDataTypeExpr, nsAutoPtr<Expr> aOrderExpr,
|
nsAutoPtr<Expr>&& aLangExpr,
|
||||||
nsAutoPtr<Expr> aCaseOrderExpr);
|
nsAutoPtr<Expr>&& aDataTypeExpr,
|
||||||
|
nsAutoPtr<Expr>&& aOrderExpr,
|
||||||
|
nsAutoPtr<Expr>&& aCaseOrderExpr);
|
||||||
|
|
||||||
struct SortKey {
|
struct SortKey {
|
||||||
nsAutoPtr<Expr> mSelectExpr;
|
nsAutoPtr<Expr> mSelectExpr;
|
||||||
@ -320,7 +322,7 @@ public:
|
|||||||
class txSetParam : public txInstruction
|
class txSetParam : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txSetParam(const txExpandedName& aName, nsAutoPtr<Expr> aValue);
|
txSetParam(const txExpandedName& aName, nsAutoPtr<Expr>&& aValue);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
@ -331,7 +333,7 @@ public:
|
|||||||
class txSetVariable : public txInstruction
|
class txSetVariable : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txSetVariable(const txExpandedName& aName, nsAutoPtr<Expr> aValue);
|
txSetVariable(const txExpandedName& aName, nsAutoPtr<Expr>&& aValue);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
@ -342,7 +344,7 @@ public:
|
|||||||
class txStartElement : public txInstruction
|
class txStartElement : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txStartElement(nsAutoPtr<Expr> aName, nsAutoPtr<Expr> aNamespace,
|
txStartElement(nsAutoPtr<Expr>&& aName, nsAutoPtr<Expr>&& aNamespace,
|
||||||
txNamespaceMap* aMappings);
|
txNamespaceMap* aMappings);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
@ -380,7 +382,7 @@ public:
|
|||||||
class txValueOf : public txInstruction
|
class txValueOf : public txInstruction
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txValueOf(nsAutoPtr<Expr> aExpr, bool aDOE);
|
txValueOf(nsAutoPtr<Expr>&& aExpr, bool aDOE);
|
||||||
|
|
||||||
TX_DECL_TXINSTRUCTION
|
TX_DECL_TXINSTRUCTION
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ public:
|
|||||||
* @param aUse use-expression
|
* @param aUse use-expression
|
||||||
* @return false if an error occurred, true otherwise
|
* @return false if an error occurred, true otherwise
|
||||||
*/
|
*/
|
||||||
bool addKey(nsAutoPtr<txPattern> aMatch, nsAutoPtr<Expr> aUse);
|
bool addKey(nsAutoPtr<txPattern>&& aMatch, nsAutoPtr<Expr>&& aUse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indexes a subtree and adds it to the hash of key values
|
* Indexes a subtree and adds it to the hash of key values
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "txXSLTPatterns.h"
|
#include "txXSLTPatterns.h"
|
||||||
#include "txNamespaceMap.h"
|
#include "txNamespaceMap.h"
|
||||||
#include "mozilla/HashFunctions.h"
|
#include "mozilla/HashFunctions.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
@ -251,7 +252,7 @@ txKeyHash::init()
|
|||||||
* @param aUse use-expression
|
* @param aUse use-expression
|
||||||
* @return false if an error occurred, true otherwise
|
* @return false if an error occurred, true otherwise
|
||||||
*/
|
*/
|
||||||
bool txXSLKey::addKey(nsAutoPtr<txPattern> aMatch, nsAutoPtr<Expr> aUse)
|
bool txXSLKey::addKey(nsAutoPtr<txPattern>&& aMatch, nsAutoPtr<Expr>&& aUse)
|
||||||
{
|
{
|
||||||
if (!aMatch || !aUse)
|
if (!aMatch || !aUse)
|
||||||
return false;
|
return false;
|
||||||
@ -260,8 +261,8 @@ bool txXSLKey::addKey(nsAutoPtr<txPattern> aMatch, nsAutoPtr<Expr> aUse)
|
|||||||
if (!key)
|
if (!key)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
key->matchPattern = aMatch;
|
key->matchPattern = Move(aMatch);
|
||||||
key->useExpr = aUse;
|
key->useExpr = Move(aUse);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -4,10 +4,13 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "txRtfHandler.h"
|
#include "txRtfHandler.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
|
|
||||||
txResultTreeFragment::txResultTreeFragment(nsAutoPtr<txResultBuffer>& aBuffer)
|
using mozilla::Move;
|
||||||
|
|
||||||
|
txResultTreeFragment::txResultTreeFragment(nsAutoPtr<txResultBuffer>&& aBuffer)
|
||||||
: txAExprResult(nullptr),
|
: txAExprResult(nullptr),
|
||||||
mBuffer(aBuffer)
|
mBuffer(Move(aBuffer))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,7 +61,7 @@ nsresult txResultTreeFragment::flushToHandler(txAXMLEventHandler* aHandler)
|
|||||||
nsresult
|
nsresult
|
||||||
txRtfHandler::getAsRTF(txAExprResult** aResult)
|
txRtfHandler::getAsRTF(txAExprResult** aResult)
|
||||||
{
|
{
|
||||||
*aResult = new txResultTreeFragment(mBuffer);
|
*aResult = new txResultTreeFragment(Move(mBuffer));
|
||||||
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(*aResult, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
NS_ADDREF(*aResult);
|
NS_ADDREF(*aResult);
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
class txResultTreeFragment : public txAExprResult
|
class txResultTreeFragment : public txAExprResult
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txResultTreeFragment(nsAutoPtr<txResultBuffer>& aBuffer);
|
txResultTreeFragment(nsAutoPtr<txResultBuffer>&& aBuffer);
|
||||||
|
|
||||||
TX_DECL_EXPRRESULT
|
TX_DECL_EXPRRESULT
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/FloatingPoint.h"
|
#include "mozilla/FloatingPoint.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
|
|
||||||
#include "txStylesheet.h"
|
#include "txStylesheet.h"
|
||||||
#include "txExpr.h"
|
#include "txExpr.h"
|
||||||
@ -15,6 +16,8 @@
|
|||||||
#include "txKey.h"
|
#include "txKey.h"
|
||||||
#include "txXPathTreeWalker.h"
|
#include "txXPathTreeWalker.h"
|
||||||
|
|
||||||
|
using mozilla::Move;
|
||||||
|
|
||||||
txStylesheet::txStylesheet()
|
txStylesheet::txStylesheet()
|
||||||
: mRootFrame(nullptr)
|
: mRootFrame(nullptr)
|
||||||
{
|
{
|
||||||
@ -39,7 +42,7 @@ txStylesheet::init()
|
|||||||
|
|
||||||
nt.forget();
|
nt.forget();
|
||||||
|
|
||||||
txPushNewContext* pushContext = new txPushNewContext(nodeExpr);
|
txPushNewContext* pushContext = new txPushNewContext(Move(nodeExpr));
|
||||||
mContainerTemplate->mNext = pushContext;
|
mContainerTemplate->mNext = pushContext;
|
||||||
NS_ENSURE_TRUE(pushContext, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(pushContext, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
@ -68,7 +71,7 @@ txStylesheet::init()
|
|||||||
|
|
||||||
nt.forget();
|
nt.forget();
|
||||||
|
|
||||||
mCharactersTemplate = new txValueOf(nodeExpr, false);
|
mCharactersTemplate = new txValueOf(Move(nodeExpr), false);
|
||||||
NS_ENSURE_TRUE(mCharactersTemplate, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(mCharactersTemplate, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
mCharactersTemplate->mNext = new txReturn();
|
mCharactersTemplate->mNext = new txReturn();
|
||||||
@ -400,10 +403,10 @@ txStylesheet::addTemplate(txTemplateItem* aTemplate,
|
|||||||
|
|
||||||
// Add the simple patterns to the list of matchable templates, according
|
// Add the simple patterns to the list of matchable templates, according
|
||||||
// to default priority
|
// to default priority
|
||||||
nsAutoPtr<txPattern> simple = aTemplate->mMatch;
|
nsAutoPtr<txPattern> simple = Move(aTemplate->mMatch);
|
||||||
nsAutoPtr<txPattern> unionPattern;
|
nsAutoPtr<txPattern> unionPattern;
|
||||||
if (simple->getType() == txPattern::UNION_PATTERN) {
|
if (simple->getType() == txPattern::UNION_PATTERN) {
|
||||||
unionPattern = simple;
|
unionPattern = Move(simple);
|
||||||
simple = unionPattern->getSubPatternAt(0);
|
simple = unionPattern->getSubPatternAt(0);
|
||||||
unionPattern->setSubPatternAt(0, nullptr);
|
unionPattern->setSubPatternAt(0, nullptr);
|
||||||
}
|
}
|
||||||
@ -428,7 +431,7 @@ txStylesheet::addTemplate(txTemplateItem* aTemplate,
|
|||||||
NS_ENSURE_TRUE(nt, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(nt, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nt->mFirstInstruction = instr;
|
nt->mFirstInstruction = instr;
|
||||||
nt->mMatch = simple;
|
nt->mMatch = Move(simple);
|
||||||
nt->mPriority = priority;
|
nt->mPriority = priority;
|
||||||
|
|
||||||
if (unionPattern) {
|
if (unionPattern) {
|
||||||
@ -539,7 +542,8 @@ txStylesheet::addGlobalVariable(txVariableItem* aVariable)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
nsAutoPtr<GlobalVariable> var(
|
nsAutoPtr<GlobalVariable> var(
|
||||||
new GlobalVariable(aVariable->mValue, aVariable->mFirstInstruction,
|
new GlobalVariable(Move(aVariable->mValue),
|
||||||
|
Move(aVariable->mFirstInstruction),
|
||||||
aVariable->mIsParam));
|
aVariable->mIsParam));
|
||||||
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
@ -569,7 +573,7 @@ txStylesheet::addKey(const txExpandedName& aName,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!xslKey->addKey(aMatch, aUse)) {
|
if (!xslKey->addKey(Move(aMatch), Move(aUse))) {
|
||||||
return NS_ERROR_OUT_OF_MEMORY;
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -577,7 +581,7 @@ txStylesheet::addKey(const txExpandedName& aName,
|
|||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
txStylesheet::addDecimalFormat(const txExpandedName& aName,
|
txStylesheet::addDecimalFormat(const txExpandedName& aName,
|
||||||
nsAutoPtr<txDecimalFormat> aFormat)
|
nsAutoPtr<txDecimalFormat>&& aFormat)
|
||||||
{
|
{
|
||||||
txDecimalFormat* existing = mDecimalFormats.get(aName);
|
txDecimalFormat* existing = mDecimalFormats.get(aName);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
@ -603,9 +607,11 @@ txStylesheet::ImportFrame::~ImportFrame()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
txStylesheet::GlobalVariable::GlobalVariable(nsAutoPtr<Expr> aExpr,
|
txStylesheet::GlobalVariable::GlobalVariable(nsAutoPtr<Expr>&& aExpr,
|
||||||
nsAutoPtr<txInstruction> aFirstInstruction,
|
nsAutoPtr<txInstruction>&& aInstr,
|
||||||
bool aIsParam)
|
bool aIsParam)
|
||||||
: mExpr(aExpr), mFirstInstruction(aFirstInstruction), mIsParam(aIsParam)
|
: mExpr(Move(aExpr)),
|
||||||
|
mFirstInstruction(Move(aInstr)),
|
||||||
|
mIsParam(aIsParam)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ public:
|
|||||||
* Add a decimal-format to the stylesheet
|
* Add a decimal-format to the stylesheet
|
||||||
*/
|
*/
|
||||||
nsresult addDecimalFormat(const txExpandedName& aName,
|
nsresult addDecimalFormat(const txExpandedName& aName,
|
||||||
nsAutoPtr<txDecimalFormat> aFormat);
|
nsAutoPtr<txDecimalFormat>&& aFormat);
|
||||||
|
|
||||||
struct MatchableTemplate {
|
struct MatchableTemplate {
|
||||||
txInstruction* mFirstInstruction;
|
txInstruction* mFirstInstruction;
|
||||||
@ -96,8 +96,8 @@ public:
|
|||||||
|
|
||||||
class GlobalVariable : public txObject {
|
class GlobalVariable : public txObject {
|
||||||
public:
|
public:
|
||||||
GlobalVariable(nsAutoPtr<Expr> aExpr,
|
GlobalVariable(nsAutoPtr<Expr>&& aExpr,
|
||||||
nsAutoPtr<txInstruction> aFirstInstruction,
|
nsAutoPtr<txInstruction>&& aFirstInstruction,
|
||||||
bool aIsParam);
|
bool aIsParam);
|
||||||
|
|
||||||
nsAutoPtr<Expr> mExpr;
|
nsAutoPtr<Expr> mExpr;
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "mozilla/ArrayUtils.h"
|
#include "mozilla/ArrayUtils.h"
|
||||||
#include "mozilla/FloatingPoint.h"
|
#include "mozilla/FloatingPoint.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
|
|
||||||
#include "txStylesheetCompiler.h"
|
#include "txStylesheetCompiler.h"
|
||||||
#include "txStylesheetCompileHandlers.h"
|
#include "txStylesheetCompileHandlers.h"
|
||||||
@ -114,7 +115,7 @@ parseUseAttrSets(txStylesheetAttr* aAttributes,
|
|||||||
nsAutoPtr<txInstruction> instr(new txInsertAttrSet(name));
|
nsAutoPtr<txInstruction> instr(new txInsertAttrSet(name));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -525,7 +526,7 @@ txFnStartLREStylesheet(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txPattern> match(new txRootPattern());
|
nsAutoPtr<txPattern> match(new txRootPattern());
|
||||||
NS_ENSURE_TRUE(match, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(match, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsAutoPtr<txTemplateItem> templ(new txTemplateItem(match, nullExpr,
|
nsAutoPtr<txTemplateItem> templ(new txTemplateItem(Move(match), nullExpr,
|
||||||
nullExpr, prio));
|
nullExpr, prio));
|
||||||
NS_ENSURE_TRUE(templ, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(templ, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
@ -553,7 +554,7 @@ txFnEndLREStylesheet(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txReturn());
|
nsAutoPtr<txInstruction> instr(new txReturn());
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aState.closeInstructionContainer();
|
aState.closeInstructionContainer();
|
||||||
@ -659,7 +660,7 @@ txFnEndAttributeSet(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txReturn());
|
nsAutoPtr<txInstruction> instr(new txReturn());
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aState.closeInstructionContainer();
|
aState.closeInstructionContainer();
|
||||||
@ -735,7 +736,7 @@ txFnStartDecimalFormat(int32_t aNamespaceID,
|
|||||||
false, aState, format->mPatternSeparator);
|
false, aState, format->mPatternSeparator);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = aState.mStylesheet->addDecimalFormat(name, format);
|
rv = aState.mStylesheet->addDecimalFormat(name, Move(format));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxIgnoreHandler);
|
return aState.pushHandlerTable(gTxIgnoreHandler);
|
||||||
@ -847,7 +848,7 @@ txFnStartKey(int32_t aNamespaceID,
|
|||||||
aState, use);
|
aState, use);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = aState.mStylesheet->addKey(name, match, use);
|
rv = aState.mStylesheet->addKey(name, Move(match), Move(use));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxIgnoreHandler);
|
return aState.pushHandlerTable(gTxIgnoreHandler);
|
||||||
@ -1123,7 +1124,8 @@ txFnStartTemplate(int32_t aNamespaceID,
|
|||||||
name.isNull(), aState, match);
|
name.isNull(), aState, match);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txTemplateItem> templ(new txTemplateItem(match, name, mode, prio));
|
nsAutoPtr<txTemplateItem> templ(new txTemplateItem(Move(match), name, mode,
|
||||||
|
prio));
|
||||||
NS_ENSURE_TRUE(templ, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(templ, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
aState.openInstructionContainer(templ);
|
aState.openInstructionContainer(templ);
|
||||||
@ -1143,7 +1145,7 @@ txFnEndTemplate(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txReturn());
|
nsAutoPtr<txInstruction> instr(new txReturn());
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aState.closeInstructionContainer();
|
aState.closeInstructionContainer();
|
||||||
@ -1172,7 +1174,8 @@ txFnStartTopVariable(int32_t aNamespaceID,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txVariableItem> var(
|
nsAutoPtr<txVariableItem> var(
|
||||||
new txVariableItem(name, select, aLocalName == nsGkAtoms::param));
|
new txVariableItem(name, Move(select),
|
||||||
|
aLocalName == nsGkAtoms::param));
|
||||||
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
aState.openInstructionContainer(var);
|
aState.openInstructionContainer(var);
|
||||||
@ -1217,7 +1220,7 @@ txFnEndTopVariable(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txReturn());
|
nsAutoPtr<txInstruction> instr(new txReturn());
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1276,7 +1279,7 @@ txFnStartLRE(int32_t aNamespaceID,
|
|||||||
aLocalName, aPrefix));
|
aLocalName, aPrefix));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = parseExcludeResultPrefixes(aAttributes, aAttrCount, kNameSpaceID_XSLT);
|
rv = parseExcludeResultPrefixes(aAttributes, aAttrCount, kNameSpaceID_XSLT);
|
||||||
@ -1304,10 +1307,10 @@ txFnStartLRE(int32_t aNamespaceID,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = new txLREAttribute(attr->mNamespaceID, attr->mLocalName,
|
instr = new txLREAttribute(attr->mNamespaceID, attr->mLocalName,
|
||||||
attr->mPrefix, avt);
|
attr->mPrefix, Move(avt));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1320,7 +1323,7 @@ txFnEndLRE(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txEndElement);
|
nsAutoPtr<txInstruction> instr(new txEndElement);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1339,7 +1342,7 @@ txFnText(const nsAString& aStr, txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txText(aStr, false));
|
nsAutoPtr<txInstruction> instr(new txText(aStr, false));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1364,13 +1367,13 @@ txFnStartApplyImports(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txApplyImportsStart);
|
nsAutoPtr<txInstruction> instr(new txApplyImportsStart);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = new txApplyImportsEnd;
|
instr = new txApplyImportsEnd;
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxIgnoreHandler);
|
return aState.pushHandlerTable(gTxIgnoreHandler);
|
||||||
@ -1407,7 +1410,7 @@ txFnStartApplyTemplates(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushParams);
|
nsAutoPtr<txInstruction> instr(new txPushParams);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
txExpandedName mode;
|
txExpandedName mode;
|
||||||
@ -1439,7 +1442,7 @@ txFnStartApplyTemplates(int32_t aNamespaceID,
|
|||||||
nt.forget();
|
nt.forget();
|
||||||
}
|
}
|
||||||
|
|
||||||
nsAutoPtr<txPushNewContext> pushcontext(new txPushNewContext(select));
|
nsAutoPtr<txPushNewContext> pushcontext( new txPushNewContext(Move(select)));
|
||||||
NS_ENSURE_TRUE(pushcontext, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(pushcontext, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.pushSorter(pushcontext);
|
rv = aState.pushSorter(pushcontext);
|
||||||
@ -1461,7 +1464,7 @@ txFnEndApplyTemplates(txStylesheetCompilerState& aState)
|
|||||||
txPushNewContext* pushcontext =
|
txPushNewContext* pushcontext =
|
||||||
static_cast<txPushNewContext*>(aState.popObject());
|
static_cast<txPushNewContext*>(aState.popObject());
|
||||||
nsAutoPtr<txInstruction> instr(pushcontext); // txPushNewContext
|
nsAutoPtr<txInstruction> instr(pushcontext); // txPushNewContext
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aState.popSorter();
|
aState.popSorter();
|
||||||
@ -1470,18 +1473,18 @@ txFnEndApplyTemplates(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txLoopNodeSet> loop(new txLoopNodeSet(instr));
|
nsAutoPtr<txLoopNodeSet> loop(new txLoopNodeSet(instr));
|
||||||
NS_ENSURE_TRUE(loop, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(loop, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = loop.forget();
|
instr = loop.forget();
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = new txPopParams;
|
instr = new txPopParams;
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
pushcontext->mBailTarget = instr;
|
pushcontext->mBailTarget = instr;
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1507,7 +1510,7 @@ txFnStartAttribute(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushStringHandler(true));
|
nsAutoPtr<txInstruction> instr(new txPushStringHandler(true));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<Expr> name;
|
nsAutoPtr<Expr> name;
|
||||||
@ -1520,7 +1523,8 @@ txFnStartAttribute(int32_t aNamespaceID,
|
|||||||
aState, nspace);
|
aState, nspace);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = new txAttribute(name, nspace, aState.mElementContext->mMappings);
|
instr = new txAttribute(Move(name), Move(nspace),
|
||||||
|
aState.mElementContext->mMappings);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.pushObject(instr);
|
rv = aState.pushObject(instr);
|
||||||
@ -1539,7 +1543,7 @@ txFnEndAttribute(txStylesheetCompilerState& aState)
|
|||||||
aState.popHandlerTable();
|
aState.popHandlerTable();
|
||||||
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>
|
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>
|
||||||
(aState.popObject()));
|
(aState.popObject()));
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1566,7 +1570,7 @@ txFnStartCallTemplate(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushParams);
|
nsAutoPtr<txInstruction> instr(new txPushParams);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
txExpandedName name;
|
txExpandedName name;
|
||||||
@ -1592,13 +1596,13 @@ txFnEndCallTemplate(txStylesheetCompilerState& aState)
|
|||||||
|
|
||||||
// txCallTemplate
|
// txCallTemplate
|
||||||
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>(aState.popObject()));
|
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>(aState.popObject()));
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = new txPopParams;
|
instr = new txPopParams;
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1667,7 +1671,7 @@ txFnStartComment(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushStringHandler(true));
|
nsAutoPtr<txInstruction> instr(new txPushStringHandler(true));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1679,7 +1683,7 @@ txFnEndComment(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txComment);
|
nsAutoPtr<txInstruction> instr(new txComment);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1709,7 +1713,7 @@ txFnStartCopy(int32_t aNamespaceID,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(copy.forget());
|
nsAutoPtr<txInstruction> instr(copy.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = parseUseAttrSets(aAttributes, aAttrCount, false, aState);
|
rv = parseUseAttrSets(aAttributes, aAttrCount, false, aState);
|
||||||
@ -1724,7 +1728,7 @@ txFnEndCopy(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txEndElement);
|
nsAutoPtr<txInstruction> instr(new txEndElement);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
txCopy* copy = static_cast<txCopy*>(aState.popPtr(aState.eCopy));
|
txCopy* copy = static_cast<txCopy*>(aState.popPtr(aState.eCopy));
|
||||||
@ -1754,10 +1758,10 @@ txFnStartCopyOf(int32_t aNamespaceID,
|
|||||||
aState, select);
|
aState, select);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(new txCopyOf(select));
|
nsAutoPtr<txInstruction> instr(new txCopyOf(Move(select)));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxIgnoreHandler);
|
return aState.pushHandlerTable(gTxIgnoreHandler);
|
||||||
@ -1799,10 +1803,11 @@ txFnStartElement(int32_t aNamespaceID,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(
|
nsAutoPtr<txInstruction> instr(
|
||||||
new txStartElement(name, nspace, aState.mElementContext->mMappings));
|
new txStartElement(Move(name), Move(nspace),
|
||||||
|
aState.mElementContext->mMappings));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = parseUseAttrSets(aAttributes, aAttrCount, false, aState);
|
rv = parseUseAttrSets(aAttributes, aAttrCount, false, aState);
|
||||||
@ -1817,7 +1822,7 @@ txFnEndElement(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txEndElement);
|
nsAutoPtr<txInstruction> instr(new txEndElement);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -1875,7 +1880,7 @@ txFnStartForEach(int32_t aNamespaceID,
|
|||||||
aState, select);
|
aState, select);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txPushNewContext> pushcontext(new txPushNewContext(select));
|
nsAutoPtr<txPushNewContext> pushcontext(new txPushNewContext(Move(select)));
|
||||||
NS_ENSURE_TRUE(pushcontext, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(pushcontext, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.pushPtr(pushcontext, aState.ePushNewContext);
|
rv = aState.pushPtr(pushcontext, aState.ePushNewContext);
|
||||||
@ -1885,7 +1890,7 @@ txFnStartForEach(int32_t aNamespaceID,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(pushcontext.forget());
|
nsAutoPtr<txInstruction> instr(pushcontext.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = new txPushNullTemplateRule;
|
instr = new txPushNullTemplateRule;
|
||||||
@ -1894,7 +1899,7 @@ txFnStartForEach(int32_t aNamespaceID,
|
|||||||
rv = aState.pushPtr(instr, aState.ePushNullTemplateRule);
|
rv = aState.pushPtr(instr, aState.ePushNullTemplateRule);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxForEachHandler);
|
return aState.pushHandlerTable(gTxForEachHandler);
|
||||||
@ -1910,7 +1915,7 @@ txFnEndForEach(txStylesheetCompilerState& aState)
|
|||||||
static_cast<txInstruction*>(aState.popPtr(aState.ePushNullTemplateRule));
|
static_cast<txInstruction*>(aState.popPtr(aState.ePushNullTemplateRule));
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(new txLoopNodeSet(pnullrule));
|
nsAutoPtr<txInstruction> instr(new txLoopNodeSet(pnullrule));
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aState.popSorter();
|
aState.popSorter();
|
||||||
@ -1967,14 +1972,15 @@ txFnStartIf(int32_t aNamespaceID,
|
|||||||
aState, test);
|
aState, test);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txConditionalGoto> condGoto(new txConditionalGoto(test, nullptr));
|
nsAutoPtr<txConditionalGoto> condGoto(new txConditionalGoto(Move(test),
|
||||||
|
nullptr));
|
||||||
NS_ENSURE_TRUE(condGoto, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(condGoto, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.pushPtr(condGoto, aState.eConditionalGoto);
|
rv = aState.pushPtr(condGoto, aState.eConditionalGoto);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(condGoto.forget());
|
nsAutoPtr<txInstruction> instr(condGoto.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -2006,7 +2012,7 @@ txFnStartMessage(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushStringHandler(false));
|
nsAutoPtr<txInstruction> instr(new txPushStringHandler(false));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
txThreeState term;
|
txThreeState term;
|
||||||
@ -2029,7 +2035,7 @@ static nsresult
|
|||||||
txFnEndMessage(txStylesheetCompilerState& aState)
|
txFnEndMessage(txStylesheetCompilerState& aState)
|
||||||
{
|
{
|
||||||
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>(aState.popObject()));
|
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>(aState.popObject()));
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -2106,12 +2112,13 @@ txFnStartNumber(int32_t aNamespaceID,
|
|||||||
false, aState, groupingSize);
|
false, aState, groupingSize);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(new txNumber(level, count, from, value,
|
nsAutoPtr<txInstruction> instr(new txNumber(level, Move(count), Move(from),
|
||||||
format,groupingSeparator,
|
Move(value), Move(format),
|
||||||
groupingSize));
|
Move(groupingSeparator),
|
||||||
|
Move(groupingSize)));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxIgnoreHandler);
|
return aState.pushHandlerTable(gTxIgnoreHandler);
|
||||||
@ -2181,7 +2188,7 @@ txFnStartParam(int32_t aNamespaceID,
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(checkParam.forget());
|
nsAutoPtr<txInstruction> instr(checkParam.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<Expr> select;
|
nsAutoPtr<Expr> select;
|
||||||
@ -2189,7 +2196,7 @@ txFnStartParam(int32_t aNamespaceID,
|
|||||||
aState, select);
|
aState, select);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txSetVariable> var(new txSetVariable(name, select));
|
nsAutoPtr<txSetVariable> var(new txSetVariable(name, Move(select)));
|
||||||
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
if (var->mValue) {
|
if (var->mValue) {
|
||||||
@ -2230,7 +2237,7 @@ txFnEndParam(txStylesheetCompilerState& aState)
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(var.forget());
|
nsAutoPtr<txInstruction> instr(var.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
txCheckParam* checkParam =
|
txCheckParam* checkParam =
|
||||||
@ -2258,7 +2265,7 @@ txFnStartPI(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushStringHandler(true));
|
nsAutoPtr<txInstruction> instr(new txPushStringHandler(true));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<Expr> name;
|
nsAutoPtr<Expr> name;
|
||||||
@ -2266,7 +2273,7 @@ txFnStartPI(int32_t aNamespaceID,
|
|||||||
aState, name);
|
aState, name);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
instr = new txProcessingInstruction(name);
|
instr = new txProcessingInstruction(Move(name));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.pushObject(instr);
|
rv = aState.pushObject(instr);
|
||||||
@ -2282,7 +2289,7 @@ txFnEndPI(txStylesheetCompilerState& aState)
|
|||||||
{
|
{
|
||||||
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>
|
nsAutoPtr<txInstruction> instr(static_cast<txInstruction*>
|
||||||
(aState.popObject()));
|
(aState.popObject()));
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -2339,7 +2346,8 @@ txFnStartSort(int32_t aNamespaceID,
|
|||||||
aState, caseOrder);
|
aState, caseOrder);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
rv = aState.mSorter->addSort(select, lang, dataType, order, caseOrder);
|
rv = aState.mSorter->addSort(Move(select), Move(lang), Move(dataType),
|
||||||
|
Move(order), Move(caseOrder));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxIgnoreHandler);
|
return aState.pushHandlerTable(gTxIgnoreHandler);
|
||||||
@ -2394,7 +2402,7 @@ txFnTextText(const nsAString& aStr, txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txText(aStr, aState.mDOE));
|
nsAutoPtr<txInstruction> instr(new txText(aStr, aState.mDOE));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -2426,10 +2434,10 @@ txFnStartValueOf(int32_t aNamespaceID,
|
|||||||
aState, select);
|
aState, select);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(new txValueOf(select, doe == eTrue));
|
nsAutoPtr<txInstruction> instr(new txValueOf(Move(select), doe == eTrue));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxIgnoreHandler);
|
return aState.pushHandlerTable(gTxIgnoreHandler);
|
||||||
@ -2469,7 +2477,7 @@ txFnStartVariable(int32_t aNamespaceID,
|
|||||||
aState, select);
|
aState, select);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txSetVariable> var(new txSetVariable(name, select));
|
nsAutoPtr<txSetVariable> var(new txSetVariable(name, Move(select)));
|
||||||
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
if (var->mValue) {
|
if (var->mValue) {
|
||||||
@ -2511,7 +2519,7 @@ txFnEndVariable(txStylesheetCompilerState& aState)
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(var.forget());
|
nsAutoPtr<txInstruction> instr(var.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -2528,7 +2536,7 @@ txFnStartElementStartRTF(int32_t aNamespaceID,
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushRTFHandler);
|
nsAutoPtr<txInstruction> instr(new txPushRTFHandler);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aState.mHandlerTable = gTxTemplateHandler;
|
aState.mHandlerTable = gTxTemplateHandler;
|
||||||
@ -2544,7 +2552,7 @@ txFnTextStartRTF(const nsAString& aStr, txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txPushRTFHandler);
|
nsAutoPtr<txInstruction> instr(new txPushRTFHandler);
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
aState.mHandlerTable = gTxTemplateHandler;
|
aState.mHandlerTable = gTxTemplateHandler;
|
||||||
@ -2572,14 +2580,15 @@ txFnStartWhen(int32_t aNamespaceID,
|
|||||||
aState, test);
|
aState, test);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txConditionalGoto> condGoto(new txConditionalGoto(test, nullptr));
|
nsAutoPtr<txConditionalGoto> condGoto(new txConditionalGoto(Move(test),
|
||||||
|
nullptr));
|
||||||
NS_ENSURE_TRUE(condGoto, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(condGoto, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = aState.pushPtr(condGoto, aState.eConditionalGoto);
|
rv = aState.pushPtr(condGoto, aState.eConditionalGoto);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(condGoto.forget());
|
nsAutoPtr<txInstruction> instr(condGoto.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return aState.pushHandlerTable(gTxTemplateHandler);
|
return aState.pushHandlerTable(gTxTemplateHandler);
|
||||||
@ -2596,7 +2605,7 @@ txFnEndWhen(txStylesheetCompilerState& aState)
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(gotoinstr.forget());
|
nsAutoPtr<txInstruction> instr(gotoinstr.forget());
|
||||||
rv = aState.addInstruction(instr);
|
rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
txConditionalGoto* condGoto =
|
txConditionalGoto* condGoto =
|
||||||
@ -2634,7 +2643,7 @@ txFnStartWithParam(int32_t aNamespaceID,
|
|||||||
aState, select);
|
aState, select);
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
nsAutoPtr<txSetParam> var(new txSetParam(name, select));
|
nsAutoPtr<txSetParam> var(new txSetParam(name, Move(select)));
|
||||||
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(var, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
if (var->mValue) {
|
if (var->mValue) {
|
||||||
@ -2671,7 +2680,7 @@ txFnEndWithParam(txStylesheetCompilerState& aState)
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsAutoPtr<txInstruction> instr(var.forget());
|
nsAutoPtr<txInstruction> instr(var.forget());
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -2713,7 +2722,7 @@ txFnEndUnknownInstruction(txStylesheetCompilerState& aState)
|
|||||||
nsAutoPtr<txInstruction> instr(new txErrorInstruction());
|
nsAutoPtr<txInstruction> instr(new txErrorInstruction());
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
nsresult rv = aState.addInstruction(instr);
|
nsresult rv = aState.addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "mozilla/ArrayUtils.h"
|
#include "mozilla/ArrayUtils.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
|
|
||||||
#include "txStylesheetCompiler.h"
|
#include "txStylesheetCompiler.h"
|
||||||
#include "txStylesheetCompileHandlers.h"
|
#include "txStylesheetCompileHandlers.h"
|
||||||
@ -336,7 +337,7 @@ txStylesheetCompiler::endElement()
|
|||||||
nsAutoPtr<txInstruction> instr(new txRemoveVariable(var->mName));
|
nsAutoPtr<txInstruction> instr(new txRemoveVariable(var->mName));
|
||||||
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
NS_ENSURE_TRUE(instr, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
rv = addInstruction(instr);
|
rv = addInstruction(Move(instr));
|
||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
mInScopeVariables.RemoveElementAt(i);
|
mInScopeVariables.RemoveElementAt(i);
|
||||||
@ -484,7 +485,7 @@ txStylesheetCompiler::ensureNewElementContext()
|
|||||||
NS_ENSURE_SUCCESS(rv, rv);
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
mElementContext.forget();
|
mElementContext.forget();
|
||||||
mElementContext = context;
|
mElementContext = Move(context);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -723,7 +724,7 @@ txStylesheetCompilerState::closeInstructionContainer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
txStylesheetCompilerState::addInstruction(nsAutoPtr<txInstruction> aInstruction)
|
txStylesheetCompilerState::addInstruction(nsAutoPtr<txInstruction>&& aInstruction)
|
||||||
{
|
{
|
||||||
NS_PRECONDITION(mNextInstrPtr, "adding instruction outside container");
|
NS_PRECONDITION(mNextInstrPtr, "adding instruction outside container");
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public:
|
|||||||
nsresult addToplevelItem(txToplevelItem* aItem);
|
nsresult addToplevelItem(txToplevelItem* aItem);
|
||||||
nsresult openInstructionContainer(txInstructionContainer* aContainer);
|
nsresult openInstructionContainer(txInstructionContainer* aContainer);
|
||||||
void closeInstructionContainer();
|
void closeInstructionContainer();
|
||||||
nsresult addInstruction(nsAutoPtr<txInstruction> aInstruction);
|
nsresult addInstruction(nsAutoPtr<txInstruction>&& aInstruction);
|
||||||
nsresult loadIncludedStylesheet(const nsAString& aURI);
|
nsresult loadIncludedStylesheet(const nsAString& aURI);
|
||||||
nsresult loadImportedStylesheet(const nsAString& aURI,
|
nsresult loadImportedStylesheet(const nsAString& aURI,
|
||||||
txStylesheet::ImportFrame* aFrame);
|
txStylesheet::ImportFrame* aFrame);
|
||||||
|
@ -4,10 +4,14 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "txToplevelItems.h"
|
#include "txToplevelItems.h"
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "txStylesheet.h"
|
#include "txStylesheet.h"
|
||||||
#include "txInstructions.h"
|
#include "txInstructions.h"
|
||||||
#include "txXSLTPatterns.h"
|
#include "txXSLTPatterns.h"
|
||||||
|
|
||||||
|
using mozilla::Move;
|
||||||
|
|
||||||
TX_IMPL_GETTYPE(txAttributeSetItem, txToplevelItem::attributeSet)
|
TX_IMPL_GETTYPE(txAttributeSetItem, txToplevelItem::attributeSet)
|
||||||
TX_IMPL_GETTYPE(txImportItem, txToplevelItem::import)
|
TX_IMPL_GETTYPE(txImportItem, txToplevelItem::import)
|
||||||
TX_IMPL_GETTYPE(txOutputItem, txToplevelItem::output)
|
TX_IMPL_GETTYPE(txOutputItem, txToplevelItem::output)
|
||||||
@ -35,18 +39,20 @@ txStripSpaceItem::addStripSpaceTest(txStripSpaceTest* aStripSpaceTest)
|
|||||||
|
|
||||||
TX_IMPL_GETTYPE(txTemplateItem, txToplevelItem::templ)
|
TX_IMPL_GETTYPE(txTemplateItem, txToplevelItem::templ)
|
||||||
|
|
||||||
txTemplateItem::txTemplateItem(nsAutoPtr<txPattern> aMatch,
|
txTemplateItem::txTemplateItem(nsAutoPtr<txPattern>&& aMatch,
|
||||||
const txExpandedName& aName,
|
const txExpandedName& aName,
|
||||||
const txExpandedName& aMode, double aPrio)
|
const txExpandedName& aMode, double aPrio)
|
||||||
: mMatch(aMatch), mName(aName), mMode(aMode), mPrio(aPrio)
|
: mMatch(Move(aMatch)), mName(aName),
|
||||||
|
mMode(aMode), mPrio(aPrio)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
TX_IMPL_GETTYPE(txVariableItem, txToplevelItem::variable)
|
TX_IMPL_GETTYPE(txVariableItem, txToplevelItem::variable)
|
||||||
|
|
||||||
txVariableItem::txVariableItem(const txExpandedName& aName,
|
txVariableItem::txVariableItem(const txExpandedName& aName,
|
||||||
nsAutoPtr<Expr> aValue,
|
nsAutoPtr<Expr>&& aValue,
|
||||||
bool aIsParam)
|
bool aIsParam)
|
||||||
: mName(aName), mValue(aValue), mIsParam(aIsParam)
|
: mName(aName), mValue(Move(aValue)),
|
||||||
|
mIsParam(aIsParam)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ public:
|
|||||||
class txTemplateItem : public txInstructionContainer
|
class txTemplateItem : public txInstructionContainer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txTemplateItem(nsAutoPtr<txPattern> aMatch, const txExpandedName& aName,
|
txTemplateItem(nsAutoPtr<txPattern>&& aMatch, const txExpandedName& aName,
|
||||||
const txExpandedName& aMode, double aPrio);
|
const txExpandedName& aMode, double aPrio);
|
||||||
|
|
||||||
TX_DECL_TOPLEVELITEM
|
TX_DECL_TOPLEVELITEM
|
||||||
@ -122,7 +122,7 @@ public:
|
|||||||
class txVariableItem : public txInstructionContainer
|
class txVariableItem : public txInstructionContainer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
txVariableItem(const txExpandedName& aName, nsAutoPtr<Expr> aValue,
|
txVariableItem(const txExpandedName& aName, nsAutoPtr<Expr>&& aValue,
|
||||||
bool aIsParam);
|
bool aIsParam);
|
||||||
|
|
||||||
TX_DECL_TOPLEVELITEM
|
TX_DECL_TOPLEVELITEM
|
||||||
|
@ -4,11 +4,15 @@
|
|||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
#include "txUnknownHandler.h"
|
#include "txUnknownHandler.h"
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "txExecutionState.h"
|
#include "txExecutionState.h"
|
||||||
#include "txStringUtils.h"
|
#include "txStringUtils.h"
|
||||||
#include "txStylesheet.h"
|
#include "txStylesheet.h"
|
||||||
#include "nsGkAtoms.h"
|
#include "nsGkAtoms.h"
|
||||||
|
|
||||||
|
using mozilla::Move;
|
||||||
|
|
||||||
txUnknownHandler::txUnknownHandler(txExecutionState* aEs)
|
txUnknownHandler::txUnknownHandler(txExecutionState* aEs)
|
||||||
: mEs(aEs),
|
: mEs(aEs),
|
||||||
mFlushed(false)
|
mFlushed(false)
|
||||||
@ -192,6 +196,6 @@ nsresult txUnknownHandler::createHandlerAndFlush(bool aHTMLRoot,
|
|||||||
// Let go of out buffer as soon as we're done flushing it, we're not going
|
// Let go of out buffer as soon as we're done flushing it, we're not going
|
||||||
// to need it anymore from this point on (all hooks get forwarded to
|
// to need it anymore from this point on (all hooks get forwarded to
|
||||||
// mEs->mResultHandler.
|
// mEs->mResultHandler.
|
||||||
nsAutoPtr<txResultBuffer> buffer(mBuffer);
|
nsAutoPtr<txResultBuffer> buffer(Move(mBuffer));
|
||||||
return buffer->flushToHandler(mEs->mResultHandler);
|
return buffer->flushToHandler(mEs->mResultHandler);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include "mozilla/ArrayUtils.h"
|
#include "mozilla/ArrayUtils.h"
|
||||||
#include "mozilla/DebugOnly.h"
|
#include "mozilla/DebugOnly.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
|
|
||||||
#include "nsCSSParser.h"
|
#include "nsCSSParser.h"
|
||||||
#include "nsCSSProps.h"
|
#include "nsCSSProps.h"
|
||||||
@ -3575,7 +3576,7 @@ CSSParserImpl::ParsePageRule(RuleAppendFunc aAppendFunc, void* aData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Takes ownership of declaration.
|
// Takes ownership of declaration.
|
||||||
nsRefPtr<nsCSSPageRule> rule = new nsCSSPageRule(declaration);
|
nsRefPtr<nsCSSPageRule> rule = new nsCSSPageRule(Move(declaration));
|
||||||
|
|
||||||
(*aAppendFunc)(rule, aData);
|
(*aAppendFunc)(rule, aData);
|
||||||
return true;
|
return true;
|
||||||
@ -3599,7 +3600,7 @@ CSSParserImpl::ParseKeyframeRule()
|
|||||||
|
|
||||||
// Takes ownership of declaration, and steals contents of selectorList.
|
// Takes ownership of declaration, and steals contents of selectorList.
|
||||||
nsRefPtr<nsCSSKeyframeRule> rule =
|
nsRefPtr<nsCSSKeyframeRule> rule =
|
||||||
new nsCSSKeyframeRule(selectorList, declaration);
|
new nsCSSKeyframeRule(selectorList, Move(declaration));
|
||||||
|
|
||||||
return rule.forget();
|
return rule.forget();
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#define nsCSSRules_h_
|
#define nsCSSRules_h_
|
||||||
|
|
||||||
#include "mozilla/Attributes.h"
|
#include "mozilla/Attributes.h"
|
||||||
|
#include "mozilla/Move.h"
|
||||||
|
|
||||||
#include "mozilla/MemoryReporting.h"
|
#include "mozilla/MemoryReporting.h"
|
||||||
#include "mozilla/css/GroupRule.h"
|
#include "mozilla/css/GroupRule.h"
|
||||||
@ -421,8 +422,8 @@ class nsCSSKeyframeRule MOZ_FINAL : public mozilla::css::Rule,
|
|||||||
public:
|
public:
|
||||||
// WARNING: Steals the contents of aKeys *and* aDeclaration
|
// WARNING: Steals the contents of aKeys *and* aDeclaration
|
||||||
nsCSSKeyframeRule(InfallibleTArray<float>& aKeys,
|
nsCSSKeyframeRule(InfallibleTArray<float>& aKeys,
|
||||||
nsAutoPtr<mozilla::css::Declaration> aDeclaration)
|
nsAutoPtr<mozilla::css::Declaration>&& aDeclaration)
|
||||||
: mDeclaration(aDeclaration)
|
: mDeclaration(mozilla::Move(aDeclaration))
|
||||||
{
|
{
|
||||||
mKeys.SwapElements(aKeys);
|
mKeys.SwapElements(aKeys);
|
||||||
}
|
}
|
||||||
@ -548,8 +549,8 @@ class nsCSSPageRule MOZ_FINAL : public mozilla::css::Rule,
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// WARNING: Steals the contents of aDeclaration
|
// WARNING: Steals the contents of aDeclaration
|
||||||
nsCSSPageRule(nsAutoPtr<mozilla::css::Declaration> aDeclaration)
|
nsCSSPageRule(nsAutoPtr<mozilla::css::Declaration>&& aDeclaration)
|
||||||
: mDeclaration(aDeclaration),
|
: mDeclaration(mozilla::Move(aDeclaration)),
|
||||||
mImportantRule(nullptr)
|
mImportantRule(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -2203,7 +2203,7 @@ nsHttpChannel::ProcessPartialContent()
|
|||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
// make the cached response be the current response
|
// make the cached response be the current response
|
||||||
mResponseHead = mCachedResponseHead;
|
mResponseHead = Move(mCachedResponseHead);
|
||||||
|
|
||||||
UpdateInhibitPersistentCachingFlag();
|
UpdateInhibitPersistentCachingFlag();
|
||||||
|
|
||||||
@ -2334,7 +2334,7 @@ nsHttpChannel::ProcessNotModified()
|
|||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
// make the cached response be the current response
|
// make the cached response be the current response
|
||||||
mResponseHead = mCachedResponseHead;
|
mResponseHead = Move(mCachedResponseHead);
|
||||||
|
|
||||||
UpdateInhibitPersistentCachingFlag();
|
UpdateInhibitPersistentCachingFlag();
|
||||||
|
|
||||||
@ -3536,7 +3536,7 @@ nsHttpChannel::ReadFromCache(bool alreadyMarkedValid)
|
|||||||
"Using cached copy of: %s\n", this, mSpec.get()));
|
"Using cached copy of: %s\n", this, mSpec.get()));
|
||||||
|
|
||||||
if (mCachedResponseHead)
|
if (mCachedResponseHead)
|
||||||
mResponseHead = mCachedResponseHead;
|
mResponseHead = Move(mCachedResponseHead);
|
||||||
|
|
||||||
UpdateInhibitPersistentCachingFlag();
|
UpdateInhibitPersistentCachingFlag();
|
||||||
|
|
||||||
@ -5156,7 +5156,7 @@ nsHttpChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt, nsresult st
|
|||||||
}
|
}
|
||||||
else if (contentLength != int64_t(-1) && contentLength != size) {
|
else if (contentLength != int64_t(-1) && contentLength != size) {
|
||||||
LOG((" concurrent cache entry write has been interrupted"));
|
LOG((" concurrent cache entry write has been interrupted"));
|
||||||
mCachedResponseHead = mResponseHead;
|
mCachedResponseHead = Move(mResponseHead);
|
||||||
rv = MaybeSetupByteRangeRequest(size, contentLength);
|
rv = MaybeSetupByteRangeRequest(size, contentLength);
|
||||||
if (NS_SUCCEEDED(rv) && mIsPartialRequest) {
|
if (NS_SUCCEEDED(rv) && mIsPartialRequest) {
|
||||||
// Prevent read from cache again
|
// Prevent read from cache again
|
||||||
|
@ -118,6 +118,12 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsAutoPtr<T>& operator=(nsAutoPtr<T>&& aRhs)
|
||||||
|
{
|
||||||
|
assign(aRhs.forget());
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
// Other pointer operators
|
// Other pointer operators
|
||||||
|
|
||||||
T*
|
T*
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
#ifndef nsClassHashtable_h__
|
#ifndef nsClassHashtable_h__
|
||||||
#define nsClassHashtable_h__
|
#define nsClassHashtable_h__
|
||||||
|
|
||||||
|
#include "mozilla/Move.h"
|
||||||
#include "nsBaseHashtable.h"
|
#include "nsBaseHashtable.h"
|
||||||
#include "nsHashKeys.h"
|
#include "nsHashKeys.h"
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
@ -109,7 +110,7 @@ nsClassHashtable<KeyClass,T>::RemoveAndForget(KeyType aKey, nsAutoPtr<T> &aOut)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Transfer ownership from ent->mData into aOut.
|
// Transfer ownership from ent->mData into aOut.
|
||||||
aOut = ent->mData;
|
aOut = mozilla::Move(ent->mData);
|
||||||
|
|
||||||
this->Remove(aKey);
|
this->Remove(aKey);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user