Bug 1626436 - Remove nsAutoPtr usage from dom/html. r=mccr8

Differential Revision: https://phabricator.services.mozilla.com/D69106

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Eric Rahm 2020-04-03 21:04:59 +00:00
parent 223ce1e031
commit dc6eb9e628
5 changed files with 14 additions and 14 deletions

View File

@ -14,6 +14,7 @@
#include "mozilla/ContentEvents.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventStates.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/dom/BindContext.h"
#include "mozilla/dom/CustomEvent.h"
#include "mozilla/dom/Document.h"
@ -22,7 +23,6 @@
#include "mozilla/dom/nsCSPContext.h"
#include "mozilla/dom/nsCSPUtils.h"
#include "mozilla/dom/nsMixedContentBlocker.h"
#include "nsAutoPtr.h"
#include "nsCOMArray.h"
#include "nsContentList.h"
#include "nsContentUtils.h"
@ -640,7 +640,7 @@ nsresult HTMLFormElement::DoSubmit(Event* aEvent) {
NS_ASSERTION(!mWebProgress && !mSubmittingRequest,
"Web progress / submitting request should not exist here!");
nsAutoPtr<HTMLFormSubmission> submission;
UniquePtr<HTMLFormSubmission> submission;
//
// prepare the submission object
@ -672,7 +672,7 @@ nsresult HTMLFormElement::DoSubmit(Event* aEvent) {
// we are in an event handler, JS submitted so we have to
// defer this submission. let's remember it and return
// without submitting
mPendingSubmission = submission;
mPendingSubmission = std::move(submission);
// ensure reentrancy
mIsSubmitting = false;
return NS_OK;
@ -681,7 +681,7 @@ nsresult HTMLFormElement::DoSubmit(Event* aEvent) {
//
// perform the submission
//
return SubmitSubmission(submission);
return SubmitSubmission(submission.get());
}
nsresult HTMLFormElement::BuildSubmission(HTMLFormSubmission** aFormSubmission,
@ -1536,11 +1536,11 @@ void HTMLFormElement::OnSubmitClickEnd() { mDeferSubmission = false; }
void HTMLFormElement::FlushPendingSubmission() {
if (mPendingSubmission) {
// Transfer owning reference so that the submissioin doesn't get deleted
// Transfer owning reference so that the submission doesn't get deleted
// if we reenter
nsAutoPtr<HTMLFormSubmission> submission = std::move(mPendingSubmission);
UniquePtr<HTMLFormSubmission> submission = std::move(mPendingSubmission);
SubmitSubmission(submission);
SubmitSubmission(submission.get());
}
}

View File

@ -9,7 +9,7 @@
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/Attributes.h"
#include "nsAutoPtr.h"
#include "mozilla/UniquePtr.h"
#include "nsCOMPtr.h"
#include "nsIForm.h"
#include "nsIFormControl.h"
@ -562,7 +562,7 @@ class HTMLFormElement final : public nsGenericHTMLElement,
mValueMissingRadioGroups;
/** The pending submission object */
nsAutoPtr<HTMLFormSubmission> mPendingSubmission;
UniquePtr<HTMLFormSubmission> mPendingSubmission;
/** The request currently being submitted */
nsCOMPtr<nsIRequest> mSubmittingRequest;
/** The web progress object we are currently listening to */

View File

@ -2137,7 +2137,7 @@ void HTMLInputElement::OpenDateTimePicker(const DateTimeValue& aInitialValue) {
return;
}
mDateTimeInputBoxValue = new DateTimeValue(aInitialValue);
mDateTimeInputBoxValue = MakeUnique<DateTimeValue>(aInitialValue);
nsContentUtils::DispatchChromeEvent(
OwnerDoc(), static_cast<Element*>(this),
NS_LITERAL_STRING("MozOpenDateTimePicker"), CanBubble::eYes,
@ -2149,7 +2149,7 @@ void HTMLInputElement::UpdateDateTimePicker(const DateTimeValue& aValue) {
return;
}
mDateTimeInputBoxValue = new DateTimeValue(aValue);
mDateTimeInputBoxValue = MakeUnique<DateTimeValue>(aValue);
nsContentUtils::DispatchChromeEvent(
OwnerDoc(), static_cast<Element*>(this),
NS_LITERAL_STRING("MozUpdateDateTimePicker"), CanBubble::eYes,
@ -3585,7 +3585,8 @@ static bool IgnoreInputEventWithModifier(const WidgetInputEvent& aEvent,
aEvent.IsFn() || aEvent.IsOS();
}
bool HTMLInputElement::StepsInputValue(const WidgetKeyboardEvent& aEvent) const {
bool HTMLInputElement::StepsInputValue(
const WidgetKeyboardEvent& aEvent) const {
if (mType != NS_FORM_INPUT_NUMBER) {
return false;
}

View File

@ -1482,7 +1482,7 @@ class HTMLInputElement final : public TextControlElement,
* Current value in the input box, in DateTimeValue dictionary format, see
* HTMLInputElement.webidl for details.
*/
nsAutoPtr<DateTimeValue> mDateTimeInputBoxValue;
UniquePtr<DateTimeValue> mDateTimeInputBoxValue;
/**
* The triggering principal for the src attribute.

View File

@ -6,7 +6,6 @@
#ifndef mozilla_dom_HTMLMediaElement_h
#define mozilla_dom_HTMLMediaElement_h
#include "nsAutoPtr.h"
#include "nsGenericHTMLElement.h"
#include "AudioChannelService.h"
#include "MediaEventSource.h"