Bug 1036055 - Make the destructor of HTMLFormElement private. r=smaug

This commit is contained in:
Andrew McCreight 2014-08-01 10:02:30 -07:00
Родитель b471b6fa7f
Коммит 1d40e119c2
2 изменённых файлов: 6 добавлений и 33 удалений

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

@ -64,21 +64,7 @@
#include "mozilla/dom/HTMLImageElement.h"
// construction, destruction
nsGenericHTMLElement*
NS_NewHTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
mozilla::dom::FromParser aFromParser)
{
mozilla::dom::HTMLFormElement* it = new mozilla::dom::HTMLFormElement(aNodeInfo);
nsresult rv = it->Init();
if (NS_FAILED(rv)) {
delete it;
return nullptr;
}
return it;
}
NS_IMPL_NS_NEW_HTML_ELEMENT(Form)
namespace mozilla {
namespace dom {
@ -99,6 +85,7 @@ bool HTMLFormElement::gPasswordManagerInitialized = false;
HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mControls(new HTMLFormControlsCollection(MOZ_THIS_IN_INITIALIZER_LIST())),
mSelectedRadioButtons(4),
mRequiredRadioButtonCounts(4),
mValueMissingRadioGroups(4),
@ -131,14 +118,6 @@ HTMLFormElement::~HTMLFormElement()
Clear();
}
nsresult
HTMLFormElement::Init()
{
mControls = new HTMLFormControlsCollection(this);
return NS_OK;
}
// nsISupports
static PLDHashOperator
@ -191,7 +170,7 @@ NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
// nsIDOMHTMLFormElement
NS_IMPL_ELEMENT_CLONE_WITH_INIT(HTMLFormElement)
NS_IMPL_ELEMENT_CLONE(HTMLFormElement)
nsIHTMLCollection*
HTMLFormElement::Elements()

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

@ -43,9 +43,6 @@ class HTMLFormElement MOZ_FINAL : public nsGenericHTMLElement,
public:
HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo);
virtual ~HTMLFormElement();
nsresult Init();
enum {
FORM_CONTROL_LIST_HASHTABLE_SIZE = 16
@ -630,16 +627,13 @@ protected:
static bool gFirstFormSubmitted;
/** Detection of first password input to initialize the password manager */
static bool gPasswordManagerInitialized;
private:
~HTMLFormElement();
};
} // namespace dom
template<>
struct HasDangerousPublicDestructor<dom::HTMLFormElement>
{
static const bool value = true;
};
} // namespace mozilla
#endif // mozilla_dom_HTMLFormElement_h