--- a/accessible/ipc/other/ProxyAccessible.cpp
+++ b/accessible/ipc/other/ProxyAccessible.cpp
@@ -73,17 +73,17 @@ ProxyAccessible::RelationByType(Relation
&targetIDs);
size_t targetCount = targetIDs.Length();
nsTArray<ProxyAccessible*> targets(targetCount);
for (size_t i = 0; i < targetCount; i++)
if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i]))
targets.AppendElement(proxy);
- return std::move(targets);
+ return targets;
}
void
ProxyAccessible::Relations(nsTArray<RelationType>* aTypes,
nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets)
const
{
nsTArray<RelationTargets> ipcRelations;
--- a/devtools/shared/heapsnapshot/DeserializedNode.cpp
+++ b/devtools/shared/heapsnapshot/DeserializedNode.cpp
@@ -82,18 +82,18 @@ class DeserializedEdgeRange : public Edg
void settle() {
if (i >= node->edges.length()) {
front_ = nullptr;
return;
}
auto& edge = node->edges[i];
auto referent = node->getEdgeReferent(edge);
- currentEdge = std::move(Edge(edge.name ? NS_strdup(edge.name) : nullptr,
- referent));
+ currentEdge = Edge(edge.name
+ ? NS_strdup(edge.name) : nullptr, referent);
front_ = ¤tEdge;
}
public:
explicit DeserializedEdgeRange(DeserializedNode& node)
: node(&node)
, i(0)
{
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -2860,17 +2860,17 @@ nsDocShell::MaybeCreateInitialClientSour
}
Maybe<ClientInfo>
nsDocShell::GetInitialClientInfo() const
{
if (mInitialClientSource) {
Maybe<ClientInfo> result;
result.emplace(mInitialClientSource->Info());
- return std::move(result);
+ return result;
}
nsGlobalWindowInner* innerWindow =
mScriptGlobal ? mScriptGlobal->GetCurrentInnerWindowInternal() : nullptr;
nsIDocument* doc = innerWindow ? innerWindow->GetExtantDoc() : nullptr;
if (!doc || !doc->IsInitialDocument()) {
return Maybe<ClientInfo>();
@@ -14062,20 +14062,20 @@ nsDocShell::NotifyJSRunToCompletionStart
const uint32_t aLineNumber,
JS::Handle<JS::Value> aAsyncStack,
const char* aAsyncCause)
{
// If first start, mark interval start.
if (mJSRunToCompletionDepth == 0) {
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (timelines && timelines->HasConsumer(this)) {
- timelines->AddMarkerForDocShell(this, std::move(
+ timelines->AddMarkerForDocShell(this,
mozilla::MakeUnique<JavascriptTimelineMarker>(
aReason, aFunctionName, aFilename, aLineNumber, MarkerTracingType::START,
- aAsyncStack, aAsyncCause)));
+ aAsyncStack, aAsyncCause));
}
}
mJSRunToCompletionDepth++;
}
void
nsDocShell::NotifyJSRunToCompletionStop()
--- a/docshell/base/timeline/AutoRestyleTimelineMarker.cpp
+++ b/docshell/base/timeline/AutoRestyleTimelineMarker.cpp
@@ -27,34 +27,34 @@ AutoRestyleTimelineMarker::AutoRestyleTi
}
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (!timelines || !timelines->HasConsumer(aDocShell)) {
return;
}
mDocShell = aDocShell;
- timelines->AddMarkerForDocShell(mDocShell, std::move(
+ timelines->AddMarkerForDocShell(mDocShell,
MakeUnique<RestyleTimelineMarker>(
mIsAnimationOnly,
- MarkerTracingType::START)));
+ MarkerTracingType::START));
}
AutoRestyleTimelineMarker::~AutoRestyleTimelineMarker()
{
MOZ_ASSERT(NS_IsMainThread());
if (!mDocShell) {
return;
}
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (!timelines || !timelines->HasConsumer(mDocShell)) {
return;
}
- timelines->AddMarkerForDocShell(mDocShell, std::move(
+ timelines->AddMarkerForDocShell(mDocShell,
MakeUnique<RestyleTimelineMarker>(
mIsAnimationOnly,
- MarkerTracingType::END)));
+ MarkerTracingType::END));
}
} // namespace mozilla
--- a/docshell/base/timeline/TimelineConsumers.cpp
+++ b/docshell/base/timeline/TimelineConsumers.cpp
@@ -180,30 +180,30 @@ TimelineConsumers::IsEmpty()
void
TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
const char* aName,
MarkerTracingType aTracingType,
MarkerStackRequest aStackRequest)
{
MOZ_ASSERT(NS_IsMainThread());
if (HasConsumer(aDocShell)) {
- aDocShell->mObserved->AddMarker(std::move(MakeUnique<TimelineMarker>(aName, aTracingType, aStackRequest)));
+ aDocShell->mObserved->AddMarker(MakeUnique<TimelineMarker>(aName, aTracingType, aStackRequest));
}
}
void
TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
const char* aName,
const TimeStamp& aTime,
MarkerTracingType aTracingType,
MarkerStackRequest aStackRequest)
{
MOZ_ASSERT(NS_IsMainThread());
if (HasConsumer(aDocShell)) {
- aDocShell->mObserved->AddMarker(std::move(MakeUnique<TimelineMarker>(aName, aTime, aTracingType, aStackRequest)));
+ aDocShell->mObserved->AddMarker(MakeUnique<TimelineMarker>(aName, aTime, aTracingType, aStackRequest));
}
}
void
TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
UniquePtr<AbstractTimelineMarker>&& aMarker)
{
MOZ_ASSERT(NS_IsMainThread());
--- a/dom/animation/EffectSet.h
+++ b/dom/animation/EffectSet.h
@@ -85,17 +85,17 @@ public:
// This allows us to avoid exposing mEffects directly and saves the
// caller from having to dereference hashtable iterators using
// the rather complicated: iter.Get()->GetKey().
class Iterator
{
public:
explicit Iterator(EffectSet& aEffectSet)
: mEffectSet(aEffectSet)
- , mHashIterator(std::move(aEffectSet.mEffects.Iter()))
+ , mHashIterator(aEffectSet.mEffects.Iter())
, mIsEndIterator(false)
{
#ifdef DEBUG
mEffectSet.mActiveIterators++;
#endif
}
Iterator(Iterator&& aOther)
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -488,17 +488,17 @@ CustomElementRegistry::CreateCustomEleme
if (aArgs) {
callback->SetArgs(*aArgs);
}
if (aAdoptedCallbackArgs) {
callback->SetAdoptedCallbackArgs(*aAdoptedCallbackArgs);
}
- return std::move(callback);
+ return callback;
}
/* static */ void
CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
Element* aCustomElement,
LifecycleCallbackArgs* aArgs,
LifecycleAdoptedCallbackArgs* aAdoptedCallbackArgs,
CustomElementDefinition* aDefinition)
--- a/dom/base/nsContentPermissionHelper.cpp
+++ b/dom/base/nsContentPermissionHelper.cpp
@@ -427,17 +427,17 @@ nsContentPermissionUtils::GetContentPerm
{
nsTArray<PContentPermissionRequestParent*> parentArray;
for (auto& it : ContentPermissionRequestParentMap()) {
if (it.second == aTabId) {
parentArray.AppendElement(it.first);
}
}
- return std::move(parentArray);
+ return parentArray;
}
/* static */ void
nsContentPermissionUtils::NotifyRemoveContentPermissionRequestParent(
PContentPermissionRequestParent* aParent)
{
auto it = ContentPermissionRequestParentMap().find(aParent);
MOZ_ASSERT(it != ContentPermissionRequestParentMap().end());
@@ -450,17 +450,17 @@ nsContentPermissionUtils::GetContentPerm
{
nsTArray<PContentPermissionRequestChild*> childArray;
for (auto& it : ContentPermissionRequestChildMap()) {
if (it.second == aTabId) {
childArray.AppendElement(it.first);
}
}
- return std::move(childArray);
+ return childArray;
}
/* static */ void
nsContentPermissionUtils::NotifyRemoveContentPermissionRequestChild(
PContentPermissionRequestChild* aChild)
{
auto it = ContentPermissionRequestChildMap().find(aChild);
MOZ_ASSERT(it != ContentPermissionRequestChildMap().end());
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -5560,39 +5560,39 @@ nsIDocument::GetAnonRootIfInAnonymousCon
return nullptr;
}
Maybe<ClientInfo>
nsIDocument::GetClientInfo() const
{
nsPIDOMWindowInner* inner = GetInnerWindow();
if (inner) {
- return std::move(inner->GetClientInfo());
- }
- return std::move(Maybe<ClientInfo>());
+ return inner->GetClientInfo();
+ }
+ return Maybe<ClientInfo>();
}
Maybe<ClientState>
nsIDocument::GetClientState() const
{
nsPIDOMWindowInner* inner = GetInnerWindow();
if (inner) {
- return std::move(inner->GetClientState());
- }
- return std::move(Maybe<ClientState>());
+ return inner->GetClientState();
+ }
+ return Maybe<ClientState>();
}
Maybe<ServiceWorkerDescriptor>
nsIDocument::GetController() const
{
nsPIDOMWindowInner* inner = GetInnerWindow();
if (inner) {
- return std::move(inner->GetController());
- }
- return std::move(Maybe<ServiceWorkerDescriptor>());
+ return inner->GetController();
+ }
+ return Maybe<ServiceWorkerDescriptor>();
}
//
// nsIDocument interface
//
DocumentType*
nsIDocument::GetDoctype() const
{
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -2315,35 +2315,35 @@ void
nsPIDOMWindowInner::SyncStateFromParentWindow()
{
nsGlobalWindowInner::Cast(this)->SyncStateFromParentWindow();
}
Maybe<ClientInfo>
nsPIDOMWindowInner::GetClientInfo() const
{
- return std::move(nsGlobalWindowInner::Cast(this)->GetClientInfo());
+ return nsGlobalWindowInner::Cast(this)->GetClientInfo();
}
Maybe<ClientState>
nsPIDOMWindowInner::GetClientState() const
{
- return std::move(nsGlobalWindowInner::Cast(this)->GetClientState());
+ return nsGlobalWindowInner::Cast(this)->GetClientState();
}
Maybe<ServiceWorkerDescriptor>
nsPIDOMWindowInner::GetController() const
{
- return std::move(nsGlobalWindowInner::Cast(this)->GetController());
+ return nsGlobalWindowInner::Cast(this)->GetController();
}
RefPtr<mozilla::dom::ServiceWorker>
nsPIDOMWindowInner::GetOrCreateServiceWorker(const mozilla::dom::ServiceWorkerDescriptor& aDescriptor)
{
- return std::move(nsGlobalWindowInner::Cast(this)->GetOrCreateServiceWorker(aDescriptor));
+ return nsGlobalWindowInner::Cast(this)->GetOrCreateServiceWorker(aDescriptor);
}
void
nsPIDOMWindowInner::NoteCalledRegisterForServiceWorkerScope(const nsACString& aScope)
{
nsGlobalWindowInner::Cast(this)->NoteCalledRegisterForServiceWorkerScope(aScope);
}
@@ -5493,17 +5493,17 @@ nsGlobalWindowInner::ShowSlowScriptDialo
auto getString = [&] (const char* name,
nsContentUtils::PropertiesFile propFile = nsContentUtils::eDOM_PROPERTIES) {
nsAutoString result;
nsresult rv = nsContentUtils::GetLocalizedString(
propFile, name, result);
// GetStringFromName can return NS_OK and still give nullptr string
failed = failed || NS_FAILED(rv) || result.IsEmpty();
- return std::move(result);
+ return result;
};
bool isAddonScript = !aAddonId.IsEmpty();
bool showDebugButton = debugCallback && !isAddonScript;
// Get localizable strings
nsAutoString title, checkboxMsg, debugButton, msg;
@@ -6324,43 +6324,43 @@ nsGlobalWindowInner::CallOnChildren(Meth
Maybe<ClientInfo>
nsGlobalWindowInner::GetClientInfo() const
{
MOZ_ASSERT(NS_IsMainThread());
Maybe<ClientInfo> clientInfo;
if (mClientSource) {
clientInfo.emplace(mClientSource->Info());
}
- return std::move(clientInfo);
+ return clientInfo;
}
Maybe<ClientState>
nsGlobalWindowInner::GetClientState() const
{
MOZ_ASSERT(NS_IsMainThread());
Maybe<ClientState> clientState;
if (mClientSource) {
ClientState state;
nsresult rv = mClientSource->SnapshotState(&state);
if (NS_SUCCEEDED(rv)) {
clientState.emplace(state);
}
}
- return std::move(clientState);
+ return clientState;
}
Maybe<ServiceWorkerDescriptor>
nsGlobalWindowInner::GetController() const
{
MOZ_ASSERT(NS_IsMainThread());
Maybe<ServiceWorkerDescriptor> controller;
if (mClientSource) {
controller = mClientSource->GetController();
}
- return std::move(controller);
+ return controller;
}
RefPtr<ServiceWorker>
nsGlobalWindowInner::GetOrCreateServiceWorker(const ServiceWorkerDescriptor& aDescriptor)
{
MOZ_ASSERT(NS_IsMainThread());
RefPtr<ServiceWorker> ref;
ForEachEventTargetObject([&] (DOMEventTargetHelper* aTarget, bool* aDoneOut) {
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -799,17 +799,17 @@ ImageBitmap::ToCloneData() const
UniquePtr<ImageBitmapCloneData> result(new ImageBitmapCloneData());
result->mPictureRect = mPictureRect;
result->mAlphaType = mAlphaType;
result->mIsCroppingAreaOutSideOfSourceImage = mIsCroppingAreaOutSideOfSourceImage;
RefPtr<SourceSurface> surface = mData->GetAsSourceSurface();
result->mSurface = surface->GetDataSurface();
MOZ_ASSERT(result->mSurface);
- return std::move(result);
+ return result;
}
/* static */ already_AddRefed<ImageBitmap>
ImageBitmap::CreateFromCloneData(nsIGlobalObject* aGlobal,
ImageBitmapCloneData* aData)
{
RefPtr<layers::Image> data = CreateImageFromSurface(aData->mSurface);
--- a/dom/canvas/WebGLFormats.cpp
+++ b/dom/canvas/WebGLFormats.cpp
@@ -822,17 +822,17 @@ FormatUsageAuthority::CreateForWebGL1(gl
ptr->AllowRBFormat(LOCAL_GL_DEPTH_STENCIL,
ptr->GetUsage(EffectiveFormat::DEPTH24_STENCIL8));
////////////////////////////////////////////////////////////////////////////
if (!AddUnsizedFormats(ptr, gl))
return nullptr;
- return std::move(ret);
+ return ret;
}
UniquePtr<FormatUsageAuthority>
FormatUsageAuthority::CreateForWebGL2(gl::GLContext* gl)
{
UniquePtr<FormatUsageAuthority> ret(new FormatUsageAuthority);
const auto ptr = ret.get();
@@ -1057,17 +1057,17 @@ FormatUsageAuthority::CreateForWebGL2(gl
AddSimpleUnsized(ptr, LOCAL_GL_RGB , LOCAL_GL_FLOAT, EffectiveFormat::RGB32F );
AddSimpleUnsized(ptr, LOCAL_GL_RGBA, LOCAL_GL_HALF_FLOAT_OES, EffectiveFormat::RGBA16F);
AddSimpleUnsized(ptr, LOCAL_GL_RGB , LOCAL_GL_HALF_FLOAT_OES, EffectiveFormat::RGB16F );
}
////////////////////////////////////
- return std::move(ret);
+ return ret;
}
//////////////////////////////////////////////////////////////////////////////////////////
void
FormatUsageAuthority::AddTexUnpack(FormatUsageInfo* usage, const PackingInfo& pi,
const DriverUnpackInfo& dui)
{
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -222,17 +222,17 @@ FromPboOffset(WebGLContext* webgl, const
isClientData, ptr, availBufferBytes);
}
static UniquePtr<webgl::TexUnpackBlob>
FromImageBitmap(WebGLContext* webgl, const char* funcName, TexImageTarget target,
uint32_t width, uint32_t height, uint32_t depth,
const dom::ImageBitmap& imageBitmap)
{
- UniquePtr<dom::ImageBitmapCloneData> cloneData = std::move(imageBitmap.ToCloneData());
+ UniquePtr<dom::ImageBitmapCloneData> cloneData = imageBitmap.ToCloneData();
if (!cloneData) {
return nullptr;
}
const RefPtr<gfx::DataSourceSurface> surf = cloneData->mSurface;
if (!width) {
width = surf->GetSize().width;
@@ -455,17 +455,17 @@ ValidateTexOrSubImage(WebGLContext* webg
if (!ValidateViewType(webgl, funcName, pi.type, src))
return nullptr;
auto blob = webgl->From(funcName, target, rawWidth, rawHeight, rawDepth, border, src,
scopedArr);
if (!blob || !blob->Validate(webgl, funcName, pi))
return nullptr;
- return std::move(blob);
+ return blob;
}
void
WebGLTexture::TexImage(const char* funcName, TexImageTarget target, GLint level,
GLenum internalFormat, GLsizei width, GLsizei height,
GLsizei depth, GLint border, const webgl::PackingInfo& pi,
const TexImageSource& src)
{
--- a/dom/clients/manager/ClientHandle.cpp
+++ b/dom/clients/manager/ClientHandle.cpp
@@ -198,13 +198,13 @@ ClientHandle::OnDetach()
if (!mDetachPromise) {
mDetachPromise = new GenericPromise::Private(__func__);
if (IsShutdown()) {
mDetachPromise->Resolve(true, __func__);
}
}
RefPtr<GenericPromise> ref(mDetachPromise);
- return std::move(ref);
+ return ref;
}
} // namespace dom
} // namespace mozilla
--- a/dom/clients/manager/ClientInfo.cpp
+++ b/dom/clients/manager/ClientInfo.cpp
@@ -140,13 +140,13 @@ ClientInfo::IsPrivateBrowsing() const
}
}
nsCOMPtr<nsIPrincipal>
ClientInfo::GetPrincipal() const
{
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(PrincipalInfo());
- return std::move(ref);
+ return ref;
}
} // namespace dom
} // namespace mozilla
--- a/dom/clients/manager/ClientManager.cpp
+++ b/dom/clients/manager/ClientManager.cpp
@@ -131,30 +131,30 @@ ClientManager::CreateSourceInternal(Clie
if (NS_WARN_IF(NS_FAILED(rv))) {
// If we can't even get a UUID, at least make sure not to use a garbage
// value. Instead return a shutdown ClientSource with a zero'd id.
// This should be exceptionally rare, if it happens at all.
id.Clear();
ClientSourceConstructorArgs args(id, aType, aPrincipal, TimeStamp::Now());
UniquePtr<ClientSource> source(new ClientSource(this, aEventTarget, args));
source->Shutdown();
- return std::move(source);
+ return source;
}
ClientSourceConstructorArgs args(id, aType, aPrincipal, TimeStamp::Now());
UniquePtr<ClientSource> source(new ClientSource(this, aEventTarget, args));
if (IsShutdown()) {
source->Shutdown();
- return std::move(source);
+ return source;
}
source->Activate(GetActor());
- return std::move(source);
+ return source;
}
already_AddRefed<ClientHandle>
ClientManager::CreateHandleInternal(const ClientInfo& aClientInfo,
nsISerialEventTarget* aSerialEventTarget)
{
NS_ASSERT_OWNINGTHREAD(ClientManager);
MOZ_DIAGNOSTIC_ASSERT(aSerialEventTarget);
--- a/dom/clients/manager/ClientManagerService.cpp
+++ b/dom/clients/manager/ClientManagerService.cpp
@@ -433,18 +433,18 @@ ClientManagerService::MatchAll(const Cli
if(controller.ref().Id() != swd.Id() ||
controller.ref().Scope() != swd.Scope()) {
continue;
}
}
promiseList->AddPromise(
- source->StartOp(std::move(ClientGetInfoAndStateArgs(source->Info().Id(),
- source->Info().PrincipalInfo()))));
+ source->StartOp(ClientGetInfoAndStateArgs(source->Info().Id(),
+ source->Info().PrincipalInfo())));
}
// Maybe finish the promise now in case we didn't find any matching clients.
promiseList->MaybeFinish();
return promiseList->GetResultPromise();
}
--- a/dom/console/Console.cpp
+++ b/dom/console/Console.cpp
@@ -2882,36 +2882,36 @@ Console::MonotonicTimer(JSContext* aCx,
return false;
}
nsAutoJSString key;
if (!key.init(aCx, jsString)) {
return false;
}
- timelines->AddMarkerForDocShell(docShell, std::move(
- MakeUnique<TimestampTimelineMarker>(key)));
+ timelines->AddMarkerForDocShell(docShell,
+ MakeUnique<TimestampTimelineMarker>(key));
}
// For `console.time(foo)` and `console.timeEnd(foo)`.
else if (isTimelineRecording && aData.Length() == 1) {
JS::Rooted<JS::Value> value(aCx, aData[0]);
JS::Rooted<JSString*> jsString(aCx, JS::ToString(aCx, value));
if (!jsString) {
return false;
}
nsAutoJSString key;
if (!key.init(aCx, jsString)) {
return false;
}
- timelines->AddMarkerForDocShell(docShell, std::move(
+ timelines->AddMarkerForDocShell(docShell,
MakeUnique<ConsoleTimelineMarker>(
key, aMethodName == MethodTime ? MarkerTracingType::START
- : MarkerTracingType::END)));
+ : MarkerTracingType::END));
}
return true;
}
if (NS_IsMainThread()) {
*aTimeStamp = (TimeStamp::Now() - mCreationTimeStamp).ToMilliseconds();
return true;
--- a/dom/events/EventListenerManager.cpp
+++ b/dom/events/EventListenerManager.cpp
@@ -1240,19 +1240,19 @@ EventListenerManager::HandleEventInterna
listener->mListenerType != Listener::eNativeListener) {
docShell = nsContentUtils::GetDocShellForEventTarget(mTarget);
if (docShell) {
if (timelines && timelines->HasConsumer(docShell)) {
needsEndEventMarker = true;
nsAutoString typeStr;
(*aDOMEvent)->GetType(typeStr);
uint16_t phase = (*aDOMEvent)->EventPhase();
- timelines->AddMarkerForDocShell(docShell, std::move(
+ timelines->AddMarkerForDocShell(docShell,
MakeUnique<EventTimelineMarker>(
- typeStr, phase, MarkerTracingType::START)));
+ typeStr, phase, MarkerTracingType::START));
}
}
}
aEvent->mFlags.mInPassiveListener = listener->mFlags.mPassive;
Maybe<Listener> listenerHolder;
if (listener->mFlags.mOnce) {
// Move the listener to the stack before handling the event.
--- a/dom/file/nsHostObjectProtocolHandler.cpp
+++ b/dom/file/nsHostObjectProtocolHandler.cpp
@@ -563,17 +563,17 @@ private:
{
nsCOMPtr<nsIAsyncShutdownService> svc = services::GetAsyncShutdown();
NS_ENSURE_TRUE(!!svc, nullptr);
nsCOMPtr<nsIAsyncShutdownClient> phase;
nsresult rv = svc->GetXpcomWillShutdown(getter_AddRefs(phase));
NS_ENSURE_SUCCESS(rv, nullptr);
- return std::move(phase);
+ return phase;
}
nsCString mURI;
bool mBroadcastToOtherProcesses;
nsCOMPtr<nsITimer> mTimer;
};
--- a/dom/geolocation/nsGeolocation.cpp
+++ b/dom/geolocation/nsGeolocation.cpp
@@ -1159,17 +1159,17 @@ void
Geolocation::GetCurrentPosition(PositionCallback& aCallback,
PositionErrorCallback* aErrorCallback,
const PositionOptions& aOptions,
CallerType aCallerType,
ErrorResult& aRv)
{
nsresult rv = GetCurrentPosition(GeoPositionCallback(&aCallback),
GeoPositionErrorCallback(aErrorCallback),
- std::move(CreatePositionOptionsCopy(aOptions)),
+ CreatePositionOptionsCopy(aOptions),
aCallerType);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
}
}
static nsIEventTarget* MainThreadTarget(Geolocation* geo)
@@ -1237,17 +1237,17 @@ Geolocation::WatchPosition(PositionCallb
PositionErrorCallback* aErrorCallback,
const PositionOptions& aOptions,
CallerType aCallerType,
ErrorResult& aRv)
{
int32_t ret = 0;
nsresult rv = WatchPosition(GeoPositionCallback(&aCallback),
GeoPositionErrorCallback(aErrorCallback),
- std::move(CreatePositionOptionsCopy(aOptions)),
+ CreatePositionOptionsCopy(aOptions),
aCallerType,
&ret);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
}
return ret;
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -4465,18 +4465,18 @@ ContentParent::RecvNotifyTabDestroying(c
{
NotifyTabDestroying(aTabId, aCpId);
return IPC_OK();
}
nsTArray<TabContext>
ContentParent::GetManagedTabContext()
{
- return std::move(ContentProcessManager::GetSingleton()->
- GetTabContextByContentProcess(this->ChildID()));
+ return ContentProcessManager::GetSingleton()->
+ GetTabContextByContentProcess(this->ChildID());
}
mozilla::docshell::POfflineCacheUpdateParent*
ContentParent::AllocPOfflineCacheUpdateParent(const URIParams& aManifestURI,
const URIParams& aDocumentURI,
const PrincipalInfo& aLoadingPrincipalInfo,
const bool& aStickDocument)
{
--- a/dom/ipc/ContentProcessManager.cpp
+++ b/dom/ipc/ContentProcessManager.cpp
@@ -120,26 +120,26 @@ nsTArray<ContentParentId>
ContentProcessManager::GetAllChildProcessById(const ContentParentId& aParentCpId)
{
MOZ_ASSERT(NS_IsMainThread());
nsTArray<ContentParentId> cpIdArray;
auto iter = mContentParentMap.find(aParentCpId);
if (NS_WARN_IF(iter == mContentParentMap.end())) {
ASSERT_UNLESS_FUZZING();
- return std::move(cpIdArray);
+ return cpIdArray;
}
for (auto cpIter = iter->second.mChildrenCpId.begin();
cpIter != iter->second.mChildrenCpId.end();
++cpIter) {
cpIdArray.AppendElement(*cpIter);
}
- return std::move(cpIdArray);
+ return cpIdArray;
}
bool
ContentProcessManager::RegisterRemoteFrame(const TabId& aTabId,
const ContentParentId& aOpenerCpId,
const TabId& aOpenerTabId,
const IPCTabContext& aContext,
const ContentParentId& aChildCpId)
@@ -231,26 +231,26 @@ nsTArray<TabContext>
ContentProcessManager::GetTabContextByContentProcess(const ContentParentId& aChildCpId)
{
MOZ_ASSERT(NS_IsMainThread());
nsTArray<TabContext> tabContextArray;
auto iter = mContentParentMap.find(aChildCpId);
if (NS_WARN_IF(iter == mContentParentMap.end())) {
ASSERT_UNLESS_FUZZING();
- return std::move(tabContextArray);
+ return tabContextArray;
}
for (auto remoteFrameIter = iter->second.mRemoteFrames.begin();
remoteFrameIter != iter->second.mRemoteFrames.end();
++remoteFrameIter) {
tabContextArray.AppendElement(remoteFrameIter->second.mContext);
}
- return std::move(tabContextArray);
+ return tabContextArray;
}
bool
ContentProcessManager::GetRemoteFrameOpenerTabId(const ContentParentId& aChildCpId,
const TabId& aChildTabId,
/*out*/ContentParentId* aOpenerCpId,
/*out*/TabId* aOpenerTabId)
{
@@ -332,26 +332,26 @@ nsTArray<TabId>
ContentProcessManager::GetTabParentsByProcessId(const ContentParentId& aChildCpId)
{
MOZ_ASSERT(NS_IsMainThread());
nsTArray<TabId> tabIdList;
auto iter = mContentParentMap.find(aChildCpId);
if (NS_WARN_IF(iter == mContentParentMap.end())) {
ASSERT_UNLESS_FUZZING();
- return std::move(tabIdList);
+ return tabIdList;
}
for (auto remoteFrameIter = iter->second.mRemoteFrames.begin();
remoteFrameIter != iter->second.mRemoteFrames.end();
++remoteFrameIter) {
tabIdList.AppendElement(remoteFrameIter->first);
}
- return std::move(tabIdList);
+ return tabIdList;
}
uint32_t
ContentProcessManager::GetTabParentCountByProcessId(const ContentParentId& aChildCpId)
{
MOZ_ASSERT(NS_IsMainThread());
auto iter = mContentParentMap.find(aChildCpId);
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -2587,17 +2587,17 @@ MediaStream::SetTrackEnabledImpl(TrackID
}
} else {
for (const DisabledTrack& t : mDisabledTracks) {
if (aTrackID == t.mTrackID) {
NS_ERROR("Changing disabled track mode for a track is not allowed");
return;
}
}
- mDisabledTracks.AppendElement(std::move(DisabledTrack(aTrackID, aMode)));
+ mDisabledTracks.AppendElement(DisabledTrack(aTrackID, aMode));
}
}
DisabledTrackMode
MediaStream::GetDisabledTrackMode(TrackID aTrackID)
{
for (const DisabledTrack& t : mDisabledTracks) {
if (t.mTrackID == aTrackID) {
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -759,17 +759,17 @@ GetSupportedCapabilities(
if (!supportedCapabilities.AppendElement(capabilities, mozilla::fallible)) {
NS_WARNING("GetSupportedCapabilities: Malloc failure");
return Sequence<MediaKeySystemMediaCapability>();
}
// Note: omitting steps 3.13.2, our robustness is not sophisticated enough
// to require considering all requirements together.
}
- return std::move(supportedCapabilities);
+ return supportedCapabilities;
}
// "Get Supported Configuration and Consent" algorithm, steps 4-7 for
// distinctive identifier, and steps 8-11 for persistent state. The steps
// are the same for both requirements/features, so we factor them out into
// a single function.
static bool
CheckRequirement(const MediaKeysRequirement aRequirement,
--- a/dom/media/gmp/ChromiumCDMParent.cpp
+++ b/dom/media/gmp/ChromiumCDMParent.cpp
@@ -1073,17 +1073,17 @@ ChromiumCDMParent::RecvDrainComplete()
{
if (mIsShutdown) {
MOZ_ASSERT(mDecodePromise.IsEmpty());
return IPC_OK();
}
MediaDataDecoder::DecodedData samples;
while (!mReorderQueue.IsEmpty()) {
- samples.AppendElement(std::move(mReorderQueue.Pop()));
+ samples.AppendElement(mReorderQueue.Pop());
}
mDecodePromise.ResolveIfExists(std::move(samples), __func__);
return IPC_OK();
}
RefPtr<ShutdownPromise>
ChromiumCDMParent::ShutdownVideoDecoder()
{
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -941,17 +941,17 @@ GMPParent::GetGMPContentParent(UniquePtr
}
}
}
already_AddRefed<GMPContentParent>
GMPParent::ForgetGMPContentParent()
{
MOZ_ASSERT(mGetContentParentPromises.IsEmpty());
- return std::move(mGMPContentParent.forget());
+ return mGMPContentParent.forget();
}
bool
GMPParent::EnsureProcessLoaded(base::ProcessId* aID)
{
if (!EnsureProcessLoaded()) {
return false;
}
--- a/dom/media/gmp/GMPServiceParent.cpp
+++ b/dom/media/gmp/GMPServiceParent.cpp
@@ -1880,17 +1880,17 @@ GMPServiceParent::ActorDestroy(ActorDest
// Make sure the IPC channel is closed before destroying mToDelete.
MonitorAutoLock lock(monitor);
RefPtr<Runnable> task = NewNonOwningRunnableMethod<Monitor*, bool*>(
"gmp::GMPServiceParent::CloseTransport",
this,
&GMPServiceParent::CloseTransport,
&monitor,
&completed);
- XRE_GetIOMessageLoop()->PostTask(std::move(task.forget()));
+ XRE_GetIOMessageLoop()->PostTask(task.forget());
while (!completed) {
lock.Wait();
}
// Dispatch a task to the current thread to ensure we don't delete the
// GMPServiceParent until the current calling context is finished with
// the object.
--- a/dom/media/gmp/GMPStorageChild.cpp
+++ b/dom/media/gmp/GMPStorageChild.cpp
@@ -21,17 +21,17 @@
} \
} while(false)
static nsTArray<uint8_t>
ToArray(const uint8_t* aData, uint32_t aDataSize)
{
nsTArray<uint8_t> data;
data.AppendElements(aData, aDataSize);
- return std::move(data);
+ return data;
}
namespace mozilla {
namespace gmp {
GMPRecordImpl::GMPRecordImpl(GMPStorageChild* aOwner,
const nsCString& aName,
GMPRecordClient* aClient)
--- a/dom/media/ipc/VideoDecoderManagerParent.cpp
+++ b/dom/media/ipc/VideoDecoderManagerParent.cpp
@@ -39,17 +39,17 @@ using namespace gfx;
SurfaceDescriptorGPUVideo
VideoDecoderManagerParent::StoreImage(Image* aImage, TextureClient* aTexture)
{
SurfaceDescriptorGPUVideo ret;
aTexture->GPUVideoDesc(&ret);
mImageMap[ret.handle()] = aImage;
mTextureMap[ret.handle()] = aTexture;
- return std::move(ret);
+ return ret;
}
StaticRefPtr<nsIThread> sVideoDecoderManagerThread;
StaticRefPtr<TaskQueue> sManagerTaskQueue;
class VideoDecoderManagerThreadHolder
{
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VideoDecoderManagerThreadHolder)
--- a/dom/media/platforms/apple/AppleVTDecoder.cpp
+++ b/dom/media/platforms/apple/AppleVTDecoder.cpp
@@ -252,17 +252,17 @@ AppleVTDecoder::ProcessDrain()
AssertOnTaskQueueThread();
nsresult rv = WaitForAsynchronousFrames();
if (NS_FAILED(rv)) {
LOG("AppleVTDecoder::Drain failed waiting for platform decoder");
}
MonitorAutoLock mon(mMonitor);
DecodedData samples;
while (!mReorderQueue.IsEmpty()) {
- samples.AppendElement(std::move(mReorderQueue.Pop()));
+ samples.AppendElement(mReorderQueue.Pop());
}
return DecodePromise::CreateAndResolve(std::move(samples), __func__);
}
AppleVTDecoder::AppleFrameRef*
AppleVTDecoder::CreateAppleFrameRef(const MediaRawData* aSample)
{
MOZ_ASSERT(aSample);
--- a/dom/media/platforms/omx/OmxPlatformLayer.cpp
+++ b/dom/media/platforms/omx/OmxPlatformLayer.cpp
@@ -168,17 +168,17 @@ ConfigForMime(const nsACString& aMimeTyp
aMimeType.EqualsLiteral("audio/mpeg")) {
conf.reset(new OmxMp3Config());
} else if (aMimeType.EqualsLiteral("audio/3gpp")) {
conf.reset(new OmxAmrConfig<OmxAmrSampleRate::kNarrowBand>());
} else if (aMimeType.EqualsLiteral("audio/amr-wb")) {
conf.reset(new OmxAmrConfig<OmxAmrSampleRate::kWideBand>());
}
}
- return std::move(conf);
+ return conf;
}
// There should be a better way to calculate it.
#define MIN_VIDEO_INPUT_BUFFER_SIZE 64 * 1024
class OmxCommonVideoConfig : public OmxVideoConfig
{
public:
@@ -226,17 +226,17 @@ template<>
UniquePtr<OmxVideoConfig>
ConfigForMime(const nsACString& aMimeType)
{
UniquePtr<OmxVideoConfig> conf;
if (OmxPlatformLayer::SupportsMimeType(aMimeType)) {
conf.reset(new OmxCommonVideoConfig());
}
- return std::move(conf);
+ return conf;
}
OMX_ERRORTYPE
OmxPlatformLayer::Config()
{
MOZ_ASSERT(mInfo);
OMX_PORT_PARAM_TYPE portParam;
--- a/dom/serviceworkers/ServiceWorkerDescriptor.cpp
+++ b/dom/serviceworkers/ServiceWorkerDescriptor.cpp
@@ -98,17 +98,17 @@ ServiceWorkerDescriptor::PrincipalInfo()
return mData->principalInfo();
}
nsCOMPtr<nsIPrincipal>
ServiceWorkerDescriptor::GetPrincipal() const
{
AssertIsOnMainThread();
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo());
- return std::move(ref);
+ return ref;
}
const nsCString&
ServiceWorkerDescriptor::Scope() const
{
return mData->scope();
}
--- a/dom/serviceworkers/ServiceWorkerManager.cpp
+++ b/dom/serviceworkers/ServiceWorkerManager.cpp
@@ -319,51 +319,51 @@ ServiceWorkerManager::StartControllingCl
const ServiceWorkerDescriptor& active =
aRegistrationInfo->GetActive()->Descriptor();
auto entry = mControlledClients.LookupForAdd(aClientInfo.Id());
if (entry) {
RefPtr<ServiceWorkerRegistrationInfo> old =
entry.Data()->mRegistrationInfo.forget();
- ref = std::move(entry.Data()->mClientHandle->Control(active));
+ ref = entry.Data()->mClientHandle->Control(active);
entry.Data()->mRegistrationInfo = aRegistrationInfo;
if (old != aRegistrationInfo) {
StopControllingRegistration(old);
aRegistrationInfo->StartControllingClient();
}
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_CONTROLLED_DOCUMENTS, 1);
- return std::move(ref);
+ return ref;
}
RefPtr<ClientHandle> clientHandle =
ClientManager::CreateHandle(aClientInfo,
SystemGroup::EventTargetFor(TaskCategory::Other));
- ref = std::move(clientHandle->Control(active));
+ ref = clientHandle->Control(active);
aRegistrationInfo->StartControllingClient();
entry.OrInsert([&] {
return new ControlledClientData(clientHandle, aRegistrationInfo);
});
RefPtr<ServiceWorkerManager> self(this);
clientHandle->OnDetach()->Then(
SystemGroup::EventTargetFor(TaskCategory::Other), __func__,
[self = std::move(self), aClientInfo] {
self->StopControllingClient(aClientInfo);
});
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_CONTROLLED_DOCUMENTS, 1);
- return std::move(ref);
+ return ref;
}
void
ServiceWorkerManager::StopControllingClient(const ClientInfo& aClientInfo)
{
auto entry = mControlledClients.Lookup(aClientInfo.Id());
if (!entry) {
return;
--- a/dom/serviceworkers/ServiceWorkerRegistrar.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrar.cpp
@@ -1276,17 +1276,17 @@ ServiceWorkerRegistrar::GetShutdownPhase
// memory), and there's no point in continuing startup. Include as much
// information as possible in the crash report.
RELEASE_ASSERT_SUCCEEDED(rv, "async shutdown service");
nsCOMPtr<nsIAsyncShutdownClient> client;
rv = svc->GetProfileBeforeChange(getter_AddRefs(client));
RELEASE_ASSERT_SUCCEEDED(rv, "profileBeforeChange shutdown blocker");
- return std::move(client);
+ return client;
}
#undef RELEASE_ASSERT_SUCCEEDED
void
ServiceWorkerRegistrar::Shutdown()
{
AssertIsOnBackgroundThread();
--- a/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp
+++ b/dom/serviceworkers/ServiceWorkerRegistrationDescriptor.cpp
@@ -22,17 +22,17 @@ ServiceWorkerRegistrationDescriptor::New
Maybe<IPCServiceWorkerDescriptor> result;
if (mData->installing().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
result.emplace(mData->installing().get_IPCServiceWorkerDescriptor());
} else if (mData->waiting().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
result.emplace(mData->waiting().get_IPCServiceWorkerDescriptor());
} else if (mData->active().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
result.emplace(mData->active().get_IPCServiceWorkerDescriptor());
}
- return std::move(result);
+ return result;
}
ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor(
uint64_t aId,
nsIPrincipal* aPrincipal,
const nsACString& aScope,
ServiceWorkerUpdateViaCache aUpdateViaCache)
: mData(MakeUnique<IPCServiceWorkerRegistrationDescriptor>())
@@ -133,17 +133,17 @@ ServiceWorkerRegistrationDescriptor::Pri
return mData->principalInfo();
}
nsCOMPtr<nsIPrincipal>
ServiceWorkerRegistrationDescriptor::GetPrincipal() const
{
AssertIsOnMainThread();
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo());
- return std::move(ref);
+ return ref;
}
const nsCString&
ServiceWorkerRegistrationDescriptor::Scope() const
{
return mData->scope();
}
@@ -152,54 +152,54 @@ ServiceWorkerRegistrationDescriptor::Get
{
Maybe<ServiceWorkerDescriptor> result;
if (mData->installing().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
result.emplace(ServiceWorkerDescriptor(
mData->installing().get_IPCServiceWorkerDescriptor()));
}
- return std::move(result);
+ return result;
}
Maybe<ServiceWorkerDescriptor>
ServiceWorkerRegistrationDescriptor::GetWaiting() const
{
Maybe<ServiceWorkerDescriptor> result;
if (mData->waiting().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
result.emplace(ServiceWorkerDescriptor(
mData->waiting().get_IPCServiceWorkerDescriptor()));
}
- return std::move(result);
+ return result;
}
Maybe<ServiceWorkerDescriptor>
ServiceWorkerRegistrationDescriptor::GetActive() const
{
Maybe<ServiceWorkerDescriptor> result;
if (mData->active().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
result.emplace(ServiceWorkerDescriptor(
mData->active().get_IPCServiceWorkerDescriptor()));
}
- return std::move(result);
+ return result;
}
Maybe<ServiceWorkerDescriptor>
ServiceWorkerRegistrationDescriptor::Newest() const
{
Maybe<ServiceWorkerDescriptor> result;
Maybe<IPCServiceWorkerDescriptor> newest(NewestInternal());
if (newest.isSome()) {
result.emplace(ServiceWorkerDescriptor(newest.ref()));
}
- return std::move(result);
+ return result;
}
namespace {
bool
IsValidWorker(const OptionalIPCServiceWorkerDescriptor& aWorker,
const nsACString& aScope,
const mozilla::ipc::ContentPrincipalInfo& aContentPrincipal)
--- a/dom/u2f/U2F.cpp
+++ b/dom/u2f/U2F.cpp
@@ -272,17 +272,17 @@ U2F::Register(const nsAString& aAppId,
adjustedAppId,
challenge,
clientData,
adjustedTimeoutMillis,
excludeList,
null_t() /* no extra info for U2F */);
MOZ_ASSERT(mTransaction.isNothing());
- mTransaction = Some(U2FTransaction(std::move(AsVariant(callback))));
+ mTransaction = Some(U2FTransaction(AsVariant(callback)));
mChild->SendRequestRegister(mTransaction.ref().mId, info);
}
void
U2F::FinishMakeCredential(const uint64_t& aTransactionId,
const WebAuthnMakeCredentialResult& aResult)
{
MOZ_ASSERT(NS_IsMainThread());
@@ -418,17 +418,17 @@ U2F::Sign(const nsAString& aAppId,
adjustedAppId,
challenge,
clientData,
adjustedTimeoutMillis,
permittedList,
null_t() /* no extra info for U2F */);
MOZ_ASSERT(mTransaction.isNothing());
- mTransaction = Some(U2FTransaction(std::move(AsVariant(callback))));
+ mTransaction = Some(U2FTransaction(AsVariant(callback)));
mChild->SendRequestSign(mTransaction.ref().mId, info);
}
void
U2F::FinishGetAssertion(const uint64_t& aTransactionId,
const WebAuthnGetAssertionResult& aResult)
{
MOZ_ASSERT(NS_IsMainThread());
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -3492,30 +3492,30 @@ WorkerPrivate::EnsurePerformanceStorage(
Maybe<ClientInfo>
WorkerPrivate::GetClientInfo() const
{
AssertIsOnWorkerThread();
Maybe<ClientInfo> clientInfo;
if (!mClientSource) {
MOZ_DIAGNOSTIC_ASSERT(mStatus >= Terminating);
- return std::move(clientInfo);
+ return clientInfo;
}
clientInfo.emplace(mClientSource->Info());
- return std::move(clientInfo);
+ return clientInfo;
}
const ClientState
WorkerPrivate::GetClientState() const
{
AssertIsOnWorkerThread();
MOZ_DIAGNOSTIC_ASSERT(mClientSource);
ClientState state;
mClientSource->SnapshotState(&state);
- return std::move(state);
+ return state;
}
const Maybe<ServiceWorkerDescriptor>
WorkerPrivate::GetController()
{
AssertIsOnWorkerThread();
{
MutexAutoLock lock(mMutex);
--- a/dom/workers/WorkerScope.cpp
+++ b/dom/workers/WorkerScope.cpp
@@ -543,17 +543,17 @@ WorkerGlobalScope::GetClientInfo() const
return mWorkerPrivate->GetClientInfo();
}
Maybe<ClientState>
WorkerGlobalScope::GetClientState() const
{
Maybe<ClientState> state;
state.emplace(mWorkerPrivate->GetClientState());
- return std::move(state);
+ return state;
}
Maybe<ServiceWorkerDescriptor>
WorkerGlobalScope::GetController() const
{
return mWorkerPrivate->GetController();
}
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -225,17 +225,17 @@ HTMLEditor::CreateAnonymousElement(nsAto
// sort of ok.
newContent->SetProperty(nsGkAtoms::restylableAnonymousNode,
reinterpret_cast<void*>(true));
#endif // DEBUG
// display the element
ps->PostRecreateFramesFor(newContent);
- return std::move(newContent);
+ return newContent;
}
// Removes event listener and calls DeleteRefToAnonymousNode.
void
HTMLEditor::RemoveListenerAndDeleteRef(const nsAString& aEvent,
nsIDOMEventListener* aListener,
bool aUseCapture,
ManualNACPtr aElement,
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -6016,18 +6016,17 @@ HTMLEditRules::CreateStyleForInsertText(
int32_t offset = firstRange->StartOffset();
RefPtr<Element> rootElement = aDocument.GetRootElement();
if (NS_WARN_IF(!rootElement)) {
return NS_ERROR_FAILURE;
}
// process clearing any styles first
- UniquePtr<PropItem> item =
- std::move(HTMLEditorRef().mTypeInState->TakeClearProperty());
+ UniquePtr<PropItem> item = HTMLEditorRef().mTypeInState->TakeClearProperty();
{
// Transactions may set selection, but we will set selection if necessary.
AutoTransactionsConserveSelection dontChangeMySelection(&HTMLEditorRef());
while (item && node != rootElement) {
// XXX If we redesign ClearStyle(), we can use EditorDOMPoint in this
// method.
@@ -6035,24 +6034,24 @@ HTMLEditRules::CreateStyleForInsertText(
HTMLEditorRef().ClearStyle(address_of(node), &offset,
item->tag, item->attr);
if (NS_WARN_IF(!CanHandleEditAction())) {
return NS_ERROR_EDITOR_DESTROYED;
}
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
- item = std::move(HTMLEditorRef().mTypeInState->TakeClearProperty());
+ item = HTMLEditorRef().mTypeInState->TakeClearProperty();
weDidSomething = true;
}
}
// then process setting any styles
int32_t relFontSize = HTMLEditorRef().mTypeInState->TakeRelativeFontSize();
- item = std::move(HTMLEditorRef().mTypeInState->TakeSetProperty());
+ item = HTMLEditorRef().mTypeInState->TakeSetProperty();
if (item || relFontSize) {
// we have at least one style to add; make a new text node to insert style
// nodes above.
if (RefPtr<Text> text = node->GetAsText()) {
// if we are in a text node, split it
SplitNodeResult splitTextNodeResult =
HTMLEditorRef().SplitNodeDeepWithTransaction(
--- a/editor/libeditor/HTMLEditorObjectResizer.cpp
+++ b/editor/libeditor/HTMLEditorObjectResizer.cpp
@@ -140,17 +140,17 @@ HTMLEditor::CreateResizer(int16_t aLocat
case nsIHTMLObjectResizer::eBottomRight:
locationStr = kBottomRight;
break;
}
nsresult rv =
ret->SetAttr(kNameSpaceID_None, nsGkAtoms::anonlocation, locationStr, true);
NS_ENSURE_SUCCESS(rv, nullptr);
- return std::move(ret);
+ return ret;
}
ManualNACPtr
HTMLEditor::CreateShadow(nsIContent& aParentContent,
Element& aOriginalObject)
{
// let's create an image through the element factory
RefPtr<nsAtom> name;
--- a/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.cpp
+++ b/extensions/spellcheck/hunspell/glue/RemoteSpellCheckEngineChild.cpp
@@ -34,17 +34,17 @@ RemoteSpellcheckEngineChild::SetCurrentD
if (!SendSetDictionaryFromList(
aList,
reinterpret_cast<intptr_t>(promiseHolder.get()))) {
return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
}
RefPtr<GenericPromise> result = promiseHolder->Ensure(__func__);
// promiseHolder will removed by receive message
mResponsePromises.AppendElement(std::move(promiseHolder));
- return std::move(result);
+ return result;
}
mozilla::ipc::IPCResult
RemoteSpellcheckEngineChild::RecvNotifyOfCurrentDictionary(
const nsString& aDictionary,
const intptr_t& aId)
{
MozPromiseHolder<GenericPromise>* promiseHolder =
--- a/gfx/2d/SFNTData.cpp
+++ b/gfx/2d/SFNTData.cpp
@@ -134,25 +134,25 @@ SFNTData::Create(const uint8_t *aFontDat
const BigEndianUint32* endOfOffsets = offset + numFonts;
while (offset != endOfOffsets) {
if (!sfntData->AddFont(aFontData, aDataLength, *offset)) {
return nullptr;
}
++offset;
}
- return std::move(sfntData);
+ return sfntData;
}
UniquePtr<SFNTData> sfntData(new SFNTData);
if (!sfntData->AddFont(aFontData, aDataLength, 0)) {
return nullptr;
}
- return std::move(sfntData);
+ return sfntData;
}
/* static */
uint64_t
SFNTData::GetUniqueKey(const uint8_t *aFontData, uint32_t aDataLength,
uint32_t aVarDataSize, const void* aVarData)
{
uint64_t hash;
--- a/gfx/gl/GLScreenBuffer.cpp
+++ b/gfx/gl/GLScreenBuffer.cpp
@@ -43,28 +43,28 @@ UniquePtr<GLScreenBuffer>
GLScreenBuffer::Create(GLContext* gl,
const gfx::IntSize& size,
const SurfaceCaps& caps)
{
UniquePtr<GLScreenBuffer> ret;
if (caps.antialias &&
!gl->IsSupported(GLFeature::framebuffer_multisample))
{
- return std::move(ret);
+ return ret;
}
layers::TextureFlags flags = layers::TextureFlags::ORIGIN_BOTTOM_LEFT;
if (!caps.premultAlpha) {
flags |= layers::TextureFlags::NON_PREMULTIPLIED;
}
UniquePtr<SurfaceFactory> factory = MakeUnique<SurfaceFactory_Basic>(gl, caps, flags);
ret.reset( new GLScreenBuffer(gl, caps, std::move(factory)) );
- return std::move(ret);
+ return ret;
}
/* static */ UniquePtr<SurfaceFactory>
GLScreenBuffer::CreateFactory(GLContext* gl,
const SurfaceCaps& caps,
KnowsCompositor* compositorConnection,
const layers::TextureFlags& flags)
{
@@ -948,17 +948,17 @@ ReadBuffer::Create(GLContext* gl,
const bool isComplete = gl->IsFramebufferComplete(fb);
if (needsAcquire) {
surf->ProducerReadRelease();
}
if (!isComplete)
return nullptr;
- return std::move(ret);
+ return ret;
}
ReadBuffer::~ReadBuffer()
{
if (!mGL->MakeCurrent())
return;
GLuint fb = mFB;
--- a/gfx/gl/MozFramebuffer.cpp
+++ b/gfx/gl/MozFramebuffer.cpp
@@ -129,17 +129,17 @@ MozFramebuffer::CreateWith(GLContext* co
}
const auto status = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
if (status != LOCAL_GL_FRAMEBUFFER_COMPLETE) {
MOZ_ASSERT(false);
return nullptr;
}
- return std::move(mozFB);
+ return mozFB;
}
////////////////////
MozFramebuffer::MozFramebuffer(GLContext* const gl, const gfx::IntSize& size,
const uint32_t samples, const bool depthStencil,
const GLenum colorTarget, const GLuint colorName)
: mWeakGL(gl)
--- a/gfx/gl/SharedSurface.cpp
+++ b/gfx/gl/SharedSurface.cpp
@@ -327,17 +327,17 @@ SurfaceFactory::NewTexClient(const gfx::
if (cur->Surf()->mSize == size) {
cur->Surf()->WaitForBufferOwnership();
return cur.forget();
}
StopRecycling(cur);
}
- UniquePtr<SharedSurface> surf = std::move(CreateShared(size));
+ UniquePtr<SharedSurface> surf = CreateShared(size);
if (!surf)
return nullptr;
RefPtr<layers::SharedSurfaceTextureClient> ret;
ret = layers::SharedSurfaceTextureClient::Create(std::move(surf), this, mAllocator, mFlags);
StartRecycling(ret);
--- a/gfx/gl/SharedSurfaceEGL.cpp
+++ b/gfx/gl/SharedSurfaceEGL.cpp
@@ -25,37 +25,37 @@ SharedSurface_EGLImage::Create(GLContext
{
GLLibraryEGL* egl = &sEGLLibrary;
MOZ_ASSERT(egl);
MOZ_ASSERT(context);
UniquePtr<SharedSurface_EGLImage> ret;
if (!HasExtensions(egl, prodGL)) {
- return std::move(ret);
+ return ret;
}
MOZ_ALWAYS_TRUE(prodGL->MakeCurrent());
GLuint prodTex = CreateTextureForOffscreen(prodGL, formats, size);
if (!prodTex) {
- return std::move(ret);
+ return ret;
}
EGLClientBuffer buffer = reinterpret_cast<EGLClientBuffer>(uintptr_t(prodTex));
EGLImage image = egl->fCreateImage(egl->Display(), context,
LOCAL_EGL_GL_TEXTURE_2D, buffer,
nullptr);
if (!image) {
prodGL->fDeleteTextures(1, &prodTex);
- return std::move(ret);
+ return ret;
}
ret.reset( new SharedSurface_EGLImage(prodGL, egl, size, hasAlpha,
formats, prodTex, image) );
- return std::move(ret);
+ return ret;
}
bool
SharedSurface_EGLImage::HasExtensions(GLLibraryEGL* egl, GLContext* gl)
{
return egl->HasKHRImageBase() &&
egl->IsExtensionSupported(GLLibraryEGL::KHR_gl_texture_2D_image) &&
(gl->IsExtensionSupported(GLContext::OES_EGL_image_external) ||
@@ -172,17 +172,17 @@ SurfaceFactory_EGLImage::Create(GLContex
typedef SurfaceFactory_EGLImage ptrT;
UniquePtr<ptrT> ret;
GLLibraryEGL* egl = &sEGLLibrary;
if (SharedSurface_EGLImage::HasExtensions(egl, prodGL)) {
ret.reset( new ptrT(prodGL, caps, allocator, flags, context) );
}
- return std::move(ret);
+ return ret;
}
////////////////////////////////////////////////////////////////////////
#ifdef MOZ_WIDGET_ANDROID
/*static*/ UniquePtr<SharedSurface_SurfaceTexture>
SharedSurface_SurfaceTexture::Create(GLContext* prodGL,
@@ -195,22 +195,22 @@ SharedSurface_SurfaceTexture::Create(GLC
UniquePtr<SharedSurface_SurfaceTexture> ret;
AndroidNativeWindow window(surface);
GLContextEGL* egl = GLContextEGL::Cast(prodGL);
MOZ_ASSERT(egl);
EGLSurface eglSurface = egl->CreateCompatibleSurface(window.NativeWindow());
if (!eglSurface) {
- return std::move(ret);
+ return ret;
}
ret.reset(new SharedSurface_SurfaceTexture(prodGL, size, hasAlpha,
formats, surface, eglSurface));
- return std::move(ret);
+ return ret;
}
SharedSurface_SurfaceTexture::SharedSurface_SurfaceTexture(GLContext* gl,
const gfx::IntSize& size,
bool hasAlpha,
const GLFormats& formats,
java::GeckoSurface::Param surface,
EGLSurface eglSurface)
@@ -287,17 +287,17 @@ SharedSurface_SurfaceTexture::ToSurfaceD
/*static*/ UniquePtr<SurfaceFactory_SurfaceTexture>
SurfaceFactory_SurfaceTexture::Create(GLContext* prodGL, const SurfaceCaps& caps,
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
{
UniquePtr<SurfaceFactory_SurfaceTexture> ret(
new SurfaceFactory_SurfaceTexture(prodGL, caps, allocator, flags));
- return std::move(ret);
+ return ret;
}
UniquePtr<SharedSurface>
SurfaceFactory_SurfaceTexture::CreateShared(const gfx::IntSize& size)
{
bool hasAlpha = mReadCaps.alpha;
jni::Object::LocalRef surface = java::SurfaceAllocator::AcquireSurface(size.width, size.height, true);
--- a/gfx/gl/SharedSurfaceGL.cpp
+++ b/gfx/gl/SharedSurfaceGL.cpp
@@ -28,35 +28,35 @@ SharedSurface_Basic::Create(GLContext* g
GLContext::LocalErrorScope localError(*gl);
GLuint tex = CreateTextureForOffscreen(gl, formats, size);
GLenum err = localError.GetError();
MOZ_ASSERT_IF(err != LOCAL_GL_NO_ERROR, err == LOCAL_GL_OUT_OF_MEMORY);
if (err) {
gl->fDeleteTextures(1, &tex);
- return std::move(ret);
+ return ret;
}
bool ownsTex = true;
ret.reset( new SharedSurface_Basic(gl, size, hasAlpha, tex, ownsTex) );
- return std::move(ret);
+ return ret;
}
/*static*/ UniquePtr<SharedSurface_Basic>
SharedSurface_Basic::Wrap(GLContext* gl,
const IntSize& size,
bool hasAlpha,
GLuint tex)
{
bool ownsTex = false;
UniquePtr<SharedSurface_Basic> ret( new SharedSurface_Basic(gl, size, hasAlpha, tex,
ownsTex) );
- return std::move(ret);
+ return ret;
}
SharedSurface_Basic::SharedSurface_Basic(GLContext* gl,
const IntSize& size,
bool hasAlpha,
GLuint tex,
bool ownsTex)
: SharedSurface(SharedSurfaceType::Basic,
@@ -121,22 +121,22 @@ SharedSurface_GLTexture::Create(GLContex
GLContext::LocalErrorScope localError(*prodGL);
GLuint tex = CreateTextureForOffscreen(prodGL, formats, size);
GLenum err = localError.GetError();
MOZ_ASSERT_IF(err, err == LOCAL_GL_OUT_OF_MEMORY);
if (err) {
prodGL->fDeleteTextures(1, &tex);
- return std::move(ret);
+ return ret;
}
ret.reset(new SharedSurface_GLTexture(prodGL, size,
hasAlpha, tex));
- return std::move(ret);
+ return ret;
}
SharedSurface_GLTexture::~SharedSurface_GLTexture()
{
if (!mGL->MakeCurrent())
return;
if (mTex) {
--- a/gfx/gl/SharedSurfaceGLX.cpp
+++ b/gfx/gl/SharedSurfaceGLX.cpp
@@ -32,17 +32,17 @@ SharedSurface_GLXDrawable::Create(GLCont
Screen* screen = XDefaultScreenOfDisplay(display);
Visual* visual = gfxXlibSurface::FindVisual(screen, gfx::SurfaceFormat::A8R8G8B8_UINT32);
RefPtr<gfxXlibSurface> surf = gfxXlibSurface::Create(screen, visual, size);
if (!deallocateClient)
surf->ReleasePixmap();
ret.reset(new SharedSurface_GLXDrawable(prodGL, size, inSameProcess, surf));
- return std::move(ret);
+ return ret;
}
SharedSurface_GLXDrawable::SharedSurface_GLXDrawable(GLContext* gl,
const gfx::IntSize& size,
bool inSameProcess,
const RefPtr<gfxXlibSurface>& xlibSurface)
: SharedSurface(SharedSurfaceType::GLXDrawable,
@@ -124,17 +124,17 @@ SurfaceFactory_GLXDrawable::Create(GLCon
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
{
MOZ_ASSERT(caps.alpha, "GLX surfaces require an alpha channel!");
typedef SurfaceFactory_GLXDrawable ptrT;
UniquePtr<ptrT> ret(new ptrT(prodGL, caps, allocator,
flags & ~layers::TextureFlags::ORIGIN_BOTTOM_LEFT));
- return std::move(ret);
+ return ret;
}
UniquePtr<SharedSurface>
SurfaceFactory_GLXDrawable::CreateShared(const gfx::IntSize& size)
{
bool deallocateClient = !!(mFlags & layers::TextureFlags::DEALLOCATE_CLIENT);
return SharedSurface_GLXDrawable::Create(mGL, mCaps, size, deallocateClient,
mAllocator->IsSameProcess());
--- a/gfx/gl/SharedSurfaceIO.cpp
+++ b/gfx/gl/SharedSurfaceIO.cpp
@@ -21,17 +21,17 @@ SharedSurface_IOSurface::Create(const Re
{
MOZ_ASSERT(ioSurf);
MOZ_ASSERT(gl);
auto size = gfx::IntSize::Truncate(ioSurf->GetWidth(), ioSurf->GetHeight());
typedef SharedSurface_IOSurface ptrT;
UniquePtr<ptrT> ret( new ptrT(ioSurf, gl, size, hasAlpha) );
- return std::move(ret);
+ return ret;
}
void
SharedSurface_IOSurface::ProducerReleaseImpl()
{
mGL->MakeCurrent();
mGL->fFlush();
}
@@ -214,17 +214,17 @@ SurfaceFactory_IOSurface::Create(GLConte
const RefPtr<layers::LayersIPCChannel>& allocator,
const layers::TextureFlags& flags)
{
auto maxDims = gfx::IntSize::Truncate(MacIOSurface::GetMaxWidth(),
MacIOSurface::GetMaxHeight());
typedef SurfaceFactory_IOSurface ptrT;
UniquePtr<ptrT> ret( new ptrT(gl, caps, allocator, flags, maxDims) );
- return std::move(ret);
+ return ret;
}
UniquePtr<SharedSurface>
SurfaceFactory_IOSurface::CreateShared(const gfx::IntSize& size)
{
if (size.width > mMaxDims.width ||
size.height > mMaxDims.height)
{
--- a/gfx/layers/AnimationHelper.cpp
+++ b/gfx/layers/AnimationHelper.cpp
@@ -108,17 +108,17 @@ CompositorAnimationStorage::SetAnimatedV
void
CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
gfx::Matrix4x4&& aTransformInDevSpace)
{
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
const TransformData dontCare = {};
SetAnimatedValue(aId,
std::move(aTransformInDevSpace),
- std::move(gfx::Matrix4x4()),
+ gfx::Matrix4x4(),
dontCare);
}
void
CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
const float& aOpacity)
{
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
@@ -576,18 +576,18 @@ AnimationHelper::SetAnimations(
data->mTiming = TimingParams {
animation.duration(),
animation.delay(),
animation.endDelay(),
animation.iterations(),
animation.iterationStart(),
static_cast<dom::PlaybackDirection>(animation.direction()),
static_cast<dom::FillMode>(animation.fillMode()),
- std::move(AnimationUtils::TimingFunctionToComputedTimingFunction(
- animation.easingFunction()))
+ AnimationUtils::TimingFunctionToComputedTimingFunction(
+ animation.easingFunction())
};
InfallibleTArray<Maybe<ComputedTimingFunction>>& functions =
data->mFunctions;
InfallibleTArray<RefPtr<RawServoAnimationValue>>& startValues =
data->mStartValues;
InfallibleTArray<RefPtr<RawServoAnimationValue>>& endValues =
data->mEndValues;
--- a/gfx/layers/LayerTreeInvalidation.cpp
+++ b/gfx/layers/LayerTreeInvalidation.cpp
@@ -341,17 +341,17 @@ struct ContainerLayerProperties : public
{
explicit ContainerLayerProperties(ContainerLayer* aLayer)
: LayerPropertiesBase(aLayer)
, mPreXScale(aLayer->GetPreXScale())
, mPreYScale(aLayer->GetPreYScale())
{
for (Layer* child = aLayer->GetFirstChild(); child; child = child->GetNextSibling()) {
child->CheckCanary();
- mChildren.AppendElement(std::move(CloneLayerTreePropertiesInternal(child)));
+ mChildren.AppendElement(CloneLayerTreePropertiesInternal(child));
}
}
protected:
ContainerLayerProperties(const ContainerLayerProperties& a) = delete;
ContainerLayerProperties& operator=(const ContainerLayerProperties& a) = delete;
public:
--- a/gfx/layers/ipc/CompositorVsyncScheduler.cpp
+++ b/gfx/layers/ipc/CompositorVsyncScheduler.cpp
@@ -139,17 +139,17 @@ CompositorVsyncScheduler::PostVRTask(Tim
MonitorAutoLock lockVR(mCurrentVRListenerTaskMonitor);
if (mCurrentVRListenerTask == nullptr && VRListenerThreadHolder::Loop()) {
RefPtr<Runnable> task = NewRunnableMethod<TimeStamp>(
"layers::CompositorVsyncScheduler::DispatchVREvents",
this,
&CompositorVsyncScheduler::DispatchVREvents,
aTimestamp);
mCurrentVRListenerTask = task;
- VRListenerThreadHolder::Loop()->PostDelayedTask(std::move(task.forget()), 0);
+ VRListenerThreadHolder::Loop()->PostDelayedTask(task.forget(), 0);
}
}
void
CompositorVsyncScheduler::ScheduleComposition()
{
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
if (!mVsyncObserver) {
--- a/gfx/layers/ipc/UiCompositorControllerParent.cpp
+++ b/gfx/layers/ipc/UiCompositorControllerParent.cpp
@@ -24,17 +24,17 @@ typedef CompositorBridgeParent::LayerTre
/* static */ RefPtr<UiCompositorControllerParent>
UiCompositorControllerParent::GetFromRootLayerTreeId(const LayersId& aRootLayerTreeId)
{
RefPtr<UiCompositorControllerParent> controller;
CompositorBridgeParent::CallWithIndirectShadowTree(aRootLayerTreeId,
[&](LayerTreeState& aState) -> void {
controller = aState.mUiControllerParent;
});
- return std::move(controller);
+ return controller;
}
/* static */ RefPtr<UiCompositorControllerParent>
UiCompositorControllerParent::Start(const LayersId& aRootLayerTreeId, Endpoint<PUiCompositorControllerParent>&& aEndpoint)
{
RefPtr<UiCompositorControllerParent> parent = new UiCompositorControllerParent(aRootLayerTreeId);
RefPtr<Runnable> task =
--- a/gfx/layers/wr/WebRenderCommandBuilder.cpp
+++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp
@@ -1538,17 +1538,17 @@ PaintByLayer(nsDisplayItem* aItem,
nsDisplayListBuilder* aDisplayListBuilder,
const RefPtr<BasicLayerManager>& aManager,
gfxContext* aContext,
const gfx::Size& aScale,
const std::function<void()>& aPaintFunc)
{
UniquePtr<LayerProperties> props;
if (aManager->GetRoot()) {
- props = std::move(LayerProperties::CloneFrom(aManager->GetRoot()));
+ props = LayerProperties::CloneFrom(aManager->GetRoot());
}
FrameLayerBuilder* layerBuilder = new FrameLayerBuilder();
layerBuilder->Init(aDisplayListBuilder, aManager, nullptr, true);
layerBuilder->DidBeginRetainedLayerTransaction(aManager);
aManager->SetDefaultTarget(aContext);
aManager->BeginTransactionWithTarget(aContext);
bool isInvalidated = false;
--- a/gfx/thebes/gfxFont.cpp
+++ b/gfx/thebes/gfxFont.cpp
@@ -2549,17 +2549,17 @@ gfxFont::Measure(const gfxTextRun *aText
{
// If aBoundingBoxType is TIGHT_HINTED_OUTLINE_EXTENTS
// and the underlying cairo font may be antialiased,
// we need to create a copy in order to avoid getting cached extents.
// This is only used by MathML layout at present.
if (aBoundingBoxType == TIGHT_HINTED_OUTLINE_EXTENTS &&
mAntialiasOption != kAntialiasNone) {
if (!mNonAAFont) {
- mNonAAFont = std::move(CopyWithAntialiasOption(kAntialiasNone));
+ mNonAAFont = CopyWithAntialiasOption(kAntialiasNone);
}
// if font subclass doesn't implement CopyWithAntialiasOption(),
// it will return null and we'll proceed to use the existing font
if (mNonAAFont) {
return mNonAAFont->Measure(aTextRun, aStart, aEnd,
TIGHT_HINTED_OUTLINE_EXTENTS,
aRefDrawTarget, aSpacing, aOrientation);
}
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -1829,17 +1829,17 @@ gfxPlatform::GetBackendPrefs() const
data.mContentBitmask = BackendTypeBit(BackendType::CAIRO);
#ifdef USE_SKIA
data.mCanvasBitmask |= BackendTypeBit(BackendType::SKIA);
data.mContentBitmask |= BackendTypeBit(BackendType::SKIA);
#endif
data.mCanvasDefault = BackendType::CAIRO;
data.mContentDefault = BackendType::CAIRO;
- return std::move(data);
+ return data;
}
void
gfxPlatform::InitBackendPrefs(BackendPrefsData&& aPrefsData)
{
mPreferredCanvasBackend = GetCanvasBackendPref(aPrefsData.mCanvasBitmask);
if (mPreferredCanvasBackend == BackendType::NONE) {
mPreferredCanvasBackend = aPrefsData.mCanvasDefault;
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -98,17 +98,17 @@ gfxPlatformMac::GetBackendPrefs() const
{
BackendPrefsData data;
data.mCanvasBitmask = BackendTypeBit(BackendType::SKIA);
data.mContentBitmask = BackendTypeBit(BackendType::SKIA);
data.mCanvasDefault = BackendType::SKIA;
data.mContentDefault = BackendType::SKIA;
- return std::move(data);
+ return data;
}
bool
gfxPlatformMac::UsesTiling() const
{
// The non-tiling ContentClient requires CrossProcessSemaphore which
// isn't implemented for OSX.
return true;
--- a/image/decoders/nsICODecoder.cpp
+++ b/image/decoders/nsICODecoder.cpp
@@ -198,17 +198,17 @@ LexerTransition<ICOState>
nsICODecoder::IterateUnsizedDirEntry()
{
MOZ_ASSERT(!mUnsizedDirEntries.IsEmpty());
if (!mDirEntry) {
// The first time we are here, there is no entry selected. We must prepare a
// new iterator for the contained decoder to advance as it wills. Cloning at
// this point ensures it will begin at the end of the dir entries.
- mReturnIterator = std::move(mLexer.Clone(*mIterator, SIZE_MAX));
+ mReturnIterator = mLexer.Clone(*mIterator, SIZE_MAX);
if (mReturnIterator.isNothing()) {
// If we cannot read further than this point, then there is no resource
// data to read.
return Transition::TerminateFailure();
}
} else {
// We have already selected an entry which means a metadata decoder has
// finished. Verify the size is valid and if so, add to the discovered
@@ -218,17 +218,17 @@ nsICODecoder::IterateUnsizedDirEntry()
}
// Remove the entry from the unsized list either way.
mDirEntry = nullptr;
mUnsizedDirEntries.RemoveElementAt(0);
// Our iterator is at an unknown point, so reset it to the point that we
// saved.
- mIterator = std::move(mLexer.Clone(*mReturnIterator, SIZE_MAX));
+ mIterator = mLexer.Clone(*mReturnIterator, SIZE_MAX);
if (mIterator.isNothing()) {
MOZ_ASSERT_UNREACHABLE("Cannot re-clone return iterator");
return Transition::TerminateFailure();
}
}
// There are no more unsized entries, so we can finally decide which entry to
// select for decoding.
--- a/image/test/gtest/TestADAM7InterpolatingFilter.cpp
+++ b/image/test/gtest/TestADAM7InterpolatingFilter.cpp
@@ -236,18 +236,18 @@ WriteUninterpolatedPixels(SurfaceFilter*
uint8_t aPass,
const vector<BGRAColor>& aColors)
{
WriteState result = WriteState::NEED_MORE_DATA;
for (int32_t row = 0; row < aSize.height; ++row) {
// Compute uninterpolated pixels for this row.
vector<BGRAColor> pixels =
- std::move(ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
- ShouldInterpolate::eNo, aColors));
+ ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
+ ShouldInterpolate::eNo, aColors);
// Write them to the surface.
auto pixelIterator = pixels.cbegin();
result = aFilter->WritePixelsToRow<uint32_t>([&]{
return AsVariant((*pixelIterator++).AsPixel());
});
if (result != WriteState::NEED_MORE_DATA) {
@@ -270,18 +270,18 @@ CheckHorizontallyInterpolatedImage(Decod
for (int32_t row = 0; row < aSize.height; ++row) {
if (!IsImportantRow(row, aPass)) {
continue; // Don't check rows which aren't important on this pass.
}
// Compute the expected pixels, *with* interpolation to match what the
// filter should have done.
vector<BGRAColor> expectedPixels =
- std::move(ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
- ShouldInterpolate::eYes, aColors));
+ ADAM7HorizontallyInterpolatedRow(aPass, row, aSize.width,
+ ShouldInterpolate::eYes, aColors);
if (!RowHasPixels(surface, row, expectedPixels)) {
return false;
}
}
return true;
}
--- a/image/test/gtest/TestAnimationFrameBuffer.cpp
+++ b/image/test/gtest/TestAnimationFrameBuffer.cpp
@@ -23,17 +23,17 @@ CreateEmptyFrame()
}
static bool
Fill(AnimationFrameBuffer& buffer, size_t aLength)
{
bool keepDecoding = false;
for (size_t i = 0; i < aLength; ++i) {
RawAccessFrameRef frame = CreateEmptyFrame();
- keepDecoding = buffer.Insert(std::move(frame->RawAccessRef()));
+ keepDecoding = buffer.Insert(frame->RawAccessRef());
}
return keepDecoding;
}
static void
CheckFrames(const AnimationFrameBuffer& buffer, size_t aStart, size_t aEnd, bool aExpected)
{
for (size_t i = aStart; i < aEnd; ++i) {
@@ -128,17 +128,17 @@ TEST_F(ImageAnimationFrameBuffer, Finish
buffer.Initialize(kThreshold, kBatch, 0);
const auto& frames = buffer.Frames();
EXPECT_EQ(kBatch * 2, buffer.PendingDecode());
RawAccessFrameRef firstFrame;
for (size_t i = 0; i < 5; ++i) {
RawAccessFrameRef frame = CreateEmptyFrame();
- bool keepDecoding = buffer.Insert(std::move(frame->RawAccessRef()));
+ bool keepDecoding = buffer.Insert(frame->RawAccessRef());
EXPECT_TRUE(keepDecoding);
EXPECT_FALSE(buffer.SizeKnown());
if (i == 4) {
EXPECT_EQ(size_t(15), buffer.PendingDecode());
keepDecoding = buffer.MarkComplete();
EXPECT_FALSE(keepDecoding);
EXPECT_TRUE(buffer.SizeKnown());
--- a/image/test/gtest/TestSourceBuffer.cpp
+++ b/image/test/gtest/TestSourceBuffer.cpp
@@ -608,30 +608,32 @@ TEST_F(ImageSourceBuffer, SourceBufferIt
auto GetIterator = [&]{
SourceBufferIterator lambdaIterator = mSourceBuffer->Iterator();
CheckedAdvanceIterator(lambdaIterator, chunkLength);
return lambdaIterator;
};
// Move-construct |movedIterator| from the iterator returned from
// GetIterator() and check that its state is as we expect.
- SourceBufferIterator movedIterator = std::move(GetIterator());
+ SourceBufferIterator tmpIterator = GetIterator();
+ SourceBufferIterator movedIterator(std::move(tmpIterator));
EXPECT_TRUE(movedIterator.Data());
EXPECT_EQ(chunkLength, movedIterator.Length());
ExpectChunkAndByteCount(movedIterator, 1, chunkLength);
// Make sure that we can advance the iterator.
CheckedAdvanceIterator(movedIterator, chunkLength, 2, totalLength);
// Make sure that the iterator handles completion properly.
CheckIteratorIsComplete(movedIterator, 2, totalLength);
// Move-assign |movedIterator| from the iterator returned from
// GetIterator() and check that its state is as we expect.
- movedIterator = std::move(GetIterator());
+ tmpIterator = GetIterator();
+ movedIterator = std::move(tmpIterator);
EXPECT_TRUE(movedIterator.Data());
EXPECT_EQ(chunkLength, movedIterator.Length());
ExpectChunkAndByteCount(movedIterator, 1, chunkLength);
// Make sure that we can advance the iterator.
CheckedAdvanceIterator(movedIterator, chunkLength, 2, totalLength);
// Make sure that the iterator handles completion properly.
--- a/image/test/gtest/TestSurfacePipeIntegration.cpp
+++ b/image/test/gtest/TestSurfacePipeIntegration.cpp
@@ -21,17 +21,17 @@ namespace mozilla {
namespace image {
class TestSurfacePipeFactory
{
public:
static SurfacePipe SimpleSurfacePipe()
{
SurfacePipe pipe;
- return std::move(pipe);
+ return pipe;
}
template <typename T>
static SurfacePipe SurfacePipeFromPipeline(T&& aPipeline)
{
return SurfacePipe { std::move(aPipeline) };
}
--- a/js/src/builtin/TestingFunctions.cpp
+++ b/js/src/builtin/TestingFunctions.cpp
@@ -3522,17 +3522,17 @@ struct FindPathHandler {
if (!first)
return true;
// Record how we reached this node. This is the last edge on a
// shortest path to this node.
EdgeName edgeName = DuplicateString(cx, edge.name.get());
if (!edgeName)
return false;
- *backEdge = std::move(BackEdge(origin, std::move(edgeName)));
+ *backEdge = BackEdge(origin, std::move(edgeName));
// Have we reached our final target node?
if (edge.referent == target) {
// Record the path that got us here, which must be a shortest path.
if (!recordPath(traversal))
return false;
foundPath = true;
traversal.stop();
--- a/js/src/ctypes/CTypes.cpp
+++ b/js/src/ctypes/CTypes.cpp
@@ -5753,17 +5753,17 @@ ArrayType::BuildFFIType(JSContext* cx, J
JS_ReportAllocationOverflow(cx);
return nullptr;
}
for (size_t i = 0; i < length; ++i)
ffiType->elements[i] = ffiBaseType;
ffiType->elements[length] = nullptr;
- return std::move(ffiType);
+ return ffiType;
}
bool
ArrayType::IsArrayType(HandleValue v)
{
if (!v.isObject())
return false;
JSObject* obj = &v.toObject();
@@ -6301,17 +6301,17 @@ StructType::BuildFFIType(JSContext* cx,
// Fill in the ffi_type's size and align fields. This makes libffi treat the
// type as initialized; it will not recompute the values. (We assume
// everything agrees; if it doesn't, we really want to know about it, which
// is the purpose of the above debug-only check.)
ffiType->size = structSize;
ffiType->alignment = structAlign;
#endif
- return std::move(ffiType);
+ return ffiType;
}
bool
StructType::Define(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
RootedObject obj(cx, GetThisObject(cx, args, "StructType.prototype.define"));
if (!obj)
--- a/js/src/ds/LifoAlloc.cpp
+++ b/js/src/ds/LifoAlloc.cpp
@@ -46,21 +46,21 @@ BumpChunk::canAlloc(size_t n)
} // namespace detail
} // namespace js
void
LifoAlloc::freeAll()
{
while (!chunks_.empty()) {
- BumpChunk bc = std::move(chunks_.popFirst());
+ BumpChunk bc = chunks_.popFirst();
decrementCurSize(bc->computedSizeOfIncludingThis());
}
while (!unused_.empty()) {
- BumpChunk bc = std::move(unused_.popFirst());
+ BumpChunk bc = unused_.popFirst();
decrementCurSize(bc->computedSizeOfIncludingThis());
}
// Nb: maintaining curSize_ correctly isn't easy. Fortunately, this is an
// excellent sanity check.
MOZ_ASSERT(curSize_ == 0);
}
@@ -100,27 +100,27 @@ LifoAlloc::newChunkWithCapacity(size_t n
bool
LifoAlloc::getOrCreateChunk(size_t n)
{
// Look for existing unused BumpChunks to satisfy the request, and pick the
// first one which is large enough, and move it into the list of used
// chunks.
if (!unused_.empty()) {
if (unused_.begin()->canAlloc(n)) {
- chunks_.append(std::move(unused_.popFirst()));
+ chunks_.append(unused_.popFirst());
return true;
}
BumpChunkList::Iterator e(unused_.end());
for (BumpChunkList::Iterator i(unused_.begin()); i->next() != e.get(); ++i) {
detail::BumpChunk* elem = i->next();
MOZ_ASSERT(elem->empty());
if (elem->canAlloc(n)) {
- BumpChunkList temp = std::move(unused_.splitAfter(i.get()));
- chunks_.append(std::move(temp.popFirst()));
+ BumpChunkList temp = unused_.splitAfter(i.get());
+ chunks_.append(temp.popFirst());
unused_.appendAll(std::move(temp));
return true;
}
}
}
// Allocate a new BumpChunk with enough space for the next allocation.
BumpChunk newChunk = newChunkWithCapacity(n);
--- a/js/src/ds/LifoAlloc.h
+++ b/js/src/ds/LifoAlloc.h
@@ -706,17 +706,17 @@ class LifoAlloc
void release(Mark mark) {
markCount--;
// Move the blocks which are after the mark to the set of unused chunks.
BumpChunkList released;
if (!mark.markedChunk())
released = std::move(chunks_);
else
- released = std::move(chunks_.splitAfter(mark.markedChunk()));
+ released = chunks_.splitAfter(mark.markedChunk());
// Release the content of all the blocks which are after the marks.
for (detail::BumpChunk& bc : released)
bc.release();
unused_.appendAll(std::move(released));
// Release everything which follows the mark in the last chunk.
if (!chunks_.empty())
--- a/js/src/vm/CodeCoverage.cpp
+++ b/js/src/vm/CodeCoverage.cpp
@@ -511,17 +511,17 @@ LCovRealm::lookupOrAdd(JS::Realm* realm,
char* source_name = js_strdup(name);
if (!source_name) {
outTN_.reportOutOfMemory();
return nullptr;
}
// Allocate a new LCovSource for the current top-level.
- if (!sources_->append(std::move(LCovSource(&alloc_, source_name)))) {
+ if (!sources_->append(LCovSource(&alloc_, source_name))) {
outTN_.reportOutOfMemory();
return nullptr;
}
return &sources_->back();
}
void
--- a/js/src/vm/UbiNode.cpp
+++ b/js/src/vm/UbiNode.cpp
@@ -262,17 +262,17 @@ class EdgeVectorTracer : public JS::Call
name16[i] = name[i];
name16[i] = '\0';
}
// The simplest code is correct! The temporary Edge takes
// ownership of name; if the append succeeds, the vector element
// then takes ownership; if the append fails, then the temporary
// retains it, and its destructor will free it.
- if (!vec->append(std::move(Edge(name16, Node(thing))))) {
+ if (!vec->append(Edge(name16, Node(thing)))) {
okay = false;
return;
}
}
public:
// True if no errors (OOM, say) have yet occurred.
bool okay;
@@ -543,17 +543,17 @@ RootList::addRoot(Node node, const char1
UniqueTwoByteChars name;
if (edgeName) {
name = js::DuplicateString(edgeName);
if (!name)
return false;
}
- return edges.append(std::move(Edge(name.release(), node)));
+ return edges.append(Edge(name.release(), node));
}
const char16_t Concrete<RootList>::concreteTypeName[] = u"JS::ubi::RootList";
UniquePtr<EdgeRange>
Concrete<RootList>::edges(JSContext* cx, bool wantNames) const {
MOZ_ASSERT_IF(wantNames, get().wantNames);
return UniquePtr<EdgeRange>(js_new<PreComputedEdgeRange>(get().edges));
--- a/js/src/vm/UbiNodeShortestPaths.cpp
+++ b/js/src/vm/UbiNodeShortestPaths.cpp
@@ -23,17 +23,17 @@ BackEdge::clone() const
return nullptr;
clone->predecessor_ = predecessor();
if (name()) {
clone->name_ = js::DuplicateString(name().get());
if (!clone->name_)
return nullptr;
}
- return std::move(clone);
+ return clone;
}
#ifdef DEBUG
static void
dumpNode(const JS::ubi::Node& node)
{
fprintf(stderr, " %p ", (void*) node.identifier());
--- a/js/src/wasm/WasmValidate.cpp
+++ b/js/src/wasm/WasmValidate.cpp
@@ -1596,17 +1596,17 @@ DecodeExportName(Decoder& d, CStringSet*
if (p) {
d.fail("duplicate export");
return nullptr;
}
if (!dupSet->add(p, exportName.get()))
return nullptr;
- return std::move(exportName);
+ return exportName;
}
static bool
DecodeExport(Decoder& d, ModuleEnvironment* env, CStringSet* dupSet)
{
UniqueChars fieldName = DecodeExportName(d, dupSet);
if (!fieldName)
return false;
--- a/js/xpconnect/loader/URLPreloader.cpp
+++ b/js/xpconnect/loader/URLPreloader.cpp
@@ -619,21 +619,21 @@ URLPreloader::ShallowSizeOfIncludingThis
Result<FileLocation, nsresult>
URLPreloader::CacheKey::ToFileLocation()
{
if (mType == TypeFile) {
nsCOMPtr<nsIFile> file;
MOZ_TRY(NS_NewLocalFile(NS_ConvertUTF8toUTF16(mPath), false,
getter_AddRefs(file)));
- return std::move(FileLocation(file));
+ return FileLocation(file);
}
RefPtr<nsZipArchive> zip = Archive();
- return std::move(FileLocation(zip, mPath.get()));
+ return FileLocation(zip, mPath.get());
}
Result<const nsCString, nsresult>
URLPreloader::URLEntry::Read()
{
FileLocation location;
MOZ_TRY_VAR(location, ToFileLocation());
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -6248,17 +6248,17 @@ PresShell::Paint(nsView* aViewTo
bool computeInvalidRect = computeInvalidFunc ||
(layerManager->GetBackendType() == LayersBackend::LAYERS_BASIC);
UniquePtr<LayerProperties> props;
// For WR, the layermanager has no root layer. We want to avoid
// calling ComputeDifferences in that case because it assumes non-null
// and crashes.
if (computeInvalidRect && layerManager->GetRoot()) {
- props = std::move(LayerProperties::CloneFrom(layerManager->GetRoot()));
+ props = LayerProperties::CloneFrom(layerManager->GetRoot());
}
MaybeSetupTransactionIdAllocator(layerManager, presContext);
if (layerManager->EndEmptyTransaction((aFlags & PAINT_COMPOSITE) ?
LayerManager::END_DEFAULT : LayerManager::END_NO_COMPOSITE)) {
nsIntRegion invalid;
bool areaOverflowed = false;
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -6613,18 +6613,18 @@ FrameLayerBuilder::DrawPaintedLayer(Pain
FlashPaint(aContext);
}
if (presContext->GetDocShell() && isActiveLayerManager) {
nsDocShell* docShell = static_cast<nsDocShell*>(presContext->GetDocShell());
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (timelines && timelines->HasConsumer(docShell)) {
- timelines->AddMarkerForDocShell(docShell, std::move(
- MakeUnique<LayerTimelineMarker>(aRegionToDraw)));
+ timelines->AddMarkerForDocShell(docShell,
+ MakeUnique<LayerTimelineMarker>(aRegionToDraw));
}
}
if (!aRegionToInvalidate.IsEmpty()) {
aLayer->AddInvalidRect(aRegionToInvalidate.GetBounds());
}
}
--- a/layout/painting/RetainedDisplayListBuilder.cpp
+++ b/layout/painting/RetainedDisplayListBuilder.cpp
@@ -509,17 +509,17 @@ RetainedDisplayListBuilder::MergeDisplay
{
MergeState merge(this, *aOldList, aOuterKey);
Maybe<MergedListIndex> previousItemIndex;
while (nsDisplayItem* item = aNewList->RemoveBottom()) {
previousItemIndex = Some(merge.ProcessItemFromNewList(item, previousItemIndex));
}
- *aOutList = std::move(merge.Finalize());
+ *aOutList = merge.Finalize();
aOutContainerASR = merge.mContainerASR;
return merge.mResultIsModified;
}
static void
TakeAndAddModifiedAndFramesWithPropsFromRootFrame(
nsTArray<nsIFrame*>* aModifiedFrames,
nsTArray<nsIFrame*>* aFramesWithProps,
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -2728,17 +2728,17 @@ already_AddRefed<LayerManager> nsDisplay
UniquePtr<LayerProperties> props;
bool computeInvalidRect = (computeInvalidFunc ||
(!layerManager->IsCompositingCheap() && layerManager->NeedsWidgetInvalidation())) &&
widgetTransaction;
if (computeInvalidRect) {
- props = std::move(LayerProperties::CloneFrom(layerManager->GetRoot()));
+ props = LayerProperties::CloneFrom(layerManager->GetRoot());
}
if (doBeginTransaction) {
if (aCtx) {
if (!layerManager->BeginTransactionWithTarget(aCtx)) {
return nullptr;
}
} else {
--- a/layout/style/StyleSheet.cpp
+++ b/layout/style/StyleSheet.cpp
@@ -1041,17 +1041,17 @@ StyleSheet::ParseSheet(css::Loader* aLoa
Servo_StyleSheet_FromUTF8BytesAsync(loadDataHolder,
Inner().mURLData,
&aBytes,
mParsingMode,
aLoadData->mLineNumber,
aLoader->GetCompatibilityMode());
}
- return std::move(p);
+ return p;
}
void
StyleSheet::FinishAsyncParse(already_AddRefed<RawServoStyleSheetContents> aSheetContents)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(!mParsePromise.IsEmpty());
Inner().mContents = aSheetContents;
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -601,17 +601,17 @@ AppendKeyframe(double aOffset,
{
Keyframe& frame = *aKeyframes.AppendElement();
frame.mOffset.emplace(aOffset);
if (aValue.mServo) {
RefPtr<RawServoDeclarationBlock> decl =
Servo_AnimationValue_Uncompute(aValue.mServo).Consume();
frame.mPropertyValues.AppendElement(
- std::move(PropertyValuePair(aProperty, std::move(decl))));
+ PropertyValuePair(aProperty, std::move(decl)));
} else {
MOZ_CRASH("old style system disabled");
}
return frame;
}
static nsTArray<Keyframe>
GetTransitionKeyframes(nsCSSPropertyID aProperty,
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -1506,39 +1506,39 @@ class NewSdpTest : public ::testing::Tes
public ::testing::WithParamInterface<
::testing::tuple<bool, bool> > {
public:
NewSdpTest() {}
void ParseSdp(const std::string &sdp, bool expectSuccess = true) {
if (::testing::get<1>(GetParam())) {
mSdpErrorHolder = &mSipccParser;
- mSdp = std::move(mSipccParser.Parse(sdp));
+ mSdp = mSipccParser.Parse(sdp);
} else {
mSdpErrorHolder = &mRustParser;
- mSdp = std::move(mRustParser.Parse(sdp));
+ mSdp = mRustParser.Parse(sdp);
}
// Are we configured to do a parse and serialize before actually
// running the test?
if (::testing::get<0>(GetParam())) {
std::stringstream os;
if (expectSuccess) {
ASSERT_TRUE(!!mSdp) << "Parse failed on first pass: "
<< GetParseErrors();
}
if (mSdp) {
// Serialize and re-parse
mSdp->Serialize(os);
if (::testing::get<1>(GetParam())) {
- mSdp = std::move(mSipccParser.Parse(os.str()));
+ mSdp = mSipccParser.Parse(os.str());
} else {
- mSdp = std::move(mRustParser.Parse(os.str()));
+ mSdp = mRustParser.Parse(os.str());
}
// Whether we expected the parse to work or not, it should
// succeed the second time if it succeeded the first.
ASSERT_TRUE(!!mSdp) << "Parse failed on second pass, SDP was: "
<< std::endl << os.str() << std::endl
<< "Errors were: " << GetParseErrors();
--- a/mfbt/tests/TestUniquePtr.cpp
+++ b/mfbt/tests/TestUniquePtr.cpp
@@ -70,17 +70,17 @@ ReturnUniqueA()
{
return UniqueA(new B);
}
static UniqueA
ReturnLocalA()
{
UniqueA a(new A);
- return std::move(a);
+ return a;
}
static void
TestDeleterType()
{
// Make sure UniquePtr will use its deleter's pointer type if it defines one.
typedef int* Ptr;
struct Deleter {
@@ -363,17 +363,17 @@ SetMallocedInt(UniquePtr<int, FreeSignat
}
static UniquePtr<int, FreeSignature>
MallocedInt(int aI)
{
UniquePtr<int, FreeSignature>
ptr(static_cast<int*>(malloc(sizeof(int))), free);
*ptr = aI;
- return std::move(ptr);
+ return ptr;
}
static bool
TestFunctionReferenceDeleter()
{
// Look for allocator mismatches and leaks to verify these bits
UniquePtr<int, FreeSignature> i1(MallocedInt(17));
CHECK(*i1 == 17);
--- a/security/certverifier/tests/gtest/CTSerializationTest.cpp
+++ b/security/certverifier/tests/gtest/CTSerializationTest.cpp
@@ -178,18 +178,18 @@ TEST_F(CTSerializationTest, FailsDecodin
}
TEST_F(CTSerializationTest, EncodesSCTList)
{
const uint8_t SCT_1[] = { 0x61, 0x62, 0x63 };
const uint8_t SCT_2[] = { 0x64, 0x65, 0x66 };
Vector<Input> list;
- ASSERT_TRUE(list.append(std::move(Input(SCT_1))));
- ASSERT_TRUE(list.append(std::move(Input(SCT_2))));
+ ASSERT_TRUE(list.append(Input(SCT_1)));
+ ASSERT_TRUE(list.append(Input(SCT_2)));
Buffer encodedList;
ASSERT_EQ(Success, EncodeSCTList(list, encodedList));
Reader listReader;
ASSERT_EQ(Success, DecodeSCTList(InputForBuffer(encodedList), listReader));
Input decoded1;
--- a/security/manager/ssl/nsPKCS12Blob.cpp
+++ b/security/manager/ssl/nsPKCS12Blob.cpp
@@ -297,17 +297,17 @@ nsPKCS12Blob::newPKCS12FilePassword(uint
bool pressedOK = false;
rv = certDialogs->SetPKCS12FilePassword(mUIContext, password, &pressedOK);
if (NS_FAILED(rv)) {
return rv;
}
if (!pressedOK) {
return NS_OK;
}
- passwordBuffer = std::move(stringToBigEndianBytes(password, passwordBufferLength));
+ passwordBuffer = stringToBigEndianBytes(password, passwordBufferLength);
return NS_OK;
}
// Launch a dialog requesting the user for the password to a PKCS#12 file.
// Handle user canceled by returning null password (caller must catch).
nsresult
nsPKCS12Blob::getPKCS12FilePassword(uint32_t& passwordBufferLength,
UniquePtr<uint8_t[]>& passwordBuffer)
@@ -323,17 +323,17 @@ nsPKCS12Blob::getPKCS12FilePassword(uint
bool pressedOK = false;
rv = certDialogs->GetPKCS12FilePassword(mUIContext, password, &pressedOK);
if (NS_FAILED(rv)) {
return rv;
}
if (!pressedOK) {
return NS_OK;
}
- passwordBuffer = std::move(stringToBigEndianBytes(password, passwordBufferLength));
+ passwordBuffer = stringToBigEndianBytes(password, passwordBufferLength);
return NS_OK;
}
// Given a decoder, read bytes from file and input them to the decoder.
nsresult
nsPKCS12Blob::inputToDecoder(UniqueSEC_PKCS12DecoderContext& dcx, nsIFile* file,
PRErrorCode& nssError)
{
--- a/security/sandbox/linux/broker/SandboxBroker.cpp
+++ b/security/sandbox/linux/broker/SandboxBroker.cpp
@@ -72,17 +72,17 @@ SandboxBroker::Create(UniquePtr<const Po
// Can't use MakeUnique here because the constructor is private.
UniquePtr<SandboxBroker> rv(new SandboxBroker(std::move(aPolicy), aChildPid,
clientFd));
if (clientFd < 0) {
rv = nullptr;
} else {
aClientFdOut = ipc::FileDescriptor(clientFd);
}
- return std::move(rv);
+ return rv;
}
SandboxBroker::~SandboxBroker() {
// If the constructor failed, there's nothing to be done here.
if (mFileDesc < 0) {
return;
}
--- a/security/sandbox/linux/reporter/SandboxReporter.cpp
+++ b/security/sandbox/linux/reporter/SandboxReporter.cpp
@@ -284,16 +284,12 @@ SandboxReporter::GetSnapshot()
snapshot.mOffset = start;
snapshot.mReports.Clear();
snapshot.mReports.SetCapacity(mCount - start);
for (size_t i = start; i < mCount; ++i) {
const SandboxReport* rep = &mBuffer[i % kSandboxReporterBufferSize];
MOZ_ASSERT(rep->IsValid());
snapshot.mReports.AppendElement(*rep);
}
- // Named Return Value Optimization would apply here, but C++11
- // doesn't require it; so, instead of possibly copying the entire
- // array contents, invoke the move constructor and copy at most a
- // few words.
- return std::move(snapshot);
+ return snapshot;
}
} // namespace mozilla
--- a/toolkit/components/extensions/webrequest/WebRequestService.cpp
+++ b/toolkit/components/extensions/webrequest/WebRequestService.cpp
@@ -42,17 +42,17 @@ UniquePtr<WebRequestChannelEntry>
WebRequestService::RegisterChannel(ChannelWrapper* aChannel)
{
UniquePtr<ChannelEntry> entry(new ChannelEntry(aChannel));
auto key = mChannelEntries.LookupForAdd(entry->mChannelId);
MOZ_DIAGNOSTIC_ASSERT(!key);
key.OrInsert([&entry]() { return entry.get(); });
- return std::move(entry);
+ return entry;
}
already_AddRefed<nsITraceableChannel>
WebRequestService::GetTraceableChannel(uint64_t aChannelId,
nsAtom* aAddonId,
nsIContentParent* aContentParent)
{
--- a/toolkit/components/url-classifier/tests/gtest/TestClassifier.cpp
+++ b/toolkit/components/url-classifier/tests/gtest/TestClassifier.cpp
@@ -17,17 +17,17 @@ GetClassifier()
{
nsCOMPtr<nsIFile> file;
NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
UniquePtr<Classifier> classifier = MakeUnique<Classifier>();
nsresult rv = classifier->Open(*file);
EXPECT_TRUE(rv == NS_OK);
- return std::move(classifier);
+ return classifier;
}
static nsresult
SetupLookupCacheV4(Classifier* classifier,
const _PrefixArray& aPrefixArray,
const nsACString& aTable)
{
LookupCacheV4* lookupCache =
--- a/tools/profiler/core/platform.cpp
+++ b/tools/profiler/core/platform.cpp
@@ -1728,17 +1728,17 @@ CollectJavaThreadProfileData()
if (!frameName) {
break;
}
buffer->CollectCodeLocation("", frameName->ToCString().get(), -1,
Nothing());
}
sampleId++;
}
- return std::move(buffer);
+ return buffer;
}
#endif
static void
locked_profiler_stream_json_for_this_process(PSLockRef aLock,
SpliceableJSONWriter& aWriter,
double aSinceTime,
bool aIsShuttingDown)
--- a/widget/android/nsAppShell.h
+++ b/widget/android/nsAppShell.h
@@ -239,28 +239,28 @@ protected:
nsAppShell::RecordLatencies();
#endif
lock.Wait();
}
// Ownership of event object transfers to the return value.
mozilla::UniquePtr<Event> event(mQueue.popFirst());
if (!event || !event->mPostTime) {
- return std::move(event);
+ return event;
}
#ifdef EARLY_BETA_OR_EARLIER
const size_t latencyType = (event->ActivityType() ==
Event::Type::kUIActivity) ? LATENCY_UI : LATENCY_OTHER;
const uint64_t latency = Event::GetTime() - event->mPostTime;
sLatencyCount[latencyType]++;
sLatencyTime[latencyType] += latency;
#endif
- return std::move(event);
+ return event;
}
} mEventQueue;
mozilla::CondVar mSyncRunFinished;
bool mSyncRunQuit;
bool mAllowCoalescingTouches;
--- a/xpcom/tests/gtest/TestPLDHash.cpp
+++ b/xpcom/tests/gtest/TestPLDHash.cpp
@@ -192,17 +192,24 @@ static const PLDHashTableOps trivialOps
TEST(PLDHashTableTest, MoveSemantics)
{
PLDHashTable t1(&trivialOps, sizeof(PLDHashEntryStub));
t1.Add((const void*)88);
PLDHashTable t2(&trivialOps, sizeof(PLDHashEntryStub));
t2.Add((const void*)99);
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-move"
+#endif
t1 = std::move(t1); // self-move
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
t1 = std::move(t2); // empty overwritten with empty
PLDHashTable t3(&trivialOps, sizeof(PLDHashEntryStub));
PLDHashTable t4(&trivialOps, sizeof(PLDHashEntryStub));
t3.Add((const void*)88);
t3 = std::move(t4); // non-empty overwritten with empty
--- a/xpcom/tests/gtest/TestTArray.cpp
+++ b/xpcom/tests/gtest/TestTArray.cpp
@@ -133,18 +133,26 @@ TEST(TArray, Assign)
TEST(TArray, AssignmentOperatorSelfAssignment)
{
nsTArray<int> array;
array = DummyArray();
array = *&array;
ASSERT_EQ(DummyArray(), array);
- array = std::move(array);
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wself-move"
+#endif
+ array = std::move(array); // self-move
ASSERT_EQ(DummyArray(), array);
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
}
TEST(TArray, CopyOverlappingForwards)
{
const size_t rangeLength = 8;
const size_t initialLength = 2 * rangeLength;
uint32_t destructionCounters[initialLength];
nsTArray<Movable> array;