зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE
This commit is contained in:
Родитель
a8af57b293
Коммит
91aa0518dd
|
@ -398,7 +398,7 @@ bool nsAccessiblePivot::IsDescendantOf(Accessible* aAccessible,
|
|||
bool nsAccessiblePivot::MovePivotInternal(Accessible* aPosition,
|
||||
PivotMoveReason aReason,
|
||||
bool aIsFromUserInput) {
|
||||
RefPtr<Accessible> oldPosition = std::move(mPosition);
|
||||
RefPtr<Accessible> oldPosition = mPosition.forget();
|
||||
mPosition = aPosition;
|
||||
int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
|
||||
mStartOffset = mEndOffset = -1;
|
||||
|
|
|
@ -1562,7 +1562,7 @@ bool IPDLParamTraits<dom::BrowsingContext*>::Read(
|
|||
browsingContext.get()->Release();
|
||||
}
|
||||
|
||||
*aResult = std::move(browsingContext);
|
||||
*aResult = browsingContext.forget();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -490,7 +490,7 @@ CanonicalBrowsingContext::ChangeFrameRemoteness(const nsAString& aRemoteType,
|
|||
change->Complete(aContentParent);
|
||||
},
|
||||
[change](nsresult aRv) { change->Cancel(aRv); });
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<Promise> CanonicalBrowsingContext::ChangeFrameRemoteness(
|
||||
|
|
|
@ -214,7 +214,7 @@ bool IPDLParamTraits<dom::WindowContext*>::Read(
|
|||
windowContext.get()->Release();
|
||||
}
|
||||
|
||||
*aResult = std::move(windowContext);
|
||||
*aResult = windowContext.forget();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -428,7 +428,7 @@ nsDefaultURIFixup::KeywordToURI(const nsACString& aKeyword,
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIURI> temp = DeserializeURI(uri);
|
||||
info->mPreferredURI = std::move(temp);
|
||||
info->mPreferredURI = temp.forget();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ nsDocShellEditorData::~nsDocShellEditorData() { TearDownEditor(); }
|
|||
|
||||
void nsDocShellEditorData::TearDownEditor() {
|
||||
if (mHTMLEditor) {
|
||||
RefPtr<HTMLEditor> htmlEditor = std::move(mHTMLEditor);
|
||||
RefPtr<HTMLEditor> htmlEditor = mHTMLEditor.forget();
|
||||
htmlEditor->PreDestroy(false);
|
||||
}
|
||||
mEditingSession = nullptr;
|
||||
|
@ -43,7 +43,7 @@ nsresult nsDocShellEditorData::MakeEditable(bool aInWaitForUriLoad) {
|
|||
if (mHTMLEditor) {
|
||||
NS_WARNING("Destroying existing editor on frame");
|
||||
|
||||
RefPtr<HTMLEditor> htmlEditor = std::move(mHTMLEditor);
|
||||
RefPtr<HTMLEditor> htmlEditor = mHTMLEditor.forget();
|
||||
htmlEditor->PreDestroy(false);
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ nsresult nsDocShellEditorData::SetHTMLEditor(HTMLEditor* aHTMLEditor) {
|
|||
}
|
||||
|
||||
if (mHTMLEditor) {
|
||||
RefPtr<HTMLEditor> htmlEditor = std::move(mHTMLEditor);
|
||||
RefPtr<HTMLEditor> htmlEditor = mHTMLEditor.forget();
|
||||
htmlEditor->PreDestroy(false);
|
||||
MOZ_ASSERT(!mHTMLEditor,
|
||||
"Nested call of nsDocShellEditorData::SetHTMLEditor() detected");
|
||||
|
|
|
@ -88,7 +88,7 @@ bool IPDLParamTraits<dom::CrossProcessSHEntry*>::Read(
|
|||
newEntry.mSharedID);
|
||||
dom::ContentChild::GetSingleton()->BindPSHEntryEndpoint(
|
||||
std::move(newEntry.mEndpoint), do_AddRef(entry).take());
|
||||
*aEntry = std::move(entry);
|
||||
*aEntry = entry.forget();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -232,7 +232,7 @@ bool SHistoryParent::RecvFindEntryForBFCache(
|
|||
*aEntry = nullptr;
|
||||
*aIndex = -1;
|
||||
} else {
|
||||
*aEntry = std::move(shEntry);
|
||||
*aEntry = shEntry.forget();
|
||||
*aIndex = i;
|
||||
}
|
||||
|
||||
|
|
|
@ -1580,7 +1580,7 @@ nsresult nsSHistory::InitiateLoad(nsISHEntry* aFrameEntry,
|
|||
nsCOMPtr<nsIContentSecurityPolicy> csp = aFrameEntry->GetCsp();
|
||||
loadState->SetCsp(csp);
|
||||
|
||||
aLoadResult.mLoadState = std::move(loadState);
|
||||
aLoadResult.mLoadState = loadState.forget();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1727,7 +1727,7 @@ void Animation::DoFinishNotification(SyncNotifyFlag aSyncNotifyFlag) {
|
|||
} else if (!mFinishNotificationTask) {
|
||||
RefPtr<MicroTaskRunnable> runnable = new AsyncFinishNotification(this);
|
||||
context->DispatchToMicroTask(do_AddRef(runnable));
|
||||
mFinishNotificationTask = std::move(runnable);
|
||||
mFinishNotificationTask = runnable.forget();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -641,7 +641,7 @@ void BodyConsumer::ContinueConsumeBody(nsresult aStatus, uint32_t aResultLength,
|
|||
mBodyConsumed = true;
|
||||
|
||||
MOZ_ASSERT(mConsumePromise);
|
||||
RefPtr<Promise> localPromise = std::move(mConsumePromise);
|
||||
RefPtr<Promise> localPromise = mConsumePromise.forget();
|
||||
|
||||
RefPtr<BodyConsumer> self = this;
|
||||
auto autoReleaseObject =
|
||||
|
@ -751,7 +751,7 @@ void BodyConsumer::ContinueConsumeBlobBody(BlobImpl* aBlobImpl,
|
|||
mBodyConsumed = true;
|
||||
|
||||
MOZ_ASSERT(mConsumePromise);
|
||||
RefPtr<Promise> localPromise = std::move(mConsumePromise);
|
||||
RefPtr<Promise> localPromise = mConsumePromise.forget();
|
||||
|
||||
if (!aShuttingDown) {
|
||||
RefPtr<dom::Blob> blob = dom::Blob::Create(mGlobal, aBlobImpl);
|
||||
|
|
|
@ -121,7 +121,7 @@ void BodyStream::Create(JSContext* aCx, BodyStreamHolder* aStreamHolder,
|
|||
// Note, this will create a ref-cycle between the holder and the stream.
|
||||
// The cycle is broken when the stream is closed or the worker begins
|
||||
// shutting down.
|
||||
stream->mWorkerRef = std::move(workerRef);
|
||||
stream->mWorkerRef = workerRef.forget();
|
||||
}
|
||||
|
||||
aRv.MightThrowJSException();
|
||||
|
|
|
@ -337,7 +337,7 @@ class IdleDispatchRunnable final : public IdleRunnable,
|
|||
RefPtr<IdleDeadline> idleDeadline =
|
||||
new IdleDeadline(mParent, mTimedOut, deadline.ToMilliseconds());
|
||||
|
||||
RefPtr<IdleRequestCallback> callback(std::move(mCallback));
|
||||
RefPtr<IdleRequestCallback> callback(mCallback.forget());
|
||||
MOZ_ASSERT(!mCallback);
|
||||
callback->Call(*idleDeadline, "ChromeUtils::IdleDispatch handler");
|
||||
mParent = nullptr;
|
||||
|
|
|
@ -5985,7 +5985,7 @@ Result<nsCOMPtr<nsIURI>, nsresult> Document::ResolveWithBaseURI(
|
|||
nsCOMPtr<nsIURI> resolvedURI;
|
||||
MOZ_TRY(
|
||||
NS_NewURI(getter_AddRefs(resolvedURI), aURI, nullptr, GetDocBaseURI()));
|
||||
return resolvedURI;
|
||||
return std::move(resolvedURI);
|
||||
}
|
||||
|
||||
URLExtraData* Document::DefaultStyleAttrURLData() {
|
||||
|
@ -8706,7 +8706,7 @@ mozilla::dom::Nullable<mozilla::dom::WindowProxyHolder> Document::Open(
|
|||
if (!newBC) {
|
||||
return nullptr;
|
||||
}
|
||||
return WindowProxyHolder(std::move(newBC));
|
||||
return WindowProxyHolder(newBC.forget());
|
||||
}
|
||||
|
||||
Document* Document::Open(const Optional<nsAString>& /* unused */,
|
||||
|
@ -8866,7 +8866,7 @@ Document* Document::Open(const Optional<nsAString>& /* unused */,
|
|||
aError.Throw(rv);
|
||||
return nullptr;
|
||||
}
|
||||
newURI = std::move(noFragmentURI);
|
||||
newURI = noFragmentURI.forget();
|
||||
}
|
||||
|
||||
// UpdateURLAndHistory might do various member-setting, so make sure we're
|
||||
|
@ -11694,7 +11694,7 @@ static already_AddRefed<nsPIDOMWindowOuter> FindTopWindowForElement(
|
|||
|
||||
// Trying to find the top window (equivalent to window.top).
|
||||
if (nsCOMPtr<nsPIDOMWindowOuter> top = window->GetInProcessTop()) {
|
||||
window = std::move(top);
|
||||
window = top.forget();
|
||||
}
|
||||
return window.forget();
|
||||
}
|
||||
|
@ -11705,11 +11705,11 @@ static already_AddRefed<nsPIDOMWindowOuter> FindTopWindowForElement(
|
|||
*/
|
||||
class nsAutoFocusEvent : public Runnable {
|
||||
public:
|
||||
explicit nsAutoFocusEvent(nsCOMPtr<Element>&& aElement,
|
||||
nsCOMPtr<nsPIDOMWindowOuter>&& aTopWindow)
|
||||
explicit nsAutoFocusEvent(already_AddRefed<Element>&& aElement,
|
||||
already_AddRefed<nsPIDOMWindowOuter>&& aTopWindow)
|
||||
: mozilla::Runnable("nsAutoFocusEvent"),
|
||||
mElement(std::move(aElement)),
|
||||
mTopWindow(std::move(aTopWindow)) {}
|
||||
mElement(aElement),
|
||||
mTopWindow(aTopWindow) {}
|
||||
|
||||
NS_IMETHOD Run() override {
|
||||
nsCOMPtr<nsPIDOMWindowOuter> currentTopWindow =
|
||||
|
@ -11782,7 +11782,7 @@ void Document::TriggerAutoFocus() {
|
|||
}
|
||||
|
||||
nsCOMPtr<nsIRunnable> event =
|
||||
new nsAutoFocusEvent(std::move(autoFocusElement), topWindow.forget());
|
||||
new nsAutoFocusEvent(autoFocusElement.forget(), topWindow.forget());
|
||||
nsresult rv = NS_DispatchToCurrentThread(event.forget());
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
}
|
||||
|
@ -12874,7 +12874,7 @@ class PendingFullscreenChangeList {
|
|||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
mRootShellForIteration->GetInProcessRootTreeItem(
|
||||
getter_AddRefs(root));
|
||||
mRootShellForIteration = std::move(root);
|
||||
mRootShellForIteration = root.forget();
|
||||
}
|
||||
SkipToNextMatch();
|
||||
}
|
||||
|
@ -12909,7 +12909,7 @@ class PendingFullscreenChangeList {
|
|||
while (docShell && docShell != mRootShellForIteration) {
|
||||
nsCOMPtr<nsIDocShellTreeItem> parent;
|
||||
docShell->GetInProcessParent(getter_AddRefs(parent));
|
||||
docShell = std::move(parent);
|
||||
docShell = parent.forget();
|
||||
}
|
||||
if (docShell) {
|
||||
break;
|
||||
|
@ -15672,7 +15672,7 @@ already_AddRefed<mozilla::dom::Promise> Document::RequestStorageAccess(
|
|||
ContentPermissionRequestBase::DelayedTaskType::Request);
|
||||
});
|
||||
|
||||
return std::move(p);
|
||||
return p.forget();
|
||||
};
|
||||
AntiTrackingCommon::AddFirstPartyStorageAccessGrantedFor(
|
||||
NodePrincipal(), inner, AntiTrackingCommon::eStorageAccessAPI,
|
||||
|
@ -15968,7 +15968,7 @@ void Document::RecomputeLanguageFromCharset() {
|
|||
}
|
||||
|
||||
mMayNeedFontPrefsUpdate = true;
|
||||
mLanguageFromCharset = std::move(language);
|
||||
mLanguageFromCharset = language.forget();
|
||||
}
|
||||
|
||||
nsICookieSettings* Document::CookieSettings() {
|
||||
|
|
|
@ -57,7 +57,7 @@ void IdleRequest::IdleRun(nsPIDOMWindowInner* aWindow,
|
|||
|
||||
RefPtr<IdleDeadline> deadline =
|
||||
new IdleDeadline(aWindow, aDidTimeout, aDeadline);
|
||||
RefPtr<IdleRequestCallback> callback(std::move(mCallback));
|
||||
RefPtr<IdleRequestCallback> callback(mCallback.forget());
|
||||
MOZ_ASSERT(!mCallback);
|
||||
callback->Call(*deadline, "requestIdleCallback handler");
|
||||
}
|
||||
|
|
|
@ -99,7 +99,7 @@ class EncodingCompleteEvent : public CancelableRunnable {
|
|||
nsresult rv = NS_OK;
|
||||
|
||||
// We want to null out mEncodeCompleteCallback no matter what.
|
||||
RefPtr<EncodeCompleteCallback> callback(std::move(mEncodeCompleteCallback));
|
||||
RefPtr<EncodeCompleteCallback> callback(mEncodeCompleteCallback.forget());
|
||||
if (!mFailed) {
|
||||
RefPtr<BlobImpl> blobImpl = new MemoryBlobImpl(mImgData, mImgSize, mType);
|
||||
rv = callback->ReceiveBlobImpl(blobImpl.forget());
|
||||
|
|
|
@ -69,7 +69,7 @@ PostMessageEvent::Run() {
|
|||
// The document URI is just used for the principal mismatch error message
|
||||
// below. Use a stack variable so mCallerURI is not held onto after
|
||||
// this method finishes, regardless of the method outcome.
|
||||
nsCOMPtr<nsIURI> callerURI = std::move(mCallerURI);
|
||||
nsCOMPtr<nsIURI> callerURI = mCallerURI.forget();
|
||||
|
||||
// If we bailed before this point we're going to leak mMessage, but
|
||||
// that's probably better than crashing.
|
||||
|
|
|
@ -134,7 +134,7 @@ already_AddRefed<ResizeObserver> ResizeObserver::Constructor(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
return do_AddRef(new ResizeObserver(std::move(window), doc, aCb));
|
||||
return do_AddRef(new ResizeObserver(window.forget(), doc, aCb));
|
||||
}
|
||||
|
||||
void ResizeObserver::Observe(Element& aTarget,
|
||||
|
@ -306,7 +306,7 @@ void ResizeObserverEntry::SetContentRectAndSize(const nsSize& aSize) {
|
|||
nsRect rect(nsPoint(padding.left, padding.top), aSize);
|
||||
RefPtr<DOMRect> contentRect = new DOMRect(this);
|
||||
contentRect->SetLayoutRect(rect);
|
||||
mContentRect = std::move(contentRect);
|
||||
mContentRect = contentRect.forget();
|
||||
|
||||
// 2. Update mContentBoxSize.
|
||||
const WritingMode wm = frame ? frame->GetWritingMode() : WritingMode();
|
||||
|
|
|
@ -88,9 +88,9 @@ class ResizeObserver final : public nsISupports, public nsWrapperCache {
|
|||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ResizeObserver)
|
||||
|
||||
ResizeObserver(nsCOMPtr<nsPIDOMWindowInner>&& aOwner, Document* aDocument,
|
||||
ResizeObserverCallback& aCb)
|
||||
: mOwner(std::move(aOwner)), mDocument(aDocument), mCallback(&aCb) {
|
||||
ResizeObserver(already_AddRefed<nsPIDOMWindowInner>&& aOwner,
|
||||
Document* aDocument, ResizeObserverCallback& aCb)
|
||||
: mOwner(aOwner), mDocument(aDocument), mCallback(&aCb) {
|
||||
MOZ_ASSERT(mOwner, "Need a non-null owner window");
|
||||
MOZ_ASSERT(mDocument, "Need a non-null doc");
|
||||
MOZ_ASSERT(mDocument == mOwner->GetExtantDoc());
|
||||
|
|
|
@ -138,7 +138,7 @@ void SelectionChangeEventDispatcher::OnSelectionChange(Document* aDoc,
|
|||
root = root->GetParent();
|
||||
}
|
||||
|
||||
target = std::move(root);
|
||||
target = root.forget();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ bool WindowNamedPropertiesHandler::getOwnPropDescriptor(
|
|||
// global scope is still allowed, since |var| only looks up |own|
|
||||
// properties. But unqualified shadowing will fail, per-spec.
|
||||
JS::Rooted<JS::Value> v(aCx);
|
||||
if (!ToJSValue(aCx, WindowProxyHolder(std::move(child)), &v)) {
|
||||
if (!ToJSValue(aCx, WindowProxyHolder(child.forget()), &v)) {
|
||||
return false;
|
||||
}
|
||||
FillPropertyDescriptor(aDesc, aProxy, 0, v);
|
||||
|
|
|
@ -33,7 +33,7 @@ class WindowProxyHolder {
|
|||
explicit WindowProxyHolder(BrowsingContext* aBC) : mBrowsingContext(aBC) {
|
||||
MOZ_ASSERT(mBrowsingContext, "Don't set WindowProxyHolder to null.");
|
||||
}
|
||||
explicit WindowProxyHolder(RefPtr<BrowsingContext>&& aBC)
|
||||
explicit WindowProxyHolder(already_AddRefed<BrowsingContext>&& aBC)
|
||||
: mBrowsingContext(std::move(aBC)) {
|
||||
MOZ_ASSERT(mBrowsingContext, "Don't set WindowProxyHolder to null.");
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class WindowProxyHolder {
|
|||
MOZ_ASSERT(mBrowsingContext, "Don't set WindowProxyHolder to null.");
|
||||
return *this;
|
||||
}
|
||||
WindowProxyHolder& operator=(RefPtr<BrowsingContext>&& aBC) {
|
||||
WindowProxyHolder& operator=(already_AddRefed<BrowsingContext>&& aBC) {
|
||||
mBrowsingContext = std::move(aBC);
|
||||
MOZ_ASSERT(mBrowsingContext, "Don't set WindowProxyHolder to null.");
|
||||
return *this;
|
||||
|
|
|
@ -1412,8 +1412,7 @@ void nsContentSink::DropParserAndPerfHint(void) {
|
|||
// actually broken.
|
||||
// Drop our reference to the parser to get rid of a circular
|
||||
// reference.
|
||||
RefPtr<nsParserBase> kungFuDeathGrip = std::move(mParser);
|
||||
mozilla::Unused << kungFuDeathGrip;
|
||||
RefPtr<nsParserBase> kungFuDeathGrip(mParser.forget());
|
||||
|
||||
if (mDynamicLowerValue) {
|
||||
// Reset the performance hint which was set to FALSE
|
||||
|
|
|
@ -702,7 +702,7 @@ void nsDOMMutationObserver::TakeRecords(
|
|||
current->mNext.swap(next);
|
||||
if (!mMergeAttributeRecords ||
|
||||
!MergeableAttributeRecord(aRetVal.SafeLastElement(nullptr), current)) {
|
||||
*aRetVal.AppendElement() = std::move(current);
|
||||
*aRetVal.AppendElement() = current.forget();
|
||||
}
|
||||
current.swap(next);
|
||||
}
|
||||
|
@ -755,7 +755,7 @@ already_AddRefed<nsDOMMutationObserver> nsDOMMutationObserver::Constructor(
|
|||
}
|
||||
bool isChrome = nsContentUtils::IsChromeDoc(window->GetExtantDoc());
|
||||
RefPtr<nsDOMMutationObserver> observer =
|
||||
new nsDOMMutationObserver(std::move(window), aCb, isChrome);
|
||||
new nsDOMMutationObserver(window.forget(), aCb, isChrome);
|
||||
return observer.forget();
|
||||
}
|
||||
|
||||
|
|
|
@ -432,9 +432,9 @@ class nsAnimationReceiver : public nsMutationReceiver {
|
|||
|
||||
class nsDOMMutationObserver final : public nsISupports, public nsWrapperCache {
|
||||
public:
|
||||
nsDOMMutationObserver(nsCOMPtr<nsPIDOMWindowInner>&& aOwner,
|
||||
nsDOMMutationObserver(already_AddRefed<nsPIDOMWindowInner>&& aOwner,
|
||||
mozilla::dom::MutationCallback& aCb, bool aChrome)
|
||||
: mOwner(std::move(aOwner)),
|
||||
: mOwner(aOwner),
|
||||
mLastPendingMutation(nullptr),
|
||||
mPendingMutationCount(0),
|
||||
mCallback(&aCb),
|
||||
|
@ -490,11 +490,11 @@ class nsDOMMutationObserver final : public nsISupports, public nsWrapperCache {
|
|||
MOZ_ASSERT(record);
|
||||
if (!mLastPendingMutation) {
|
||||
MOZ_ASSERT(!mFirstPendingMutation);
|
||||
mFirstPendingMutation = std::move(record);
|
||||
mFirstPendingMutation = record.forget();
|
||||
mLastPendingMutation = mFirstPendingMutation;
|
||||
} else {
|
||||
MOZ_ASSERT(mFirstPendingMutation);
|
||||
mLastPendingMutation->mNext = std::move(record);
|
||||
mLastPendingMutation->mNext = record.forget();
|
||||
mLastPendingMutation = mLastPendingMutation->mNext;
|
||||
}
|
||||
++mPendingMutationCount;
|
||||
|
@ -503,11 +503,11 @@ class nsDOMMutationObserver final : public nsISupports, public nsWrapperCache {
|
|||
void ClearPendingRecords() {
|
||||
// Break down the pending mutation record list so that cycle collector
|
||||
// can delete the objects sooner.
|
||||
RefPtr<nsDOMMutationRecord> current = std::move(mFirstPendingMutation);
|
||||
RefPtr<nsDOMMutationRecord> current = mFirstPendingMutation.forget();
|
||||
mLastPendingMutation = nullptr;
|
||||
mPendingMutationCount = 0;
|
||||
while (current) {
|
||||
current = std::move(current->mNext);
|
||||
current = current->mNext.forget();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -630,11 +630,11 @@ bool mozilla::ipc::IPDLParamTraits<nsDOMNavigationTiming*>::Read(
|
|||
}
|
||||
timing->mNavigationType = nsDOMNavigationTiming::Type(type);
|
||||
if (unloadedURI) {
|
||||
timing->mUnloadedURI = std::move(*unloadedURI);
|
||||
timing->mUnloadedURI = unloadedURI->forget();
|
||||
}
|
||||
if (loadedURI) {
|
||||
timing->mLoadedURI = std::move(*loadedURI);
|
||||
timing->mLoadedURI = loadedURI->forget();
|
||||
}
|
||||
*aResult = std::move(timing);
|
||||
*aResult = timing.forget();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -903,7 +903,7 @@ nsFocusManager::WindowHidden(mozIDOMWindowProxy* aWindow) {
|
|||
// window, or an ancestor of the focused window. Either way, the focus is no
|
||||
// longer valid, so it needs to be updated.
|
||||
|
||||
RefPtr<Element> oldFocusedElement = std::move(mFocusedElement);
|
||||
RefPtr<Element> oldFocusedElement = mFocusedElement.forget();
|
||||
|
||||
nsCOMPtr<nsIDocShell> focusedDocShell = mFocusedWindow->GetDocShell();
|
||||
RefPtr<PresShell> presShell = focusedDocShell->GetPresShell();
|
||||
|
|
|
@ -5497,7 +5497,7 @@ RefPtr<ServiceWorker> nsGlobalWindowInner::GetOrCreateServiceWorker(
|
|||
return;
|
||||
}
|
||||
|
||||
ref = std::move(sw);
|
||||
ref = sw.forget();
|
||||
*aDoneOut = true;
|
||||
});
|
||||
|
||||
|
@ -5505,7 +5505,7 @@ RefPtr<ServiceWorker> nsGlobalWindowInner::GetOrCreateServiceWorker(
|
|||
ref = ServiceWorker::Create(this, aDescriptor);
|
||||
}
|
||||
|
||||
return ref;
|
||||
return ref.forget();
|
||||
}
|
||||
|
||||
RefPtr<mozilla::dom::ServiceWorkerRegistration>
|
||||
|
@ -5520,10 +5520,10 @@ nsGlobalWindowInner::GetServiceWorkerRegistration(
|
|||
return;
|
||||
}
|
||||
|
||||
ref = std::move(swr);
|
||||
ref = swr.forget();
|
||||
*aDoneOut = true;
|
||||
});
|
||||
return ref;
|
||||
return ref.forget();
|
||||
}
|
||||
|
||||
RefPtr<ServiceWorkerRegistration>
|
||||
|
@ -5535,7 +5535,7 @@ nsGlobalWindowInner::GetOrCreateServiceWorkerRegistration(
|
|||
if (!ref) {
|
||||
ref = ServiceWorkerRegistration::CreateForMainThread(this, aDescriptor);
|
||||
}
|
||||
return ref;
|
||||
return ref.forget();
|
||||
}
|
||||
|
||||
nsresult nsGlobalWindowInner::FireDelayedDOMEvents() {
|
||||
|
@ -6876,7 +6876,7 @@ void nsGlobalWindowInner::GetSidebar(OwningExternalOrWindowProxy& aResult,
|
|||
RefPtr<BrowsingContext> domWindow =
|
||||
GetChildWindow(NS_LITERAL_STRING("sidebar"));
|
||||
if (domWindow) {
|
||||
aResult.SetAsWindowProxy() = std::move(domWindow);
|
||||
aResult.SetAsWindowProxy() = domWindow.forget();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -3218,7 +3218,7 @@ nsPIDOMWindowOuter* nsGlobalWindowOuter::GetSameProcessOpener() {
|
|||
|
||||
Nullable<WindowProxyHolder> nsGlobalWindowOuter::GetOpenerWindowOuter() {
|
||||
if (RefPtr<BrowsingContext> opener = GetOpenerBrowsingContext()) {
|
||||
return WindowProxyHolder(std::move(opener));
|
||||
return WindowProxyHolder(opener.forget());
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -5442,7 +5442,7 @@ Nullable<WindowProxyHolder> nsGlobalWindowOuter::OpenOuter(
|
|||
if (!bc) {
|
||||
return nullptr;
|
||||
}
|
||||
return WindowProxyHolder(std::move(bc));
|
||||
return WindowProxyHolder(bc.forget());
|
||||
}
|
||||
|
||||
nsresult nsGlobalWindowOuter::Open(const nsAString& aUrl,
|
||||
|
@ -5540,7 +5540,7 @@ Nullable<WindowProxyHolder> nsGlobalWindowOuter::OpenDialogOuter(
|
|||
if (!dialog) {
|
||||
return nullptr;
|
||||
}
|
||||
return WindowProxyHolder(std::move(dialog));
|
||||
return WindowProxyHolder(dialog.forget());
|
||||
}
|
||||
|
||||
WindowProxyHolder nsGlobalWindowOuter::GetFramesOuter() {
|
||||
|
|
|
@ -1628,10 +1628,10 @@ void nsINode::DisconnectChild(nsIContent* aKid) {
|
|||
aKid->mPreviousOrLastSibling = nullptr;
|
||||
|
||||
if (previousSibling) {
|
||||
previousSibling->mNextSibling = std::move(aKid->mNextSibling);
|
||||
previousSibling->mNextSibling = aKid->mNextSibling.forget();
|
||||
} else {
|
||||
// aKid is the first child in the list
|
||||
mFirstChild = std::move(aKid->mNextSibling);
|
||||
mFirstChild = aKid->mNextSibling.forget();
|
||||
}
|
||||
|
||||
--mChildCount;
|
||||
|
|
|
@ -3369,7 +3369,7 @@ nsresult UnwrapWindowProxyArg(JSContext* cx, JS::Handle<JSObject*> src,
|
|||
|
||||
nsCOMPtr<nsPIDOMWindowOuter> outer = inner->GetOuterWindow();
|
||||
RefPtr<BrowsingContext> bc = outer ? outer->GetBrowsingContext() : nullptr;
|
||||
ppArg = std::move(bc);
|
||||
ppArg = bc.forget();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ void CacheStreamControlChild::OpenStream(const nsID& aId,
|
|||
SendOpenStream(aId)->Then(
|
||||
GetCurrentThreadSerialEventTarget(), __func__,
|
||||
[aResolver, holder](RefPtr<nsIInputStream>&& aOptionalStream) {
|
||||
aResolver(nsCOMPtr<nsIInputStream>(std::move(aOptionalStream)));
|
||||
aResolver(nsCOMPtr<nsIInputStream>(aOptionalStream.forget()));
|
||||
},
|
||||
[aResolver, holder](ResponseRejectReason&& aReason) {
|
||||
aResolver(nullptr);
|
||||
|
|
|
@ -1337,8 +1337,8 @@ bool CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
|
|||
newTarget->ClearRect(canvasRect);
|
||||
}
|
||||
|
||||
mTarget = std::move(newTarget);
|
||||
mBufferProvider = std::move(newProvider);
|
||||
mTarget = newTarget.forget();
|
||||
mBufferProvider = newProvider.forget();
|
||||
|
||||
RegisterAllocation();
|
||||
|
||||
|
@ -4366,8 +4366,8 @@ CanvasRenderingContext2D::CachedSurfaceFromElement(Element* aElement) {
|
|||
}
|
||||
|
||||
res.mSize = res.mIntrinsicSize = res.mSourceSurface->GetSize();
|
||||
res.mPrincipal = std::move(principal);
|
||||
res.mImageRequest = std::move(imgRequest);
|
||||
res.mPrincipal = principal.forget();
|
||||
res.mImageRequest = imgRequest.forget();
|
||||
res.mIsWriteOnly = CheckWriteOnlySecurity(res.mCORSUsed, res.mPrincipal,
|
||||
res.mHadCrossOriginRedirects);
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ void CanvasRenderingContextHelper::ToBlob(
|
|||
blob = Blob::Create(mGlobal, blobImpl);
|
||||
}
|
||||
|
||||
RefPtr<BlobCallback> callback(std::move(mBlobCallback));
|
||||
RefPtr<BlobCallback> callback(mBlobCallback.forget());
|
||||
ErrorResult rv;
|
||||
|
||||
callback->Call(blob, rv);
|
||||
|
@ -173,7 +173,7 @@ already_AddRefed<nsISupports> CanvasRenderingContextHelper::GetContext(
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
mCurrentContext = std::move(context);
|
||||
mCurrentContext = context.forget();
|
||||
mCurrentContextType = contextType;
|
||||
|
||||
nsresult rv = UpdateContext(aCx, aContextOptions, aRv);
|
||||
|
|
|
@ -121,7 +121,7 @@ RefPtr<GenericErrorResultPromise> ClientHandle::Control(
|
|||
outerPromise->Reject(aResult.get_CopyableErrorResult(), __func__);
|
||||
});
|
||||
|
||||
return outerPromise;
|
||||
return outerPromise.forget();
|
||||
}
|
||||
|
||||
RefPtr<ClientStatePromise> ClientHandle::Focus(CallerType aCallerType) {
|
||||
|
@ -138,7 +138,7 @@ RefPtr<ClientStatePromise> ClientHandle::Focus(CallerType aCallerType) {
|
|||
outerPromise->Reject(aResult.get_CopyableErrorResult(), __func__);
|
||||
});
|
||||
|
||||
return outerPromise;
|
||||
return outerPromise.forget();
|
||||
}
|
||||
|
||||
RefPtr<GenericErrorResultPromise> ClientHandle::PostMessage(
|
||||
|
@ -171,7 +171,7 @@ RefPtr<GenericErrorResultPromise> ClientHandle::PostMessage(
|
|||
outerPromise->Reject(aResult.get_CopyableErrorResult(), __func__);
|
||||
});
|
||||
|
||||
return outerPromise;
|
||||
return outerPromise.forget();
|
||||
}
|
||||
|
||||
RefPtr<GenericPromise> ClientHandle::OnDetach() {
|
||||
|
|
|
@ -195,7 +195,7 @@ RefPtr<ClientOpPromise> ClientManager::StartOp(
|
|||
promise->Reject(rv, __func__);
|
||||
});
|
||||
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -103,7 +103,7 @@ RefPtr<GenericPromise> OnShutdown() {
|
|||
|
||||
MOZ_ALWAYS_SUCCEEDS(SystemGroup::Dispatch(TaskCategory::Other, r.forget()));
|
||||
|
||||
return ref;
|
||||
return ref.forget();
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
@ -310,7 +310,7 @@ RefPtr<ClientOpPromise> ClientManagerService::Navigate(
|
|||
promise->Reject(rv, __func__);
|
||||
}
|
||||
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
@ -472,7 +472,7 @@ RefPtr<ClientOpPromise> ClaimOnMainThread(
|
|||
|
||||
MOZ_ALWAYS_SUCCEEDS(SystemGroup::Dispatch(TaskCategory::Other, r.forget()));
|
||||
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
@ -657,7 +657,7 @@ RefPtr<ClientOpPromise> ClientManagerService::OpenWindow(
|
|||
new OpenWindowRunnable(promise, aArgs, std::move(aSourceProcess));
|
||||
MOZ_ALWAYS_SUCCEEDS(SystemGroup::Dispatch(TaskCategory::Other, r.forget()));
|
||||
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
bool ClientManagerService::HasWindow(
|
||||
|
|
|
@ -284,7 +284,7 @@ RefPtr<ClientOpPromise> ClientNavigateOpChild::DoNavigate(
|
|||
// XXXbz Can we throw something better here?
|
||||
result.Throw(rv);
|
||||
promise->Reject(result, __func__);
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
return promise->Then(
|
||||
|
|
|
@ -460,13 +460,13 @@ RefPtr<ClientOpPromise> ClientOpenWindowInCurrentProcess(
|
|||
|
||||
if (NS_WARN_IF(rv.Failed())) {
|
||||
promise->Reject(rv, __func__);
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(outerWindow);
|
||||
WaitForLoad(aArgs, outerWindow, promise);
|
||||
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -650,7 +650,7 @@ RefPtr<ClientOpPromise> ClientSource::Claim(const ClientClaimArgs& aArgs) {
|
|||
})
|
||||
->Track(*holder);
|
||||
|
||||
return outerPromise;
|
||||
return outerPromise.forget();
|
||||
}
|
||||
|
||||
RefPtr<ClientOpPromise> ClientSource::GetInfoAndState(
|
||||
|
|
|
@ -289,7 +289,7 @@ RefPtr<ClientOpPromise> ClientSourceParent::StartOp(
|
|||
new ClientSourceOpParent(std::move(aArgs), promise);
|
||||
Unused << SendPClientSourceOpConstructor(actor, actor->Args());
|
||||
|
||||
return promise;
|
||||
return promise.forget();
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -27,7 +27,7 @@ AsyncEventDispatcher::AsyncEventDispatcher(EventTarget* aTarget,
|
|||
MOZ_ASSERT(mTarget);
|
||||
RefPtr<Event> event =
|
||||
EventDispatcher::CreateEvent(aTarget, nullptr, &aEvent, EmptyString());
|
||||
mEvent = std::move(event);
|
||||
mEvent = event.forget();
|
||||
mEventType.SetIsVoid(true);
|
||||
NS_ASSERTION(mEvent, "Should never fail to create an event");
|
||||
mEvent->DuplicatePrivateData();
|
||||
|
|
|
@ -209,7 +209,7 @@ class EventListenerManager final : public EventListenerManagerBase {
|
|||
|
||||
Listener(Listener&& aOther)
|
||||
: mListener(std::move(aOther.mListener)),
|
||||
mTypeAtom(std::move(aOther.mTypeAtom)),
|
||||
mTypeAtom(aOther.mTypeAtom.forget()),
|
||||
mEventMessage(aOther.mEventMessage),
|
||||
mListenerType(aOther.mListenerType),
|
||||
mListenerIsHandler(aOther.mListenerIsHandler),
|
||||
|
|
|
@ -3996,7 +3996,7 @@ void EventStateManager::UpdateCursor(nsPresContext* aPresContext,
|
|||
return;
|
||||
}
|
||||
cursor = framecursor->mCursor;
|
||||
container = std::move(customCursor.mContainer);
|
||||
container = customCursor.mContainer.forget();
|
||||
hotspot = Some(customCursor.mHotspot);
|
||||
}
|
||||
|
||||
|
|
|
@ -2079,7 +2079,7 @@ void IMEContentObserver::DocumentObserver::Observe(Document* aDocument) {
|
|||
|
||||
StopObserving();
|
||||
|
||||
mDocument = std::move(newDocument);
|
||||
mDocument = newDocument.forget();
|
||||
mDocument->AddObserver(this);
|
||||
}
|
||||
|
||||
|
@ -2089,10 +2089,10 @@ void IMEContentObserver::DocumentObserver::StopObserving() {
|
|||
}
|
||||
|
||||
// Grab IMEContentObserver which could be destroyed during method calls.
|
||||
RefPtr<IMEContentObserver> observer = std::move(mIMEContentObserver);
|
||||
RefPtr<IMEContentObserver> observer = mIMEContentObserver.forget();
|
||||
|
||||
// Stop observing the document first.
|
||||
RefPtr<Document> document = std::move(mDocument);
|
||||
RefPtr<Document> document = mDocument.forget();
|
||||
document->RemoveObserver(this);
|
||||
|
||||
// Notify IMEContentObserver of ending of document updates if this already
|
||||
|
|
|
@ -279,7 +279,7 @@ AlternativeDataStreamListener::OnStopRequest(nsIRequest* aRequest,
|
|||
|
||||
// Alternative data loading is going to finish, breaking the reference cycle
|
||||
// here by taking the ownership to a loacl variable.
|
||||
RefPtr<FetchDriver> fetchDriver = std::move(mFetchDriver);
|
||||
RefPtr<FetchDriver> fetchDriver = mFetchDriver.forget();
|
||||
|
||||
if (mStatus == AlternativeDataStreamListener::CANCELED) {
|
||||
// do nothing
|
||||
|
@ -1206,7 +1206,7 @@ FetchDriver::OnStopRequest(nsIRequest* aRequest, nsresult aStatusCode) {
|
|||
|
||||
// main data loading is going to finish, breaking the reference cycle.
|
||||
RefPtr<AlternativeDataStreamListener> altDataListener =
|
||||
std::move(mAltDataListener);
|
||||
mAltDataListener.forget();
|
||||
|
||||
// We need to check mObserver, which is nulled by FailWithNetworkError(),
|
||||
// because in the case of "error" redirect mode, aStatusCode may be NS_OK but
|
||||
|
|
|
@ -82,7 +82,7 @@ nsresult FetchStreamReader::Create(JSContext* aCx, nsIGlobalObject* aGlobal,
|
|||
|
||||
// These 2 objects create a ref-cycle here that is broken when the stream is
|
||||
// closed or the worker shutsdown.
|
||||
streamReader->mWorkerRef = std::move(workerRef);
|
||||
streamReader->mWorkerRef = workerRef.forget();
|
||||
}
|
||||
|
||||
pipeIn.forget(aInputStream);
|
||||
|
|
|
@ -273,7 +273,7 @@ class WorkerStreamOwner final {
|
|||
struct Destroyer final : CancelableRunnable {
|
||||
RefPtr<WorkerStreamOwner> mDoomed;
|
||||
|
||||
explicit Destroyer(RefPtr<WorkerStreamOwner>&& aDoomed)
|
||||
explicit Destroyer(already_AddRefed<WorkerStreamOwner>&& aDoomed)
|
||||
: CancelableRunnable("WorkerStreamOwner::Destroyer"),
|
||||
mDoomed(std::move(aDoomed)) {}
|
||||
|
||||
|
@ -332,8 +332,7 @@ class JSStreamConsumer final : public nsIInputStreamCallback {
|
|||
destroyer = new WindowStreamOwner::Destroyer(mWindowStreamOwner.forget());
|
||||
} else {
|
||||
MOZ_DIAGNOSTIC_ASSERT(mWorkerStreamOwner);
|
||||
destroyer =
|
||||
new WorkerStreamOwner::Destroyer(std::move(mWorkerStreamOwner));
|
||||
destroyer = new WorkerStreamOwner::Destroyer(mWorkerStreamOwner.forget());
|
||||
}
|
||||
|
||||
MOZ_ALWAYS_SUCCEEDS(mOwningEventTarget->Dispatch(destroyer.forget()));
|
||||
|
|
|
@ -77,7 +77,7 @@ void StreamBlobImpl::CreateInputStream(nsIInputStream** aStream,
|
|||
}
|
||||
|
||||
if (replacementStream) {
|
||||
mInputStream = std::move(replacementStream);
|
||||
mInputStream = replacementStream.forget();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIInputStream> wrappedStream =
|
||||
|
|
|
@ -1090,7 +1090,7 @@ void BackgroundMutableFileParentBase::Invalidate() {
|
|||
|
||||
if (count) {
|
||||
for (uint32_t index = 0; index < count; index++) {
|
||||
RefPtr<FileHandle> fileHandle = std::move(fileHandles[index]);
|
||||
RefPtr<FileHandle> fileHandle = fileHandles[index].forget();
|
||||
MOZ_ASSERT(fileHandle);
|
||||
|
||||
fileHandle->Invalidate();
|
||||
|
|
|
@ -1674,7 +1674,7 @@ nsresult HTMLFormElement::GetActionURL(nsIURI** aActionURL,
|
|||
nsCOMPtr<nsIURI> upgradedActionURL;
|
||||
rv = NS_GetSecureUpgradedURI(actionURL, getter_AddRefs(upgradedActionURL));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
actionURL = std::move(upgradedActionURL);
|
||||
actionURL = upgradedActionURL.forget();
|
||||
|
||||
// let's log a message to the console that we are upgrading a request
|
||||
nsAutoCString scheme;
|
||||
|
|
|
@ -3050,7 +3050,7 @@ MediaResult HTMLMediaElement::LoadResource() {
|
|||
RefPtr<ChannelLoader> loader = new ChannelLoader;
|
||||
nsresult rv = loader->Load(this);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
mChannelLoader = std::move(loader);
|
||||
mChannelLoader = loader.forget();
|
||||
}
|
||||
return MediaResult(rv, "Failed to load channel");
|
||||
}
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
nsGenericHTMLElement* NS_NewHTMLSlotElement(
|
||||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo,
|
||||
mozilla::dom::FromParser aFromParser) {
|
||||
return new mozilla::dom::HTMLSlotElement(std::move(aNodeInfo));
|
||||
RefPtr<mozilla::dom::NodeInfo> nodeInfo(std::move(aNodeInfo));
|
||||
return new mozilla::dom::HTMLSlotElement(nodeInfo.forget());
|
||||
}
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -525,7 +525,7 @@ nsresult nsHTMLDocument::StartDocumentLoad(const char* aCommand,
|
|||
docShell->GetContentViewer(getter_AddRefs(cv));
|
||||
}
|
||||
if (!cv) {
|
||||
cv = std::move(parentContentViewer);
|
||||
cv = parentContentViewer.forget();
|
||||
}
|
||||
|
||||
nsAutoCString urlSpec;
|
||||
|
|
|
@ -22498,7 +22498,7 @@ TransactionDatabaseOperationBase::TransactionDatabaseOperationBase(
|
|||
RefPtr<TransactionBase> aTransaction)
|
||||
: DatabaseOperationBase(aTransaction->GetLoggingInfo()->Id(),
|
||||
aTransaction->GetLoggingInfo()->NextRequestSN()),
|
||||
mTransaction(std::move(aTransaction)),
|
||||
mTransaction(aTransaction.forget()),
|
||||
mTransactionIsAborted((*mTransaction)->IsAborted()),
|
||||
mTransactionLoggingSerialNumber((*mTransaction)->LoggingSerialNumber()) {
|
||||
MOZ_ASSERT(LoggingSerialNumber());
|
||||
|
@ -22508,7 +22508,7 @@ TransactionDatabaseOperationBase::TransactionDatabaseOperationBase(
|
|||
RefPtr<TransactionBase> aTransaction, uint64_t aLoggingSerialNumber)
|
||||
: DatabaseOperationBase(aTransaction->GetLoggingInfo()->Id(),
|
||||
aLoggingSerialNumber),
|
||||
mTransaction(std::move(aTransaction)),
|
||||
mTransaction(aTransaction.forget()),
|
||||
mTransactionIsAborted((*mTransaction)->IsAborted()),
|
||||
mTransactionLoggingSerialNumber((*mTransaction)->LoggingSerialNumber()) {}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ nsresult BrowserBridgeParent::InitWithProcess(
|
|||
}
|
||||
|
||||
// Set our BrowserParent object to the newly created browser.
|
||||
mBrowserParent = std::move(browserParent);
|
||||
mBrowserParent = browserParent.forget();
|
||||
mBrowserParent->SetOwnerElement(Manager()->GetOwnerElement());
|
||||
mBrowserParent->InitRendering();
|
||||
|
||||
|
|
|
@ -3825,7 +3825,7 @@ NS_IMETHODIMP BrowserChild::OnSecurityChange(nsIWebProgress* aWebProgress,
|
|||
}
|
||||
|
||||
securityChangeData.emplace();
|
||||
securityChangeData->securityInfo() = ToRefPtr(std::move(securityInfo));
|
||||
securityChangeData->securityInfo() = securityInfo.forget();
|
||||
securityChangeData->isSecureContext() = isSecureContext;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ bool ParamTraits<nsIContentSecurityPolicy*>::Read(
|
|||
nsCOMPtr<nsIContentSecurityPolicy> csp = do_QueryInterface(iSupports);
|
||||
NS_ENSURE_TRUE(csp, false);
|
||||
|
||||
*aResult = ToRefPtr(std::move(csp));
|
||||
*aResult = csp.forget();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ void ClonedErrorHolder::Init(JSContext* aCx, JS::Handle<JSObject*> aError,
|
|||
if (NS_SUCCEEDED(UNWRAP_OBJECT(DOMException, aError, domExn))) {
|
||||
mType = Type::DOMException;
|
||||
mCode = domExn->Code();
|
||||
exn = std::move(domExn);
|
||||
exn = domExn.forget();
|
||||
} else if (NS_SUCCEEDED(UNWRAP_OBJECT(Exception, aError, exn))) {
|
||||
mType = Type::Exception;
|
||||
} else {
|
||||
|
|
|
@ -55,7 +55,7 @@ struct IPDLParamTraits<nsIPrincipal*> {
|
|||
if (!Read(aMsg, aIter, aActor, &result)) {
|
||||
return false;
|
||||
}
|
||||
*aResult = std::move(result);
|
||||
*aResult = result.forget();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -202,7 +202,7 @@ bool IPDLParamTraits<nsIVariant*>::Read(const Message* aMsg,
|
|||
MOZ_CRASH("Non handled variant type, patch welcome");
|
||||
return false;
|
||||
}
|
||||
*aResult = std::move(variant);
|
||||
*aResult = variant.forget();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -237,11 +237,11 @@ bool IPDLParamTraits<nsIPropertyBag2*>::Read(const Message* aMsg,
|
|||
auto properties = MakeRefPtr<nsHashPropertyBag>();
|
||||
|
||||
for (auto& entry : bag) {
|
||||
nsCOMPtr<nsIVariant> variant = std::move(entry.value());
|
||||
nsCOMPtr<nsIVariant> variant = entry.value().forget();
|
||||
MOZ_ALWAYS_SUCCEEDS(
|
||||
properties->SetProperty(std::move(entry.name()), variant));
|
||||
}
|
||||
*aResult = std::move(properties);
|
||||
*aResult = properties.forget();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ bool ParamTraits<nsIReferrerInfo*>::Read(const Message* aMsg,
|
|||
NS_ENSURE_SUCCESS(rv, false);
|
||||
nsCOMPtr<nsIReferrerInfo> referrerInfo = do_QueryInterface(iSupports);
|
||||
NS_ENSURE_TRUE(referrerInfo, false);
|
||||
*aResult = ToRefPtr(std::move(referrerInfo));
|
||||
*aResult = referrerInfo.forget();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1718,9 +1718,10 @@ class Datastore final
|
|||
// Created by PrepareDatastoreOp.
|
||||
Datastore(const nsACString& aGroup, const nsACString& aOrigin,
|
||||
uint32_t aPrivateBrowsingId, int64_t aUsage, int64_t aSizeOfKeys,
|
||||
int64_t aSizeOfItems, RefPtr<DirectoryLock>&& aDirectoryLock,
|
||||
RefPtr<Connection>&& aConnection,
|
||||
RefPtr<QuotaObject>&& aQuotaObject,
|
||||
int64_t aSizeOfItems,
|
||||
already_AddRefed<DirectoryLock>&& aDirectoryLock,
|
||||
already_AddRefed<Connection>&& aConnection,
|
||||
already_AddRefed<QuotaObject>&& aQuotaObject,
|
||||
nsDataHashtable<nsStringHashKey, LSValue>& aValues,
|
||||
nsTArray<LSItemInfo>& aOrderedItems);
|
||||
|
||||
|
@ -4767,9 +4768,9 @@ void ConnectionThread::Shutdown() {
|
|||
Datastore::Datastore(const nsACString& aGroup, const nsACString& aOrigin,
|
||||
uint32_t aPrivateBrowsingId, int64_t aUsage,
|
||||
int64_t aSizeOfKeys, int64_t aSizeOfItems,
|
||||
RefPtr<DirectoryLock>&& aDirectoryLock,
|
||||
RefPtr<Connection>&& aConnection,
|
||||
RefPtr<QuotaObject>&& aQuotaObject,
|
||||
already_AddRefed<DirectoryLock>&& aDirectoryLock,
|
||||
already_AddRefed<Connection>&& aConnection,
|
||||
already_AddRefed<QuotaObject>&& aQuotaObject,
|
||||
nsDataHashtable<nsStringHashKey, LSValue>& aValues,
|
||||
nsTArray<LSItemInfo>& aOrderedItems)
|
||||
: mDirectoryLock(std::move(aDirectoryLock)),
|
||||
|
@ -7197,7 +7198,7 @@ nsresult PrepareDatastoreOp::OpenDirectory() {
|
|||
MOZ_ASSERT(pendingDirectoryLock);
|
||||
|
||||
if (mNestedState == NestedState::DirectoryOpenPending) {
|
||||
mPendingDirectoryLock = std::move(pendingDirectoryLock);
|
||||
mPendingDirectoryLock = pendingDirectoryLock.forget();
|
||||
}
|
||||
|
||||
mRequestedDirectoryLock = true;
|
||||
|
@ -7867,10 +7868,10 @@ void PrepareDatastoreOp::GetResponse(LSRequestResponse& aResponse) {
|
|||
}
|
||||
}
|
||||
|
||||
mDatastore = new Datastore(
|
||||
mGroup, mOrigin, mPrivateBrowsingId, mUsage, mSizeOfKeys, mSizeOfItems,
|
||||
std::move(mDirectoryLock), std::move(mConnection),
|
||||
std::move(quotaObject), mValues, mOrderedItems);
|
||||
mDatastore = new Datastore(mGroup, mOrigin, mPrivateBrowsingId, mUsage,
|
||||
mSizeOfKeys, mSizeOfItems,
|
||||
mDirectoryLock.forget(), mConnection.forget(),
|
||||
quotaObject.forget(), mValues, mOrderedItems);
|
||||
|
||||
mDatastore->NoteLivePrepareDatastoreOp(this);
|
||||
|
||||
|
|
|
@ -397,7 +397,7 @@ class AudioSegment : public MediaSegmentBase<AudioSegment, AudioChunk> {
|
|||
// in the segment.
|
||||
AudioChunk* AppendAndConsumeChunk(AudioChunk* aChunk) {
|
||||
AudioChunk* chunk = AppendChunk(aChunk->mDuration);
|
||||
chunk->mBuffer = std::move(aChunk->mBuffer);
|
||||
chunk->mBuffer = aChunk->mBuffer.forget();
|
||||
chunk->mChannelData.SwapElements(aChunk->mChannelData);
|
||||
|
||||
MOZ_ASSERT(chunk->mBuffer || aChunk->mChannelData.IsEmpty(),
|
||||
|
|
|
@ -46,14 +46,14 @@ void OutputStreamDriver::EndTrack() {
|
|||
}
|
||||
}
|
||||
|
||||
void OutputStreamDriver::SetImage(RefPtr<layers::Image>&& aImage,
|
||||
void OutputStreamDriver::SetImage(const RefPtr<layers::Image>& aImage,
|
||||
const TimeStamp& aTime) {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
TRACE_COMMENT("SourceMediaTrack %p", mSourceStream.get());
|
||||
|
||||
VideoSegment segment;
|
||||
segment.AppendFrame(aImage.forget(), aImage->GetSize(), mPrincipalHandle,
|
||||
segment.AppendFrame(do_AddRef(aImage), aImage->GetSize(), mPrincipalHandle,
|
||||
false, aTime);
|
||||
mSourceStream->AppendData(&segment);
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ class TimerDriver : public OutputStreamDriver {
|
|||
}
|
||||
|
||||
mFrameCaptureRequested = false;
|
||||
SetImage(std::move(image), aTime);
|
||||
SetImage(image.forget(), aTime);
|
||||
}
|
||||
|
||||
void Forget() override {
|
||||
|
@ -126,7 +126,7 @@ class AutoDriver : public OutputStreamDriver {
|
|||
// after something changed.
|
||||
|
||||
RefPtr<Image> image = aImage;
|
||||
SetImage(std::move(image), aTime);
|
||||
SetImage(image.forget(), aTime);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
|
|
@ -70,7 +70,7 @@ class OutputStreamDriver : public FrameCaptureListener {
|
|||
* Sub classes can SetImage() to update the image being appended to the
|
||||
* output stream. It will be appended on the next NotifyPull from MTG.
|
||||
*/
|
||||
void SetImage(RefPtr<layers::Image>&& aImage, const TimeStamp& aTime);
|
||||
void SetImage(const RefPtr<layers::Image>& aImage, const TimeStamp& aTime);
|
||||
|
||||
/*
|
||||
* Ends the track in mSourceStream when we know there won't be any more images
|
||||
|
|
|
@ -774,7 +774,7 @@ RefPtr<MediaCache> MediaCache::GetMediaCache(int64_t aContentLength) {
|
|||
NS_WARNING("Failed to create a thread for MediaCache.");
|
||||
return nullptr;
|
||||
}
|
||||
sThread = ToRefPtr(std::move(thread));
|
||||
sThread = thread.forget();
|
||||
|
||||
static struct ClearThread {
|
||||
// Called during shutdown to clear sThread.
|
||||
|
|
|
@ -1699,7 +1699,7 @@ class MediaDecoderStateMachine::VideoOnlySeekingState
|
|||
// changes.
|
||||
mMaster->mOnPlaybackEvent.Notify(MediaPlaybackEvent::VideoOnlySeekBegin);
|
||||
|
||||
return p;
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
void Exit() override {
|
||||
|
@ -3767,7 +3767,7 @@ RefPtr<GenericPromise> MediaDecoderStateMachine::RequestDebugInfo(
|
|||
AbstractThread::TailDispatch);
|
||||
MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv));
|
||||
Unused << rv;
|
||||
return p;
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
class VideoQueueMemoryFunctor : public nsDequeFunctor {
|
||||
|
|
|
@ -266,7 +266,7 @@ void MediaFormatReader::DecoderFactory::RunStage(Data& aData) {
|
|||
mOwner->OwnerThread(), __func__,
|
||||
[this, &aData](RefPtr<Token> aToken) {
|
||||
aData.mTokenRequest.Complete();
|
||||
aData.mToken = std::move(aToken);
|
||||
aData.mToken = aToken.forget();
|
||||
aData.mStage = Stage::CreateDecoder;
|
||||
RunStage(aData);
|
||||
},
|
||||
|
@ -408,7 +408,7 @@ void MediaFormatReader::DecoderFactory::DoInitDecoder(Data& aData) {
|
|||
aData.mInitRequest.Complete();
|
||||
aData.mStage = Stage::None;
|
||||
MutexAutoLock lock(ownerData.mMutex);
|
||||
ownerData.mDecoder = std::move(aData.mDecoder);
|
||||
ownerData.mDecoder = aData.mDecoder.forget();
|
||||
ownerData.mDescription = ownerData.mDecoder->GetDescriptionName();
|
||||
DDLOGEX2("MediaFormatReader::DecoderFactory", this,
|
||||
DDLogCategory::Log, "decoder_initialized", DDNoValue{});
|
||||
|
@ -456,7 +456,7 @@ class MediaFormatReader::DemuxerProxy {
|
|||
~DemuxerProxy() { MOZ_COUNT_DTOR(DemuxerProxy); }
|
||||
|
||||
RefPtr<ShutdownPromise> Shutdown() {
|
||||
RefPtr<Data> data = std::move(mData);
|
||||
RefPtr<Data> data = mData.forget();
|
||||
return InvokeAsync(mTaskQueue, __func__, [data]() {
|
||||
// We need to clear our reference to the demuxer now. So that in the event
|
||||
// the init promise wasn't resolved, such as what can happen with the
|
||||
|
@ -676,7 +676,7 @@ class MediaFormatReader::DemuxerProxy::Wrapper : public MediaTrackDemuxer {
|
|||
friend class DemuxerProxy;
|
||||
|
||||
~Wrapper() {
|
||||
RefPtr<MediaTrackDemuxer> trackDemuxer = std::move(mTrackDemuxer);
|
||||
RefPtr<MediaTrackDemuxer> trackDemuxer = mTrackDemuxer.forget();
|
||||
nsresult rv = mTaskQueue->Dispatch(NS_NewRunnableFunction(
|
||||
"MediaFormatReader::DemuxerProxy::Wrapper::~Wrapper",
|
||||
[trackDemuxer]() { trackDemuxer->BreakCycles(); }));
|
||||
|
|
|
@ -1970,7 +1970,7 @@ void MediaRecorder::NotifyError(nsresult aRv) {
|
|||
"mSecurityDomException was not initialized"));
|
||||
mSecurityDomException = DOMException::Create(NS_ERROR_DOM_SECURITY_ERR);
|
||||
}
|
||||
init.mError = std::move(mSecurityDomException);
|
||||
init.mError = mSecurityDomException.forget();
|
||||
break;
|
||||
default:
|
||||
if (!mUnknownDomException) {
|
||||
|
@ -1981,7 +1981,7 @@ void MediaRecorder::NotifyError(nsresult aRv) {
|
|||
LOG(LogLevel::Debug, ("MediaRecorder.NotifyError: "
|
||||
"mUnknownDomException being fired for aRv: %X",
|
||||
uint32_t(aRv)));
|
||||
init.mError = std::move(mUnknownDomException);
|
||||
init.mError = mUnknownDomException.forget();
|
||||
}
|
||||
|
||||
RefPtr<MediaRecorderErrorEvent> event = MediaRecorderErrorEvent::Constructor(
|
||||
|
|
|
@ -59,7 +59,7 @@ static nsCOMPtr<nsIAsyncShutdownClient> GetShutdownBarrier() {
|
|||
}
|
||||
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
|
||||
MOZ_RELEASE_ASSERT(barrier);
|
||||
return barrier;
|
||||
return barrier.forget();
|
||||
}
|
||||
|
||||
void MediaShutdownManager::InitStatics() {
|
||||
|
|
|
@ -36,7 +36,7 @@ void VideoFrame::SetNull() {
|
|||
}
|
||||
|
||||
void VideoFrame::TakeFrom(VideoFrame* aFrame) {
|
||||
mImage = std::move(aFrame->mImage);
|
||||
mImage = aFrame->mImage.forget();
|
||||
mIntrinsicSize = aFrame->mIntrinsicSize;
|
||||
mForceBlack = aFrame->GetForceBlack();
|
||||
mPrincipalHandle = aFrame->mPrincipalHandle;
|
||||
|
|
|
@ -292,7 +292,7 @@ RefPtr<GenericPromise> InvokeUntil(Work aWork, Condition aCondition) {
|
|||
};
|
||||
|
||||
Helper::Iteration(p, aWork, aCondition);
|
||||
return p;
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
// Simple timer to run a runnable after a timeout.
|
||||
|
|
|
@ -71,7 +71,7 @@ nsCString CDMStorageIdProvider::ComputeStorageId(const nsCString& aOriginSalt) {
|
|||
static_cast<uint32_t>(rv));
|
||||
return EmptyCString();
|
||||
}
|
||||
return storageId;
|
||||
return std::move(storageId);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ class GMPServiceCreateHelper final : public mozilla::Runnable {
|
|||
SystemGroup::EventTargetFor(mozilla::TaskCategory::Other),
|
||||
createHelper, true);
|
||||
|
||||
service = std::move(createHelper->mService);
|
||||
service = createHelper->mService.forget();
|
||||
}
|
||||
|
||||
return service.forget();
|
||||
|
|
|
@ -1509,7 +1509,7 @@ static nsCOMPtr<nsIAsyncShutdownClient> GetShutdownBarrier() {
|
|||
|
||||
MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
|
||||
MOZ_RELEASE_ASSERT(barrier);
|
||||
return barrier;
|
||||
return barrier.forget();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
|
@ -92,7 +92,7 @@ RefPtr<ShutdownPromise> RemoteMediaDataDecoder::Shutdown() {
|
|||
// task queue for the *DecoderChild thread to keep
|
||||
// it alive until we send the delete message.
|
||||
p->Then(RemoteDecoderManagerChild::GetManagerThread(), __func__,
|
||||
[child = std::move(self->mChild)](
|
||||
[child = RefPtr<IRemoteDecoderChild>(self->mChild.forget())](
|
||||
const ShutdownPromise::ResolveOrRejectValue& aValue) {
|
||||
MOZ_ASSERT(aValue.IsResolve());
|
||||
child->DestroyIPDL();
|
||||
|
|
|
@ -46,7 +46,7 @@ auto AllocPolicyImpl::Alloc() -> RefPtr<Promise> {
|
|||
RefPtr<PromisePrivate> p = new PromisePrivate(__func__);
|
||||
mPromises.push(p);
|
||||
ResolvePromise(mon);
|
||||
return p;
|
||||
return p.forget();
|
||||
}
|
||||
|
||||
void AllocPolicyImpl::Dealloc() {
|
||||
|
@ -60,7 +60,7 @@ void AllocPolicyImpl::ResolvePromise(ReentrantMonitorAutoEnter& aProofOfLock) {
|
|||
|
||||
if (mDecoderLimit > 0 && !mPromises.empty()) {
|
||||
--mDecoderLimit;
|
||||
RefPtr<PromisePrivate> p = std::move(mPromises.front());
|
||||
RefPtr<PromisePrivate> p = mPromises.front().forget();
|
||||
mPromises.pop();
|
||||
p->Resolve(new AutoDeallocToken(this), __func__);
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ void AllocPolicyImpl::ResolvePromise(ReentrantMonitorAutoEnter& aProofOfLock) {
|
|||
void AllocPolicyImpl::RejectAll() {
|
||||
ReentrantMonitorAutoEnter mon(mMonitor);
|
||||
while (!mPromises.empty()) {
|
||||
RefPtr<PromisePrivate> p = std::move(mPromises.front());
|
||||
RefPtr<PromisePrivate> p = mPromises.front().forget();
|
||||
mPromises.pop();
|
||||
p->Reject(true, __func__);
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ auto SingleAllocPolicy::Alloc() -> RefPtr<Promise> {
|
|||
return AllocPolicyImpl::Alloc()->Then(
|
||||
mOwnerThread, __func__,
|
||||
[self](RefPtr<Token> aToken) {
|
||||
RefPtr<Token> localToken = std::move(aToken);
|
||||
RefPtr<Token> localToken = aToken.forget();
|
||||
RefPtr<Promise> p = self->mPendingPromise.Ensure(__func__);
|
||||
GlobalAllocPolicy::Instance(self->mTrack)
|
||||
->Alloc()
|
||||
|
@ -186,8 +186,8 @@ AllocationWrapper::~AllocationWrapper() {
|
|||
}
|
||||
|
||||
RefPtr<ShutdownPromise> AllocationWrapper::Shutdown() {
|
||||
RefPtr<MediaDataDecoder> decoder = std::move(mDecoder);
|
||||
RefPtr<Token> token = std::move(mToken);
|
||||
RefPtr<MediaDataDecoder> decoder = mDecoder.forget();
|
||||
RefPtr<Token> token = mToken.forget();
|
||||
return decoder->Shutdown()->Then(
|
||||
AbstractThread::GetCurrent(), __func__,
|
||||
[token]() { return ShutdownPromise::CreateAndResolve(true, __func__); });
|
||||
|
|
|
@ -294,7 +294,7 @@ already_AddRefed<MediaDataDecoder> PDMFactory::CreateDecoderWithPDM(
|
|||
// or there wasn't enough initialization data to do so (such as what can
|
||||
// happen with AVC3). Otherwise, there was some problem, for example WMF
|
||||
// DLLs were missing.
|
||||
m = std::move(h);
|
||||
m = h.forget();
|
||||
} else if (aParams.mError) {
|
||||
*aParams.mError = result;
|
||||
}
|
||||
|
|
|
@ -253,7 +253,7 @@ class EMEDecryptor : public MediaDataDecoder,
|
|||
mIsShutdown = true;
|
||||
mSamplesWaitingForKey->BreakCycles();
|
||||
mSamplesWaitingForKey = nullptr;
|
||||
RefPtr<MediaDataDecoder> decoder = std::move(mDecoder);
|
||||
RefPtr<MediaDataDecoder> decoder = mDecoder.forget();
|
||||
mProxy = nullptr;
|
||||
return decoder->Shutdown();
|
||||
});
|
||||
|
|
|
@ -412,7 +412,7 @@ RefPtr<ShutdownPromise> MediaChangeMonitor::Shutdown() {
|
|||
if (mShutdownPromise) {
|
||||
// We have a shutdown in progress, return that promise instead as we can't
|
||||
// shutdown a decoder twice.
|
||||
RefPtr<ShutdownPromise> p = std::move(mShutdownPromise);
|
||||
RefPtr<ShutdownPromise> p = mShutdownPromise.forget();
|
||||
return p;
|
||||
}
|
||||
return ShutdownDecoder();
|
||||
|
@ -424,7 +424,7 @@ RefPtr<ShutdownPromise> MediaChangeMonitor::ShutdownDecoder() {
|
|||
return InvokeAsync(mTaskQueue, __func__, [self, this]() {
|
||||
mConversionRequired.reset();
|
||||
if (mDecoder) {
|
||||
RefPtr<MediaDataDecoder> decoder = std::move(mDecoder);
|
||||
RefPtr<MediaDataDecoder> decoder = mDecoder.forget();
|
||||
return decoder->Shutdown();
|
||||
}
|
||||
return ShutdownPromise::CreateAndResolve(true, __func__);
|
||||
|
|
|
@ -158,7 +158,7 @@ void AudioBlock::AllocateChannels(uint32_t aChannelCount) {
|
|||
for (uint32_t i = 0; i < aChannelCount; ++i) {
|
||||
mChannelData[i] = buffer->ChannelData(i);
|
||||
}
|
||||
mBuffer = std::move(buffer);
|
||||
mBuffer = buffer.forget();
|
||||
mVolume = 1.0f;
|
||||
mBufferFormat = AUDIO_FORMAT_FLOAT32;
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ void AudioBuffer::SetSharedChannels(
|
|||
for (uint32_t i = 0; i < channelCount; ++i) {
|
||||
mSharedChannels.mChannelData[i] = buffer->GetData(i);
|
||||
}
|
||||
mSharedChannels.mBuffer = std::move(buffer);
|
||||
mSharedChannels.mBuffer = buffer.forget();
|
||||
mSharedChannels.mBufferFormat = AUDIO_FORMAT_FLOAT32;
|
||||
}
|
||||
|
||||
|
|
|
@ -168,7 +168,7 @@ void AudioNode::DisconnectFromGraph() {
|
|||
|
||||
while (!mOutputNodes.IsEmpty()) {
|
||||
size_t i = mOutputNodes.Length() - 1;
|
||||
RefPtr<AudioNode> output = std::move(mOutputNodes[i]);
|
||||
RefPtr<AudioNode> output = mOutputNodes[i].forget();
|
||||
mOutputNodes.RemoveElementAt(i);
|
||||
size_t inputIndex = FindIndexOfNode(output->mInputNodes, this);
|
||||
// It doesn't matter which one we remove, since we're going to remove all
|
||||
|
@ -180,7 +180,7 @@ void AudioNode::DisconnectFromGraph() {
|
|||
|
||||
while (!mOutputParams.IsEmpty()) {
|
||||
size_t i = mOutputParams.Length() - 1;
|
||||
RefPtr<AudioParam> output = std::move(mOutputParams[i]);
|
||||
RefPtr<AudioParam> output = mOutputParams[i].forget();
|
||||
mOutputParams.RemoveElementAt(i);
|
||||
size_t inputIndex = FindIndexOfNode(output->InputNodes(), this);
|
||||
// It doesn't matter which one we remove, since we're going to remove all
|
||||
|
@ -336,7 +336,7 @@ bool AudioNode::DisconnectFromOutputIfConnected<AudioNode>(
|
|||
// Remove one instance of 'dest' from mOutputNodes. There could be
|
||||
// others, and it's not correct to remove them all since some of them
|
||||
// could be for different output ports.
|
||||
RefPtr<AudioNode> output = std::move(mOutputNodes[aOutputNodeIndex]);
|
||||
RefPtr<AudioNode> output = mOutputNodes[aOutputNodeIndex].forget();
|
||||
mOutputNodes.RemoveElementAt(aOutputNodeIndex);
|
||||
// Destroying the InputNode here sends a message to the graph thread
|
||||
// to disconnect the tracks, which should be sent before the
|
||||
|
|
|
@ -504,7 +504,7 @@ void MediaDecodeTask::FinishDecode() {
|
|||
data += resampledFrames;
|
||||
}
|
||||
#endif
|
||||
mDecodeJob.mBuffer.mBuffer = std::move(buffer);
|
||||
mDecodeJob.mBuffer.mBuffer = buffer.forget();
|
||||
mDecodeJob.mBuffer.mVolume = 1.0f;
|
||||
mDecodeJob.mBuffer.mBufferFormat = AUDIO_OUTPUT_FORMAT;
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ class WebMPacketQueue {
|
|||
}
|
||||
|
||||
already_AddRefed<NesteggPacketHolder> PopFront() {
|
||||
RefPtr<NesteggPacketHolder> result = std::move(mQueue.front());
|
||||
RefPtr<NesteggPacketHolder> result = mQueue.front().forget();
|
||||
mQueue.pop_front();
|
||||
return result.forget();
|
||||
}
|
||||
|
|
|
@ -47,13 +47,13 @@ class MediaRawDataQueue {
|
|||
}
|
||||
|
||||
already_AddRefed<MediaRawData> PopFront() {
|
||||
RefPtr<MediaRawData> result = std::move(mQueue.front());
|
||||
RefPtr<MediaRawData> result = mQueue.front().forget();
|
||||
mQueue.pop_front();
|
||||
return result.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<MediaRawData> Pop() {
|
||||
RefPtr<MediaRawData> result = std::move(mQueue.back());
|
||||
RefPtr<MediaRawData> result = mQueue.back().forget();
|
||||
mQueue.pop_back();
|
||||
return result.forget();
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ bool MIDIAccessManager::AddObserver(Observer<MIDIPortList>* aObserver) {
|
|||
return false;
|
||||
}
|
||||
MOZ_ASSERT(constructedMgr == mgr);
|
||||
mChild = std::move(mgr);
|
||||
mChild = mgr.forget();
|
||||
// Add a ref to mChild here, that will be deref'd by
|
||||
// BackgroundChildImpl::DeallocPMIDIManagerChild on IPC cleanup.
|
||||
mChild->SetActorAlive();
|
||||
|
|
|
@ -1717,7 +1717,7 @@ class WorkerGetCallback final : public ScopeCheckingGetCallback {
|
|||
AssertIsOnMainThread();
|
||||
MOZ_ASSERT(mPromiseProxy, "Was Done() called twice?");
|
||||
|
||||
RefPtr<PromiseWorkerProxy> proxy = std::move(mPromiseProxy);
|
||||
RefPtr<PromiseWorkerProxy> proxy = mPromiseProxy.forget();
|
||||
MutexAutoLock lock(proxy->Lock());
|
||||
if (proxy->CleanedUp()) {
|
||||
return NS_OK;
|
||||
|
|
|
@ -171,7 +171,7 @@ nsresult PaymentDetailsModifier::Create(
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
displayItems = std::move(items);
|
||||
displayItems = items.forget();
|
||||
}
|
||||
nsCOMPtr<nsIPaymentDetailsModifier> modifier =
|
||||
new PaymentDetailsModifier(aIPCModifier.supportedMethods(), total,
|
||||
|
@ -322,7 +322,7 @@ nsresult PaymentDetails::Create(const IPCPaymentDetails& aIPCDetails,
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
displayItems = std::move(items);
|
||||
displayItems = items.forget();
|
||||
|
||||
nsCOMPtr<nsIArray> shippingOptions;
|
||||
nsCOMPtr<nsIMutableArray> options = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
|
@ -339,7 +339,7 @@ nsresult PaymentDetails::Create(const IPCPaymentDetails& aIPCDetails,
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
shippingOptions = std::move(options);
|
||||
shippingOptions = options.forget();
|
||||
|
||||
nsCOMPtr<nsIArray> modifiers;
|
||||
nsCOMPtr<nsIMutableArray> detailsModifiers =
|
||||
|
@ -357,7 +357,7 @@ nsresult PaymentDetails::Create(const IPCPaymentDetails& aIPCDetails,
|
|||
return rv;
|
||||
}
|
||||
}
|
||||
modifiers = std::move(detailsModifiers);
|
||||
modifiers = detailsModifiers.forget();
|
||||
|
||||
nsCOMPtr<nsIPaymentDetails> details = new PaymentDetails(
|
||||
aIPCDetails.id(), total, displayItems, shippingOptions, modifiers,
|
||||
|
|
|
@ -1028,7 +1028,7 @@ nsresult PresentationControllingInfo::NotifyReconnectResult(nsresult aStatus) {
|
|||
|
||||
mIsReconnecting = false;
|
||||
nsCOMPtr<nsIPresentationServiceCallback> callback =
|
||||
std::move(mReconnectCallback);
|
||||
mReconnectCallback.forget();
|
||||
if (NS_FAILED(aStatus)) {
|
||||
return callback->NotifyError(aStatus);
|
||||
}
|
||||
|
|
|
@ -378,14 +378,14 @@ class PromiseNativeHandlerShim final : public PromiseNativeHandler {
|
|||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override {
|
||||
RefPtr<PromiseNativeHandler> inner = std::move(mInner);
|
||||
RefPtr<PromiseNativeHandler> inner = mInner.forget();
|
||||
inner->ResolvedCallback(aCx, aValue);
|
||||
MOZ_ASSERT(!mInner);
|
||||
}
|
||||
|
||||
MOZ_CAN_RUN_SCRIPT
|
||||
void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override {
|
||||
RefPtr<PromiseNativeHandler> inner = std::move(mInner);
|
||||
RefPtr<PromiseNativeHandler> inner = mInner.forget();
|
||||
inner->RejectedCallback(aCx, aValue);
|
||||
MOZ_ASSERT(!mInner);
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ nsresult GetSubscriptionParams(nsIPushSubscription* aSubscription,
|
|||
class GetSubscriptionResultRunnable final : public WorkerRunnable {
|
||||
public:
|
||||
GetSubscriptionResultRunnable(WorkerPrivate* aWorkerPrivate,
|
||||
RefPtr<PromiseWorkerProxy>&& aProxy,
|
||||
already_AddRefed<PromiseWorkerProxy>&& aProxy,
|
||||
nsresult aStatus, const nsAString& aEndpoint,
|
||||
const nsAString& aScope,
|
||||
nsTArray<uint8_t>&& aRawP256dhKey,
|
||||
|
@ -171,7 +171,7 @@ class GetSubscriptionCallback final : public nsIPushSubscriptionCallback {
|
|||
|
||||
WorkerPrivate* worker = mProxy->GetWorkerPrivate();
|
||||
RefPtr<GetSubscriptionResultRunnable> r = new GetSubscriptionResultRunnable(
|
||||
worker, std::move(mProxy), aStatus, endpoint, mScope,
|
||||
worker, mProxy.forget(), aStatus, endpoint, mScope,
|
||||
std::move(rawP256dhKey), std::move(authSecret),
|
||||
std::move(appServerKey));
|
||||
MOZ_ALWAYS_TRUE(r->Dispatch());
|
||||
|
|
|
@ -55,7 +55,7 @@ NS_IMPL_ISUPPORTS(UnsubscribeResultCallback, nsIUnsubscribeResultCallback)
|
|||
class UnsubscribeResultRunnable final : public WorkerRunnable {
|
||||
public:
|
||||
UnsubscribeResultRunnable(WorkerPrivate* aWorkerPrivate,
|
||||
RefPtr<PromiseWorkerProxy>&& aProxy,
|
||||
already_AddRefed<PromiseWorkerProxy>&& aProxy,
|
||||
nsresult aStatus, bool aSuccess)
|
||||
: WorkerRunnable(aWorkerPrivate),
|
||||
mProxy(std::move(aProxy)),
|
||||
|
@ -110,7 +110,7 @@ class WorkerUnsubscribeResultCallback final
|
|||
|
||||
WorkerPrivate* worker = mProxy->GetWorkerPrivate();
|
||||
RefPtr<UnsubscribeResultRunnable> r = new UnsubscribeResultRunnable(
|
||||
worker, std::move(mProxy), aStatus, aSuccess);
|
||||
worker, mProxy.forget(), aStatus, aSuccess);
|
||||
MOZ_ALWAYS_TRUE(r->Dispatch());
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -2028,8 +2028,8 @@ NotifyOffThreadScriptLoadCompletedRunnable::Run() {
|
|||
|
||||
// We want these to be dropped on the main thread, once we return from this
|
||||
// function.
|
||||
RefPtr<ScriptLoadRequest> request = std::move(mRequest);
|
||||
RefPtr<ScriptLoader> loader = std::move(mLoader);
|
||||
RefPtr<ScriptLoadRequest> request = mRequest.forget();
|
||||
RefPtr<ScriptLoader> loader = mLoader.forget();
|
||||
|
||||
request->mOffThreadToken = mToken;
|
||||
nsresult rv = loader->ProcessOffThreadRequest(request);
|
||||
|
|
|
@ -48,7 +48,7 @@ void DOMSecurityManager::Initialize() {
|
|||
|
||||
obs->AddObserver(service, NS_HTTP_ON_EXAMINE_RESPONSE_TOPIC, false);
|
||||
obs->AddObserver(service, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
|
||||
gDOMSecurityManager = std::move(service);
|
||||
gDOMSecurityManager = service.forget();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
|
|
@ -307,12 +307,12 @@ bool IPDLParamTraits<dom::FeaturePolicy*>::Read(
|
|||
|
||||
nsString declaredString = info.declaredString();
|
||||
if (declaredString.IsEmpty() || !info.selfOrigin()) {
|
||||
*aResult = std::move(featurePolicy);
|
||||
*aResult = featurePolicy.forget();
|
||||
return true;
|
||||
}
|
||||
featurePolicy->SetDeclaredPolicy(nullptr, declaredString, info.selfOrigin(),
|
||||
info.srcOrigin());
|
||||
*aResult = std::move(featurePolicy);
|
||||
*aResult = featurePolicy.forget();
|
||||
return true;
|
||||
}
|
||||
} // namespace ipc
|
||||
|
|
|
@ -180,7 +180,7 @@ void ServiceWorkerContainer::ReceiveMessage(
|
|||
const ClientPostMessageArgs& aArgs) {
|
||||
RefPtr<ReceivedMessage> message = new ReceivedMessage(aArgs);
|
||||
if (mMessagesStarted) {
|
||||
EnqueueReceivedMessageDispatch(std::move(message));
|
||||
EnqueueReceivedMessageDispatch(message.forget());
|
||||
} else {
|
||||
mPendingMessages.AppendElement(message.forget());
|
||||
}
|
||||
|
@ -287,13 +287,13 @@ already_AddRefed<Promise> ServiceWorkerContainer::Register(
|
|||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
scriptURI = std::move(cloneWithoutRef);
|
||||
scriptURI = cloneWithoutRef.forget();
|
||||
|
||||
aRv = NS_GetURIWithoutRef(scopeURI, getter_AddRefs(cloneWithoutRef));
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
scopeURI = std::move(cloneWithoutRef);
|
||||
scopeURI = cloneWithoutRef.forget();
|
||||
|
||||
ServiceWorkerScopeAndScriptAreValid(clientInfo.ref(), scopeURI, scriptURI,
|
||||
aRv);
|
||||
|
|
|
@ -392,7 +392,7 @@ RefPtr<GenericErrorResultPromise> ServiceWorkerManager::StartControllingClient(
|
|||
auto entry = mControlledClients.LookupForAdd(aClientInfo.Id());
|
||||
if (entry) {
|
||||
RefPtr<ServiceWorkerRegistrationInfo> old =
|
||||
std::move(entry.Data()->mRegistrationInfo);
|
||||
entry.Data()->mRegistrationInfo.forget();
|
||||
|
||||
if (aControlClientHandle) {
|
||||
promise = entry.Data()->mClientHandle->Control(active);
|
||||
|
@ -468,7 +468,7 @@ void ServiceWorkerManager::StopControllingClient(
|
|||
}
|
||||
|
||||
RefPtr<ServiceWorkerRegistrationInfo> reg =
|
||||
std::move(entry.Data()->mRegistrationInfo);
|
||||
entry.Data()->mRegistrationInfo.forget();
|
||||
|
||||
entry.Remove();
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ ServiceWorkerPrivate::ServiceWorkerPrivate(ServiceWorkerInfo* aInfo)
|
|||
MOZ_ALWAYS_SUCCEEDS(inner->Initialize());
|
||||
#endif
|
||||
|
||||
mInner = std::move(inner);
|
||||
mInner = inner.forget();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1798,8 +1798,7 @@ void ServiceWorkerPrivate::TerminateWorker() {
|
|||
}
|
||||
|
||||
Unused << NS_WARN_IF(!mWorkerPrivate->Cancel());
|
||||
RefPtr<WorkerPrivate> workerPrivate = std::move(mWorkerPrivate);
|
||||
mozilla::Unused << workerPrivate;
|
||||
RefPtr<WorkerPrivate> workerPrivate(mWorkerPrivate.forget());
|
||||
mSupportsArray.Clear();
|
||||
|
||||
// Any pending events are never going to fire on this worker. Cancel
|
||||
|
@ -1870,7 +1869,7 @@ void ServiceWorkerPrivate::UpdateState(ServiceWorkerState aState) {
|
|||
mPendingFunctionalEvents.SwapElements(pendingEvents);
|
||||
|
||||
for (uint32_t i = 0; i < pendingEvents.Length(); ++i) {
|
||||
RefPtr<WorkerRunnable> r = std::move(pendingEvents[i]);
|
||||
RefPtr<WorkerRunnable> r = pendingEvents[i].forget();
|
||||
if (NS_WARN_IF(!r->Dispatch())) {
|
||||
NS_WARNING("Failed to dispatch pending functional event!");
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче