Bug 967364: Pass already_AddRefed by reference instead of by value. r=bsmedberg

This commit is contained in:
Kyle Huey 2014-03-15 12:00:17 -07:00
Родитель 1f3d658bb3
Коммит b564544cf7
299 изменённых файлов: 760 добавлений и 628 удалений

Просмотреть файл

@ -119,7 +119,7 @@ class Element : public FragmentOrElement
{
public:
#ifdef MOZILLA_INTERNAL_API
Element(already_AddRefed<nsINodeInfo> aNodeInfo) :
Element(already_AddRefed<nsINodeInfo>& aNodeInfo) :
FragmentOrElement(aNodeInfo),
mState(NS_EVENT_STATE_MOZ_READONLY)
{
@ -1210,9 +1210,10 @@ inline bool nsINode::HasAttributes() const
nsresult \
_elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
{ \
*aResult = nullptr; \
nsCOMPtr<nsINodeInfo> ni = aNodeInfo; \
_elementName *it = new _elementName(ni.forget()); \
*aResult = nullptr; \
already_AddRefed<nsINodeInfo> ni = \
nsCOMPtr<nsINodeInfo>(aNodeInfo).forget(); \
_elementName *it = new _elementName(ni); \
if (!it) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \
@ -1230,9 +1231,10 @@ _elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
nsresult \
_elementName::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const \
{ \
*aResult = nullptr; \
nsCOMPtr<nsINodeInfo> ni = aNodeInfo; \
_elementName *it = new _elementName(ni.forget()); \
*aResult = nullptr; \
already_AddRefed<nsINodeInfo> ni = \
nsCOMPtr<nsINodeInfo>(aNodeInfo).forget(); \
_elementName *it = new _elementName(ni); \
if (!it) { \
return NS_ERROR_OUT_OF_MEMORY; \
} \

Просмотреть файл

@ -166,7 +166,8 @@ class UndoManager;
class FragmentOrElement : public nsIContent
{
public:
FragmentOrElement(already_AddRefed<nsINodeInfo> aNodeInfo);
FragmentOrElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
FragmentOrElement(already_AddRefed<nsINodeInfo>&& aNodeInfo);
virtual ~FragmentOrElement();
NS_DECL_CYCLE_COLLECTING_ISUPPORTS

Просмотреть файл

@ -30,45 +30,47 @@ class Element;
nsresult
NS_NewElement(mozilla::dom::Element** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser);
nsresult
NS_NewXMLElement(mozilla::dom::Element** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
already_AddRefed<nsINodeInfo>&& aNodeInfo);
nsresult
NS_NewHTMLElement(mozilla::dom::Element** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser);
// First argument should be nsHTMLTag, but that adds dependency to parser
// for a bunch of files.
already_AddRefed<nsGenericHTMLElement>
CreateHTMLElement(uint32_t aNodeType, already_AddRefed<nsINodeInfo> aNodeInfo,
CreateHTMLElement(uint32_t aNodeType,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser);
nsresult
NS_NewMathMLElement(mozilla::dom::Element** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
already_AddRefed<nsINodeInfo>&& aNodeInfo);
#ifdef MOZ_XUL
nsresult
NS_NewXULElement(mozilla::dom::Element** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
already_AddRefed<nsINodeInfo>&& aNodeInfo);
void
NS_TrustedNewXULElement(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo);
NS_TrustedNewXULElement(nsIContent** aResult,
already_AddRefed<nsINodeInfo>&& aNodeInfo);
#endif
nsresult
NS_NewSVGElement(mozilla::dom::Element** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser);
nsresult
NS_NewGenConImageContent(nsIContent** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
imgRequestProxy* aImageRequest);
#endif // nsContentCreatorFunctions_h__

Просмотреть файл

@ -40,7 +40,8 @@ public:
protected:
#ifdef MOZILLA_INTERNAL_API
nsIAttribute(nsDOMAttributeMap *aAttrMap, already_AddRefed<nsINodeInfo> aNodeInfo,
nsIAttribute(nsDOMAttributeMap *aAttrMap,
already_AddRefed<nsINodeInfo>& aNodeInfo,
bool aNsAware);
#endif //MOZILLA_INTERNAL_API
virtual ~nsIAttribute();

Просмотреть файл

@ -53,11 +53,10 @@ public:
// If you're using the external API, the only thing you can know about
// nsIContent is that it exists with an IID
nsIContent(already_AddRefed<nsINodeInfo> aNodeInfo)
nsIContent(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsINode(aNodeInfo)
{
NS_ASSERTION(mNodeInfo,
"No nsINodeInfo passed to nsIContent, PREPARE TO CRASH!!!");
MOZ_ASSERT(mNodeInfo);
SetNodeIsContent();
}
#endif // MOZILLA_INTERNAL_API

Просмотреть файл

@ -319,7 +319,7 @@ public:
friend class nsAttrAndChildArray;
#ifdef MOZILLA_INTERNAL_API
nsINode(already_AddRefed<nsINodeInfo> aNodeInfo)
nsINode(already_AddRefed<nsINodeInfo>& aNodeInfo)
: mNodeInfo(aNodeInfo),
mParent(nullptr),
mBoolFlags(0),

Просмотреть файл

@ -30,7 +30,7 @@
#include "nsWrapperCacheInlines.h"
nsIAttribute::nsIAttribute(nsDOMAttributeMap* aAttrMap,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>& aNodeInfo,
bool aNsAware)
: nsINode(aNodeInfo), mAttrMap(aAttrMap), mNsAware(aNsAware)
{
@ -47,7 +47,7 @@ namespace dom {
bool Attr::sInitialized;
Attr::Attr(nsDOMAttributeMap *aAttrMap,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
const nsAString &aValue, bool aNsAware)
: nsIAttribute(aAttrMap, aNodeInfo, aNsAware), mValue(aValue)
{

Просмотреть файл

@ -32,7 +32,7 @@ class Attr MOZ_FINAL : public nsIAttribute,
{
public:
Attr(nsDOMAttributeMap* aAttrMap,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
const nsAString& aValue,
bool aNsAware);
virtual ~Attr() {}

Просмотреть файл

@ -24,7 +24,7 @@ private:
}
public:
Comment(already_AddRefed<nsINodeInfo> aNodeInfo)
Comment(already_AddRefed<nsINodeInfo>&& aNodeInfo)
: nsGenericDOMDataNode(aNodeInfo)
{
Init();

Просмотреть файл

@ -51,7 +51,7 @@ public:
// interface nsIDOMDocumentFragment
NS_DECL_NSIDOMDOCUMENTFRAGMENT
DocumentFragment(already_AddRefed<nsINodeInfo> aNodeInfo)
DocumentFragment(already_AddRefed<nsINodeInfo>& aNodeInfo)
: FragmentOrElement(aNodeInfo), mHost(nullptr)
{
Init();

Просмотреть файл

@ -45,14 +45,14 @@ NS_NewDOMDocumentType(nsNodeInfoManager* aNodeInfoManager,
return nullptr;
}
nsCOMPtr<nsINodeInfo> ni =
already_AddRefed<nsINodeInfo> ni =
aNodeInfoManager->GetNodeInfo(nsGkAtoms::documentTypeNodeName, nullptr,
kNameSpaceID_None,
nsIDOMNode::DOCUMENT_TYPE_NODE,
aName);
nsRefPtr<mozilla::dom::DocumentType> docType =
new mozilla::dom::DocumentType(ni.forget(), aPublicId, aSystemId, aInternalSubset);
new mozilla::dom::DocumentType(ni, aPublicId, aSystemId, aInternalSubset);
return docType.forget();
}
@ -65,7 +65,7 @@ DocumentType::WrapNode(JSContext *cx, JS::Handle<JSObject*> scope)
return DocumentTypeBinding::Wrap(cx, scope, this);
}
DocumentType::DocumentType(already_AddRefed<nsINodeInfo> aNodeInfo,
DocumentType::DocumentType(already_AddRefed<nsINodeInfo>& aNodeInfo,
const nsAString& aPublicId,
const nsAString& aSystemId,
const nsAString& aInternalSubset) :
@ -141,9 +141,8 @@ DocumentType::MozRemove()
nsGenericDOMDataNode*
DocumentType::CloneDataNode(nsINodeInfo *aNodeInfo, bool aCloneText) const
{
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
return new DocumentType(ni.forget(), mPublicId, mSystemId,
mInternalSubset);
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
return new DocumentType(ni, mPublicId, mSystemId, mInternalSubset);
}
} // namespace dom

Просмотреть файл

@ -29,7 +29,7 @@ class DocumentTypeForward : public nsGenericDOMDataNode,
public nsIDOMDocumentType
{
public:
DocumentTypeForward(already_AddRefed<nsINodeInfo> aNodeInfo)
DocumentTypeForward(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericDOMDataNode(aNodeInfo)
{
}
@ -41,7 +41,7 @@ public:
class DocumentType MOZ_FINAL : public DocumentTypeForward
{
public:
DocumentType(already_AddRefed<nsINodeInfo> aNodeInfo,
DocumentType(already_AddRefed<nsINodeInfo>& aNodeInfo,
const nsAString& aPublicId,
const nsAString& aSystemId,
const nsAString& aInternalSubset);

Просмотреть файл

@ -619,7 +619,12 @@ FragmentOrElement::nsDOMSlots::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) c
return n;
}
FragmentOrElement::FragmentOrElement(already_AddRefed<nsINodeInfo> aNodeInfo)
FragmentOrElement::FragmentOrElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsIContent(aNodeInfo)
{
}
FragmentOrElement::FragmentOrElement(already_AddRefed<nsINodeInfo>&& aNodeInfo)
: nsIContent(aNodeInfo)
{
}

Просмотреть файл

@ -65,7 +65,7 @@ NS_IMPL_ADDREF_INHERITED(ShadowRoot, DocumentFragment)
NS_IMPL_RELEASE_INHERITED(ShadowRoot, DocumentFragment)
ShadowRoot::ShadowRoot(nsIContent* aContent,
already_AddRefed<nsINodeInfo> aNodeInfo,
already_AddRefed<nsINodeInfo>&& aNodeInfo,
nsXBLPrototypeBinding* aProtoBinding)
: DocumentFragment(aNodeInfo), mPoolHost(aContent),
mProtoBinding(aProtoBinding), mShadowElement(nullptr),

Просмотреть файл

@ -42,7 +42,7 @@ public:
NS_DECL_NSIMUTATIONOBSERVER_CONTENTINSERTED
NS_DECL_NSIMUTATIONOBSERVER_CONTENTREMOVED
ShadowRoot(nsIContent* aContent, already_AddRefed<nsINodeInfo> aNodeInfo,
ShadowRoot(nsIContent* aContent, already_AddRefed<nsINodeInfo>&& aNodeInfo,
nsXBLPrototypeBinding* aProtoBinding);
virtual ~ShadowRoot();

Просмотреть файл

@ -15,7 +15,11 @@ namespace dom {
class Text : public nsGenericDOMDataNode
{
public:
Text(already_AddRefed<nsINodeInfo> aNodeInfo)
Text(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericDOMDataNode(aNodeInfo)
{}
Text(already_AddRefed<nsINodeInfo>&& aNodeInfo)
: nsGenericDOMDataNode(aNodeInfo)
{}

Просмотреть файл

@ -80,7 +80,7 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsDOMDataChannel)
NS_INTERFACE_MAP_ENTRY(nsIDOMDataChannel)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
nsDOMDataChannel::nsDOMDataChannel(already_AddRefed<mozilla::DataChannel> aDataChannel,
nsDOMDataChannel::nsDOMDataChannel(already_AddRefed<mozilla::DataChannel>& aDataChannel,
nsPIDOMWindow* aWindow)
: nsDOMEventTargetHelper(aWindow && aWindow->IsOuterWindow() ?
aWindow->GetCurrentInnerWindow() : aWindow)
@ -490,7 +490,7 @@ nsDOMDataChannel::AppReady()
/* static */
nsresult
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel> aDataChannel,
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel>&& aDataChannel,
nsPIDOMWindow* aWindow,
nsIDOMDataChannel** aDomDataChannel)
{

Просмотреть файл

@ -25,7 +25,7 @@ class nsDOMDataChannel : public nsDOMEventTargetHelper,
public mozilla::DataChannelListener
{
public:
nsDOMDataChannel(already_AddRefed<mozilla::DataChannel> aDataChannel,
nsDOMDataChannel(already_AddRefed<mozilla::DataChannel>& aDataChannel,
nsPIDOMWindow* aWindow);
~nsDOMDataChannel();

Просмотреть файл

@ -20,7 +20,7 @@ namespace mozilla {
class nsPIDOMWindow;
nsresult
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel> dataChannel,
NS_NewDOMDataChannel(already_AddRefed<mozilla::DataChannel>&& dataChannel,
nsPIDOMWindow* aWindow,
nsIDOMDataChannel** domDataChannel);

Просмотреть файл

@ -607,7 +607,7 @@ nsDOMMutationObserver::HandleMutation()
for (uint32_t i = 0; i < mPendingMutationCount; ++i) {
nsRefPtr<nsDOMMutationRecord> next;
current->mNext.swap(next);
*mutations.AppendElement() = current.forget();
*mutations.AppendElement() = current;
current.swap(next);
}
}

Просмотреть файл

@ -343,7 +343,7 @@ class nsDOMMutationObserver : public nsISupports,
public nsWrapperCache
{
public:
nsDOMMutationObserver(already_AddRefed<nsPIDOMWindow> aOwner,
nsDOMMutationObserver(already_AddRefed<nsPIDOMWindow>&& aOwner,
mozilla::dom::MutationCallback& aCb)
: mOwner(aOwner), mLastPendingMutation(nullptr), mPendingMutationCount(0),
mCallback(&aCb), mWaitingForRun(false), mId(++sCount)

Просмотреть файл

@ -1426,11 +1426,13 @@ struct nsIDocument::FrameRequest
int32_t mHandle;
};
static already_AddRefed<nsINodeInfo> nullNodeInfo(nullptr);
// ==================================================================
// =
// ==================================================================
nsIDocument::nsIDocument()
: nsINode(nullptr),
: nsINode(nullNodeInfo),
mCharacterSet(NS_LITERAL_CSTRING("ISO-8859-1")),
mNodeInfoManager(nullptr),
mCompatMode(eCompatibility_FullStandards),
@ -10271,7 +10273,8 @@ FullscreenRoots::Add(nsIDocument* aRoot)
if (!sInstance) {
sInstance = new FullscreenRoots();
}
sInstance->mRoots.AppendElement(do_GetWeakReference(aRoot));
nsWeakPtr weakRoot = do_GetWeakReference(aRoot);
sInstance->mRoots.AppendElement(weakRoot);
}
}
@ -10838,7 +10841,8 @@ nsDocument::FullScreenStackPush(Element* aElement)
nsEventStateManager::SetFullScreenState(top, false);
}
nsEventStateManager::SetFullScreenState(aElement, true);
mFullScreenStack.AppendElement(do_GetWeakReference(aElement));
nsWeakPtr weakElement = do_GetWeakReference(aElement);
mFullScreenStack.AppendElement(weakElement);
NS_ASSERTION(GetFullScreenElement() == aElement, "Should match");
return true;
}

Просмотреть файл

@ -22,7 +22,7 @@ class nsGenConImageContent MOZ_FINAL : public nsXMLElement,
public nsImageLoadingContent
{
public:
nsGenConImageContent(already_AddRefed<nsINodeInfo> aNodeInfo)
nsGenConImageContent(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsXMLElement(aNodeInfo)
{
// nsImageLoadingContent starts out broken, so we start out
@ -68,7 +68,7 @@ NS_IMPL_ISUPPORTS_INHERITED3(nsGenConImageContent,
imgIOnloadBlocker)
nsresult
NS_NewGenConImageContent(nsIContent** aResult, already_AddRefed<nsINodeInfo> aNodeInfo,
NS_NewGenConImageContent(nsIContent** aResult, already_AddRefed<nsINodeInfo>&& aNodeInfo,
imgRequestProxy* aImageRequest)
{
NS_PRECONDITION(aImageRequest, "Must have request!");

Просмотреть файл

@ -42,7 +42,19 @@
using namespace mozilla;
using namespace mozilla::dom;
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo)
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsIContent(aNodeInfo)
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::CDATA_SECTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::COMMENT_NODE ||
mNodeInfo->NodeType() ==
nsIDOMNode::PROCESSING_INSTRUCTION_NODE ||
mNodeInfo->NodeType() == nsIDOMNode::DOCUMENT_TYPE_NODE,
"Bad NodeType in aNodeInfo");
}
nsGenericDOMDataNode::nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>&& aNodeInfo)
: nsIContent(aNodeInfo)
{
NS_ABORT_IF_FALSE(mNodeInfo->NodeType() == nsIDOMNode::TEXT_NODE ||

Просмотреть файл

@ -70,7 +70,8 @@ public:
NS_DECL_SIZEOF_EXCLUDING_THIS
nsGenericDOMDataNode(already_AddRefed<nsINodeInfo> aNodeInfo);
nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>& aNodeInfo);
nsGenericDOMDataNode(already_AddRefed<nsINodeInfo>&& aNodeInfo);
virtual ~nsGenericDOMDataNode();
virtual void GetNodeValueInternal(nsAString& aNodeValue) MOZ_OVERRIDE;

Просмотреть файл

@ -2192,7 +2192,7 @@ nsINode::GetBoundMutationObservers(nsTArray<nsRefPtr<nsDOMMutationObserver> >& a
nsCOMPtr<nsDOMMutationObserver> mo = do_QueryInterface(objects->ObjectAt(i));
if (mo) {
MOZ_ASSERT(!aResult.Contains(mo));
aResult.AppendElement(mo.forget());
aResult.AppendElement(mo);
}
}
}

Просмотреть файл

@ -28,7 +28,7 @@ class nsMappedAttributeElement : public nsMappedAttributeElementBase
protected:
nsMappedAttributeElement(already_AddRefed<nsINodeInfo> aNodeInfo)
nsMappedAttributeElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsMappedAttributeElementBase(aNodeInfo)
{}

Просмотреть файл

@ -137,7 +137,8 @@ nsNameSpaceManager::GetNameSpaceID(const nsAString& aURI)
nsresult
NS_NewElement(Element** aResult,
already_AddRefed<nsINodeInfo> aNodeInfo, FromParser aFromParser)
already_AddRefed<nsINodeInfo>&& aNodeInfo,
FromParser aFromParser)
{
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
int32_t ns = ni->NamespaceID();

Просмотреть файл

@ -30,7 +30,7 @@ class nsStyledElementNotElementCSSInlineStyle : public nsStyledElementBase
protected:
inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsINodeInfo> aNodeInfo)
inline nsStyledElementNotElementCSSInlineStyle(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsStyledElementBase(aNodeInfo)
{}
@ -82,7 +82,7 @@ protected:
class nsStyledElement : public nsStyledElementNotElementCSSInlineStyle {
protected:
inline nsStyledElement(already_AddRefed<nsINodeInfo> aNodeInfo)
inline nsStyledElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsStyledElementNotElementCSSInlineStyle(aNodeInfo)
{}
};

Просмотреть файл

@ -32,7 +32,7 @@ class nsAttributeTextNode MOZ_FINAL : public nsTextNode,
public:
NS_DECL_ISUPPORTS_INHERITED
nsAttributeTextNode(already_AddRefed<nsINodeInfo> aNodeInfo,
nsAttributeTextNode(already_AddRefed<nsINodeInfo>& aNodeInfo,
int32_t aNameSpaceID,
nsIAtom* aAttrName) :
nsTextNode(aNodeInfo),
@ -60,8 +60,9 @@ public:
virtual nsGenericDOMDataNode *CloneDataNode(nsINodeInfo *aNodeInfo,
bool aCloneText) const
{
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
nsAttributeTextNode *it = new nsAttributeTextNode(ni.forget(),
already_AddRefed<nsINodeInfo> ni =
nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
nsAttributeTextNode *it = new nsAttributeTextNode(ni,
mNameSpaceID,
mAttrName);
if (it && aCloneText) {
@ -112,9 +113,9 @@ nsTextNode::IsNodeOfType(uint32_t aFlags) const
nsGenericDOMDataNode*
nsTextNode::CloneDataNode(nsINodeInfo *aNodeInfo, bool aCloneText) const
{
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
nsTextNode *it = new nsTextNode(ni.forget());
if (it && aCloneText) {
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
nsTextNode *it = new nsTextNode(ni);
if (aCloneText) {
it->mText = mText;
}
@ -206,12 +207,9 @@ NS_NewAttributeContent(nsNodeInfoManager *aNodeInfoManager,
*aResult = nullptr;
nsCOMPtr<nsINodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
if (!ni) {
return NS_ERROR_OUT_OF_MEMORY;
}
already_AddRefed<nsINodeInfo> ni = aNodeInfoManager->GetTextNodeInfo();
nsAttributeTextNode* textNode = new nsAttributeTextNode(ni.forget(),
nsAttributeTextNode* textNode = new nsAttributeTextNode(ni,
aNameSpaceID,
aAttrName);
if (!textNode) {

Просмотреть файл

@ -31,7 +31,7 @@ private:
}
public:
nsTextNode(already_AddRefed<nsINodeInfo> aNodeInfo)
nsTextNode(already_AddRefed<nsINodeInfo>& aNodeInfo)
: mozilla::dom::Text(aNodeInfo)
{
Init();

Просмотреть файл

@ -24,7 +24,7 @@ class HTMLAudioElement MOZ_FINAL : public HTMLMediaElement,
public nsIDOMHTMLAudioElement
{
public:
HTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLAudioElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLAudioElement();
// nsISupports

Просмотреть файл

@ -46,7 +46,7 @@ class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement,
typedef layers::LayerManager LayerManager;
public:
HTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLCanvasElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLCanvasElement();
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLCanvasElement, canvas)

Просмотреть файл

@ -72,7 +72,7 @@ public:
return mCORSMode;
}
HTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLMediaElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLMediaElement();
/**

Просмотреть файл

@ -21,7 +21,7 @@ class HTMLVideoElement MOZ_FINAL : public HTMLMediaElement,
public nsIDOMHTMLVideoElement
{
public:
HTMLVideoElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLVideoElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLVideoElement();
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLVideoElement, video)

Просмотреть файл

@ -24,7 +24,7 @@ public:
using Element::GetText;
using Element::SetText;
HTMLAnchorElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLAnchorElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
{

Просмотреть файл

@ -15,7 +15,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Area)
namespace mozilla {
namespace dom {
HTMLAreaElement::HTMLAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLAreaElement::HTMLAreaElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
{

Просмотреть файл

@ -25,7 +25,7 @@ class HTMLAreaElement MOZ_FINAL : public nsGenericHTMLElement,
public Link
{
public:
HTMLAreaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLAreaElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLAreaElement();
// nsISupports

Просмотреть файл

@ -36,7 +36,7 @@ NS_IMPL_ISUPPORTS_INHERITED4(HTMLAudioElement, HTMLMediaElement,
NS_IMPL_ELEMENT_CLONE(HTMLAudioElement)
HTMLAudioElement::HTMLAudioElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLAudioElement::HTMLAudioElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: HTMLMediaElement(aNodeInfo),
mTimerActivated(false)
{
@ -59,12 +59,12 @@ HTMLAudioElement::Audio(const GlobalObject& aGlobal,
return nullptr;
}
nsCOMPtr<nsINodeInfo> nodeInfo =
already_AddRefed<nsINodeInfo> nodeInfo =
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::audio, nullptr,
kNameSpaceID_XHTML,
nsIDOMNode::ELEMENT_NODE);
nsRefPtr<HTMLAudioElement> audio = new HTMLAudioElement(nodeInfo.forget());
nsRefPtr<HTMLAudioElement> audio = new HTMLAudioElement(nodeInfo);
audio->SetHTMLAttr(nsGkAtoms::preload, NS_LITERAL_STRING("auto"), aRv);
if (aRv.Failed()) {
return nullptr;

Просмотреть файл

@ -17,7 +17,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(BR)
namespace mozilla {
namespace dom {
HTMLBRElement::HTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLBRElement::HTMLBRElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -18,7 +18,7 @@ class HTMLBRElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLBRElement
{
public:
HTMLBRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLBRElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLBRElement();
// nsISupports

Просмотреть файл

@ -40,7 +40,7 @@ public:
using Element::GetText;
using Element::SetText;
HTMLBodyElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLBodyElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -54,7 +54,7 @@ static const nsAttrValue::EnumTable* kButtonDefaultType = &kButtonTypeTable[2];
// Construction, destruction
HTMLButtonElement::HTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLButtonElement::HTMLButtonElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElementWithState(aNodeInfo),
mType(kButtonDefaultType->value),

Просмотреть файл

@ -21,7 +21,7 @@ class HTMLButtonElement MOZ_FINAL : public nsGenericHTMLFormElementWithState,
public:
using nsIConstraintValidation::GetValidationMessage;
HTMLButtonElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLButtonElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
virtual ~HTMLButtonElement();

Просмотреть файл

@ -113,7 +113,7 @@ HTMLCanvasPrintState::NotifyDone()
// ---------------------------------------------------------------------------
HTMLCanvasElement::HTMLCanvasElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLCanvasElement::HTMLCanvasElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mWriteOnly(false)
{

Просмотреть файл

@ -21,7 +21,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Content)
using namespace mozilla::dom;
HTMLContentElement::HTMLContentElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLContentElement::HTMLContentElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo), mValidSelector(true), mIsInsertionPoint(false)
{
SetIsDOMBinding();

Просмотреть файл

@ -19,7 +19,7 @@ class DistributedContentList;
class HTMLContentElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLContentElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLContentElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLContentElement();
// nsISupports

Просмотреть файл

@ -12,7 +12,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Data)
namespace mozilla {
namespace dom {
HTMLDataElement::HTMLDataElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLDataElement::HTMLDataElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -17,7 +17,7 @@ namespace dom {
class HTMLDataElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLDataElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLDataElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLDataElement();
// HTMLDataElement WebIDL

Просмотреть файл

@ -15,7 +15,7 @@ namespace dom {
class HTMLDataListElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLDataListElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLDataListElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -16,7 +16,7 @@ class HTMLDivElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLDivElement
{
public:
HTMLDivElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLDivElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -13,7 +13,7 @@ namespace dom {
class HTMLElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLElement();
NS_IMETHOD GetInnerHTML(nsAString& aInnerHTML) MOZ_OVERRIDE;
@ -26,7 +26,7 @@ protected:
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE;
};
HTMLElement::HTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLElement::HTMLElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}
@ -68,7 +68,7 @@ HTMLElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
// Here, we expand 'NS_IMPL_NS_NEW_HTML_ELEMENT()' by hand.
// (Calling the macro directly (with no args) produces compiler warnings.)
nsGenericHTMLElement*
NS_NewHTMLElement(already_AddRefed<nsINodeInfo> aNodeInfo,
NS_NewHTMLElement(already_AddRefed<nsINodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
return new mozilla::dom::HTMLElement(aNodeInfo);

Просмотреть файл

@ -14,7 +14,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(FieldSet)
namespace mozilla {
namespace dom {
HTMLFieldSetElement::HTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLFieldSetElement::HTMLFieldSetElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLFormElement(aNodeInfo)
, mElements(nullptr)
, mFirstLegend(nullptr)

Просмотреть файл

@ -26,7 +26,7 @@ public:
using nsIConstraintValidation::CheckValidity;
using nsIConstraintValidation::GetValidationMessage;
HTMLFieldSetElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLFieldSetElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLFieldSetElement();
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLFieldSetElement, fieldset)

Просмотреть файл

@ -14,7 +14,7 @@ namespace dom {
class HTMLFontElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLFontElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLFontElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -62,7 +62,7 @@
// construction, destruction
nsGenericHTMLElement*
NS_NewHTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo,
NS_NewHTMLFormElement(already_AddRefed<nsINodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
mozilla::dom::HTMLFormElement* it = new mozilla::dom::HTMLFormElement(aNodeInfo);
@ -94,7 +94,7 @@ static const nsAttrValue::EnumTable* kFormDefaultAutocomplete = &kFormAutocomple
bool HTMLFormElement::gFirstFormSubmitted = false;
bool HTMLFormElement::gPasswordManagerInitialized = false;
HTMLFormElement::HTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLFormElement::HTMLFormElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mSelectedRadioButtons(4),
mRequiredRadioButtonCounts(4),

Просмотреть файл

@ -40,7 +40,7 @@ class HTMLFormElement MOZ_FINAL : public nsGenericHTMLElement,
friend class HTMLFormControlsCollection;
public:
HTMLFormElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLFormElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLFormElement();
nsresult Init();

Просмотреть файл

@ -13,7 +13,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(Frame)
namespace mozilla {
namespace dom {
HTMLFrameElement::HTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLFrameElement::HTMLFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
{

Просмотреть файл

@ -22,7 +22,7 @@ class HTMLFrameElement MOZ_FINAL : public nsGenericHTMLFrameElement,
public:
using nsGenericHTMLFrameElement::SwapFrameLoaders;
HTMLFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
virtual ~HTMLFrameElement();

Просмотреть файл

@ -46,7 +46,7 @@ class HTMLFrameSetElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLFrameSetElement
{
public:
HTMLFrameSetElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLFrameSetElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mNumRows(0),
mNumCols(0),

Просмотреть файл

@ -11,7 +11,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(HR)
namespace mozilla {
namespace dom {
HTMLHRElement::HTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLHRElement::HTMLHRElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -20,7 +20,7 @@ class HTMLHRElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLHRElement
{
public:
HTMLHRElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLHRElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLHRElement();
// nsISupports

Просмотреть файл

@ -17,7 +17,7 @@ class HTMLHeadingElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLHeadingElement
{
public:
HTMLHeadingElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLHeadingElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -17,7 +17,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(IFrame)
namespace mozilla {
namespace dom {
HTMLIFrameElement::HTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLIFrameElement::HTMLIFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFrameElement(aNodeInfo, aFromParser)
{

Просмотреть файл

@ -18,7 +18,7 @@ class HTMLIFrameElement MOZ_FINAL : public nsGenericHTMLFrameElement
, public nsIDOMHTMLIFrameElement
{
public:
HTMLIFrameElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLIFrameElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
virtual ~HTMLIFrameElement();

Просмотреть файл

@ -45,7 +45,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Image)
namespace mozilla {
namespace dom {
HTMLImageElement::HTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLImageElement::HTMLImageElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, mForm(nullptr)
{
@ -547,12 +547,12 @@ HTMLImageElement::Image(const GlobalObject& aGlobal,
return nullptr;
}
nsCOMPtr<nsINodeInfo> nodeInfo =
already_AddRefed<nsINodeInfo> nodeInfo =
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::img, nullptr,
kNameSpaceID_XHTML,
nsIDOMNode::ELEMENT_NODE);
nsRefPtr<HTMLImageElement> img = new HTMLImageElement(nodeInfo.forget());
nsRefPtr<HTMLImageElement> img = new HTMLImageElement(nodeInfo);
if (aWidth.WasPassed()) {
img->SetWidth(aWidth.Value(), aError);

Просмотреть файл

@ -21,7 +21,7 @@ class HTMLImageElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLImageElement
{
public:
explicit HTMLImageElement(already_AddRefed<nsINodeInfo> aNodeInfo);
explicit HTMLImageElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLImageElement();
static already_AddRefed<HTMLImageElement>

Просмотреть файл

@ -1109,7 +1109,7 @@ static nsresult FireEventForAccessibility(nsIDOMHTMLInputElement* aTarget,
// construction, destruction
//
HTMLInputElement::HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLInputElement::HTMLInputElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElementWithState(aNodeInfo)
, mType(kInputDefaultType->value)
@ -1245,9 +1245,8 @@ HTMLInputElement::Clone(nsINodeInfo* aNodeInfo, nsINode** aResult) const
{
*aResult = nullptr;
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
nsRefPtr<HTMLInputElement> it =
new HTMLInputElement(ni.forget(), NOT_FROM_PARSER);
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
nsRefPtr<HTMLInputElement> it = new HTMLInputElement(ni, NOT_FROM_PARSER);
nsresult rv = const_cast<HTMLInputElement*>(this)->CopyInnerTo(it);
NS_ENSURE_SUCCESS(rv, rv);

Просмотреть файл

@ -97,7 +97,7 @@ public:
using nsIConstraintValidation::Validity;
using nsGenericHTMLFormElementWithState::GetForm;
HTMLInputElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLInputElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
mozilla::dom::FromParser aFromParser);
virtual ~HTMLInputElement();

Просмотреть файл

@ -18,7 +18,7 @@ class HTMLLIElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLLIElement
{
public:
HTMLLIElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLLIElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -20,7 +20,7 @@ class HTMLLabelElement MOZ_FINAL : public nsGenericHTMLFormElement,
public nsIDOMHTMLLabelElement
{
public:
HTMLLabelElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLLabelElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLFormElement(aNodeInfo),
mHandlingEvent(false)
{

Просмотреть файл

@ -16,7 +16,7 @@ namespace dom {
class HTMLLegendElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLLegendElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLLegendElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -31,7 +31,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Link)
namespace mozilla {
namespace dom {
HTMLLinkElement::HTMLLinkElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLLinkElement::HTMLLinkElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
, Link(MOZ_THIS_IN_INITIALIZER_LIST())
{

Просмотреть файл

@ -21,7 +21,7 @@ class HTMLLinkElement MOZ_FINAL : public nsGenericHTMLElement,
public Link
{
public:
HTMLLinkElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLLinkElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLLinkElement();
// nsISupports

Просмотреть файл

@ -15,7 +15,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Map)
namespace mozilla {
namespace dom {
HTMLMapElement::HTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLMapElement::HTMLMapElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -21,7 +21,7 @@ class HTMLMapElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLMapElement
{
public:
HTMLMapElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLMapElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
// nsISupports
NS_DECL_ISUPPORTS_INHERITED

Просмотреть файл

@ -1961,7 +1961,7 @@ HTMLMediaElement::LookupMediaElementURITable(nsIURI* aURI)
return nullptr;
}
HTMLMediaElement::HTMLMediaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLMediaElement::HTMLMediaElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mSrcStreamListener(nullptr),
mCurrentLoadID(0),

Просмотреть файл

@ -45,7 +45,7 @@ enum SeparatorType
HTMLMenuElement::HTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLMenuElement::HTMLMenuElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo), mType(MENU_TYPE_LIST)
{
}

Просмотреть файл

@ -19,7 +19,7 @@ class HTMLMenuElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIHTMLMenu
{
public:
HTMLMenuElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLMenuElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLMenuElement();
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLMenuElement, menu)

Просмотреть файл

@ -156,7 +156,7 @@ protected:
HTMLMenuItemElement::HTMLMenuItemElement(
already_AddRefed<nsINodeInfo> aNodeInfo, FromParser aFromParser)
already_AddRefed<nsINodeInfo>& aNodeInfo, FromParser aFromParser)
: nsGenericHTMLElement(aNodeInfo),
mType(kMenuItemDefaultType->value),
mParserCreating(false),
@ -180,9 +180,9 @@ nsresult
HTMLMenuItemElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
{
*aResult = nullptr;
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
nsRefPtr<HTMLMenuItemElement> it =
new HTMLMenuItemElement(ni.forget(), NOT_FROM_PARSER);
new HTMLMenuItemElement(ni, NOT_FROM_PARSER);
nsresult rv = const_cast<HTMLMenuItemElement*>(this)->CopyInnerTo(it);
if (NS_SUCCEEDED(rv)) {
switch (mType) {

Просмотреть файл

@ -21,7 +21,7 @@ class HTMLMenuItemElement MOZ_FINAL : public nsGenericHTMLElement,
public:
using mozilla::dom::Element::GetText;
HTMLMenuItemElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLMenuItemElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
mozilla::dom::FromParser aFromParser);
virtual ~HTMLMenuItemElement();

Просмотреть файл

@ -14,7 +14,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Meta)
namespace mozilla {
namespace dom {
HTMLMetaElement::HTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLMetaElement::HTMLMetaElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -17,7 +17,7 @@ class HTMLMetaElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLMetaElement
{
public:
HTMLMetaElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLMetaElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLMetaElement();
// nsISupports

Просмотреть файл

@ -16,7 +16,7 @@ const double HTMLMeterElement::kDefaultMin = 0.0;
const double HTMLMeterElement::kDefaultMax = 1.0;
HTMLMeterElement::HTMLMeterElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLMeterElement::HTMLMeterElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -20,7 +20,7 @@ namespace dom {
class HTMLMeterElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLMeterElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLMeterElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLMeterElement();
virtual nsEventStates IntrinsicState() const MOZ_OVERRIDE;

Просмотреть файл

@ -12,7 +12,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Mod)
namespace mozilla {
namespace dom {
HTMLModElement::HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLModElement::HTMLModElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -16,7 +16,7 @@ namespace dom {
class HTMLModElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLModElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLModElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLModElement();
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;

Просмотреть файл

@ -23,7 +23,7 @@
namespace mozilla {
namespace dom {
HTMLObjectElement::HTMLObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLObjectElement::HTMLObjectElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLFormElement(aNodeInfo),
mIsDoneAddingChildren(!aFromParser)

Просмотреть файл

@ -22,7 +22,7 @@ class HTMLObjectElement MOZ_FINAL : public nsGenericHTMLFormElement
, public nsIConstraintValidation
{
public:
HTMLObjectElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLObjectElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser = NOT_FROM_PARSER);
virtual ~HTMLObjectElement();

Просмотреть файл

@ -25,7 +25,7 @@ namespace dom {
HTMLOptGroupElement::HTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLOptGroupElement::HTMLOptGroupElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
// We start off enabled

Просмотреть файл

@ -17,7 +17,7 @@ class HTMLOptGroupElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLOptGroupElement
{
public:
HTMLOptGroupElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLOptGroupElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLOptGroupElement();
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLOptGroupElement, optgroup)

Просмотреть файл

@ -37,7 +37,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Option)
namespace mozilla {
namespace dom {
HTMLOptionElement::HTMLOptionElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLOptionElement::HTMLOptionElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mSelectedChanged(false),
mIsSelected(false),
@ -363,12 +363,12 @@ HTMLOptionElement::Option(const GlobalObject& aGlobal,
return nullptr;
}
nsCOMPtr<nsINodeInfo> nodeInfo =
already_AddRefed<nsINodeInfo> nodeInfo =
doc->NodeInfoManager()->GetNodeInfo(nsGkAtoms::option, nullptr,
kNameSpaceID_XHTML,
nsIDOMNode::ELEMENT_NODE);
nsRefPtr<HTMLOptionElement> option = new HTMLOptionElement(nodeInfo.forget());
nsRefPtr<HTMLOptionElement> option = new HTMLOptionElement(nodeInfo);
if (aText.WasPassed()) {
// Create a new text node and append it to the option

Просмотреть файл

@ -22,7 +22,7 @@ class HTMLOptionElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLOptionElement
{
public:
HTMLOptionElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLOptionElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLOptionElement();
static already_AddRefed<HTMLOptionElement>

Просмотреть файл

@ -18,7 +18,7 @@ NS_IMPL_NS_NEW_HTML_ELEMENT(Output)
namespace mozilla {
namespace dom {
HTMLOutputElement::HTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLOutputElement::HTMLOutputElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLFormElement(aNodeInfo)
, mValueModeFlag(eModeDefault)
{

Просмотреть файл

@ -21,7 +21,7 @@ class HTMLOutputElement MOZ_FINAL : public nsGenericHTMLFormElement,
public:
using nsIConstraintValidation::GetValidationMessage;
HTMLOutputElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLOutputElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLOutputElement();
// nsISupports

Просмотреть файл

@ -18,7 +18,7 @@ class HTMLParagraphElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLParagraphElement
{
public:
HTMLParagraphElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLParagraphElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -18,7 +18,7 @@ class HTMLPreElement MOZ_FINAL : public nsGenericHTMLElement,
public nsIDOMHTMLPreElement
{
public:
HTMLPreElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLPreElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
}

Просмотреть файл

@ -16,7 +16,7 @@ const double HTMLProgressElement::kDefaultValue = 0.0;
const double HTMLProgressElement::kDefaultMax = 1.0;
HTMLProgressElement::HTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo)
HTMLProgressElement::HTMLProgressElement(already_AddRefed<nsINodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo)
{
// We start out indeterminate

Просмотреть файл

@ -19,7 +19,7 @@ namespace dom {
class HTMLProgressElement MOZ_FINAL : public nsGenericHTMLElement
{
public:
HTMLProgressElement(already_AddRefed<nsINodeInfo> aNodeInfo);
HTMLProgressElement(already_AddRefed<nsINodeInfo>& aNodeInfo);
virtual ~HTMLProgressElement();
nsEventStates IntrinsicState() const MOZ_OVERRIDE;

Просмотреть файл

@ -34,7 +34,7 @@ HTMLScriptElement::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aScope)
return HTMLScriptElementBinding::Wrap(aCx, aScope, this);
}
HTMLScriptElement::HTMLScriptElement(already_AddRefed<nsINodeInfo> aNodeInfo,
HTMLScriptElement::HTMLScriptElement(already_AddRefed<nsINodeInfo>& aNodeInfo,
FromParser aFromParser)
: nsGenericHTMLElement(aNodeInfo)
, nsScriptElement(aFromParser)
@ -90,9 +90,8 @@ HTMLScriptElement::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
{
*aResult = nullptr;
nsCOMPtr<nsINodeInfo> ni = aNodeInfo;
HTMLScriptElement* it =
new HTMLScriptElement(ni.forget(), NOT_FROM_PARSER);
already_AddRefed<nsINodeInfo> ni = nsCOMPtr<nsINodeInfo>(aNodeInfo).forget();
HTMLScriptElement* it = new HTMLScriptElement(ni, NOT_FROM_PARSER);
nsCOMPtr<nsINode> kungFuDeathGrip = it;
nsresult rv = const_cast<HTMLScriptElement*>(this)->CopyInnerTo(it);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше