Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj

MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
This commit is contained in:
Miko Mynttinen 2018-06-01 17:59:07 +02:00
parent 835f7407b3
commit 8d9dc85cd4
88 changed files with 192 additions and 176 deletions

View File

@ -78,7 +78,7 @@ ProxyAccessible::RelationByType(RelationType aType) const
if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i]))
targets.AppendElement(proxy);
return std::move(targets);
return targets;
}
void

View File

@ -87,8 +87,8 @@ class DeserializedEdgeRange : public EdgeRange
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_ = &currentEdge;
}

View File

@ -2865,7 +2865,7 @@ nsDocShell::GetInitialClientInfo() const
if (mInitialClientSource) {
Maybe<ClientInfo> result;
result.emplace(mInitialClientSource->Info());
return std::move(result);
return result;
}
nsGlobalWindowInner* innerWindow =
@ -14067,10 +14067,10 @@ nsDocShell::NotifyJSRunToCompletionStart(const char* aReason,
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));
}
}

View File

@ -32,10 +32,10 @@ AutoRestyleTimelineMarker::AutoRestyleTimelineMarker(
}
mDocShell = aDocShell;
timelines->AddMarkerForDocShell(mDocShell, std::move(
timelines->AddMarkerForDocShell(mDocShell,
MakeUnique<RestyleTimelineMarker>(
mIsAnimationOnly,
MarkerTracingType::START)));
MarkerTracingType::START));
}
AutoRestyleTimelineMarker::~AutoRestyleTimelineMarker()
@ -51,10 +51,10 @@ AutoRestyleTimelineMarker::~AutoRestyleTimelineMarker()
return;
}
timelines->AddMarkerForDocShell(mDocShell, std::move(
timelines->AddMarkerForDocShell(mDocShell,
MakeUnique<RestyleTimelineMarker>(
mIsAnimationOnly,
MarkerTracingType::END)));
MarkerTracingType::END));
}
} // namespace mozilla

View File

@ -185,7 +185,7 @@ TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
{
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));
}
}
@ -198,7 +198,7 @@ TimelineConsumers::AddMarkerForDocShell(nsDocShell* aDocShell,
{
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));
}
}

View File

@ -90,7 +90,7 @@ public:
public:
explicit Iterator(EffectSet& aEffectSet)
: mEffectSet(aEffectSet)
, mHashIterator(std::move(aEffectSet.mEffects.Iter()))
, mHashIterator(aEffectSet.mEffects.Iter())
, mIsEndIterator(false)
{
#ifdef DEBUG

View File

@ -493,7 +493,7 @@ CustomElementRegistry::CreateCustomElementCallback(
if (aAdoptedCallbackArgs) {
callback->SetAdoptedCallbackArgs(*aAdoptedCallbackArgs);
}
return std::move(callback);
return callback;
}
/* static */ void

View File

@ -432,7 +432,7 @@ nsContentPermissionUtils::GetContentPermissionRequestParentById(const TabId& aTa
}
}
return std::move(parentArray);
return parentArray;
}
/* static */ void
@ -455,7 +455,7 @@ nsContentPermissionUtils::GetContentPermissionRequestChildById(const TabId& aTab
}
}
return std::move(childArray);
return childArray;
}
/* static */ void

View File

@ -5565,9 +5565,9 @@ nsIDocument::GetClientInfo() const
{
nsPIDOMWindowInner* inner = GetInnerWindow();
if (inner) {
return std::move(inner->GetClientInfo());
return inner->GetClientInfo();
}
return std::move(Maybe<ClientInfo>());
return Maybe<ClientInfo>();
}
Maybe<ClientState>
@ -5575,9 +5575,9 @@ nsIDocument::GetClientState() const
{
nsPIDOMWindowInner* inner = GetInnerWindow();
if (inner) {
return std::move(inner->GetClientState());
return inner->GetClientState();
}
return std::move(Maybe<ClientState>());
return Maybe<ClientState>();
}
Maybe<ServiceWorkerDescriptor>
@ -5585,9 +5585,9 @@ nsIDocument::GetController() const
{
nsPIDOMWindowInner* inner = GetInnerWindow();
if (inner) {
return std::move(inner->GetController());
return inner->GetController();
}
return std::move(Maybe<ServiceWorkerDescriptor>());
return Maybe<ServiceWorkerDescriptor>();
}
//

View File

@ -2320,25 +2320,25 @@ nsPIDOMWindowInner::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
@ -5498,7 +5498,7 @@ nsGlobalWindowInner::ShowSlowScriptDialog(const nsString& aAddonId)
// 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();
@ -6329,7 +6329,7 @@ nsGlobalWindowInner::GetClientInfo() const
if (mClientSource) {
clientInfo.emplace(mClientSource->Info());
}
return std::move(clientInfo);
return clientInfo;
}
Maybe<ClientState>
@ -6344,7 +6344,7 @@ nsGlobalWindowInner::GetClientState() const
clientState.emplace(state);
}
}
return std::move(clientState);
return clientState;
}
Maybe<ServiceWorkerDescriptor>
@ -6355,7 +6355,7 @@ nsGlobalWindowInner::GetController() const
if (mClientSource) {
controller = mClientSource->GetController();
}
return std::move(controller);
return controller;
}
RefPtr<ServiceWorker>

View File

@ -804,7 +804,7 @@ ImageBitmap::ToCloneData() const
result->mSurface = surface->GetDataSurface();
MOZ_ASSERT(result->mSurface);
return std::move(result);
return result;
}
/* static */ already_AddRefed<ImageBitmap>

View File

@ -827,7 +827,7 @@ FormatUsageAuthority::CreateForWebGL1(gl::GLContext* gl)
if (!AddUnsizedFormats(ptr, gl))
return nullptr;
return std::move(ret);
return ret;
}
UniquePtr<FormatUsageAuthority>
@ -1062,7 +1062,7 @@ FormatUsageAuthority::CreateForWebGL2(gl::GLContext* gl)
////////////////////////////////////
return std::move(ret);
return ret;
}
//////////////////////////////////////////////////////////////////////////////////////////

View File

@ -227,7 +227,7 @@ 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;
}
@ -460,7 +460,7 @@ ValidateTexOrSubImage(WebGLContext* webgl, const char* funcName, TexImageTarget
if (!blob || !blob->Validate(webgl, funcName, pi))
return nullptr;
return std::move(blob);
return blob;
}
void

View File

@ -203,7 +203,7 @@ ClientHandle::OnDetach()
}
RefPtr<GenericPromise> ref(mDetachPromise);
return std::move(ref);
return ref;
}
} // namespace dom

View File

@ -145,7 +145,7 @@ ClientInfo::GetPrincipal() const
{
MOZ_ASSERT(NS_IsMainThread());
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(PrincipalInfo());
return std::move(ref);
return ref;
}
} // namespace dom

View File

@ -136,7 +136,7 @@ ClientManager::CreateSourceInternal(ClientType aType,
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());
@ -144,12 +144,12 @@ ClientManager::CreateSourceInternal(ClientType aType,
if (IsShutdown()) {
source->Shutdown();
return std::move(source);
return source;
}
source->Activate(GetActor());
return std::move(source);
return source;
}
already_AddRefed<ClientHandle>

View File

@ -438,8 +438,8 @@ ClientManagerService::MatchAll(const ClientMatchAllArgs& aArgs)
}
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.

View File

@ -2887,8 +2887,8 @@ Console::MonotonicTimer(JSContext* aCx, MethodName aMethodName,
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) {
@ -2903,10 +2903,10 @@ Console::MonotonicTimer(JSContext* aCx, MethodName aMethodName,
return false;
}
timelines->AddMarkerForDocShell(docShell, std::move(
timelines->AddMarkerForDocShell(docShell,
MakeUnique<ConsoleTimelineMarker>(
key, aMethodName == MethodTime ? MarkerTracingType::START
: MarkerTracingType::END)));
: MarkerTracingType::END));
}
return true;

View File

@ -1245,9 +1245,9 @@ EventListenerManager::HandleEventInternal(nsPresContext* aPresContext,
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));
}
}
}

View File

@ -546,7 +546,7 @@ private:
nsresult rv = svc->GetXpcomWillShutdown(getter_AddRefs(phase));
NS_ENSURE_SUCCESS(rv, nullptr);
return std::move(phase);
return phase;
}
nsCString mURI;

View File

@ -1164,7 +1164,7 @@ Geolocation::GetCurrentPosition(PositionCallback& aCallback,
{
nsresult rv = GetCurrentPosition(GeoPositionCallback(&aCallback),
GeoPositionErrorCallback(aErrorCallback),
std::move(CreatePositionOptionsCopy(aOptions)),
CreatePositionOptionsCopy(aOptions),
aCallerType);
if (NS_FAILED(rv)) {
@ -1242,7 +1242,7 @@ Geolocation::WatchPosition(PositionCallback& aCallback,
int32_t ret = 0;
nsresult rv = WatchPosition(GeoPositionCallback(&aCallback),
GeoPositionErrorCallback(aErrorCallback),
std::move(CreatePositionOptionsCopy(aOptions)),
CreatePositionOptionsCopy(aOptions),
aCallerType,
&ret);

View File

@ -4469,8 +4469,8 @@ ContentParent::RecvNotifyTabDestroying(const TabId& aTabId,
nsTArray<TabContext>
ContentParent::GetManagedTabContext()
{
return std::move(ContentProcessManager::GetSingleton()->
GetTabContextByContentProcess(this->ChildID()));
return ContentProcessManager::GetSingleton()->
GetTabContextByContentProcess(this->ChildID());
}
mozilla::docshell::POfflineCacheUpdateParent*

View File

@ -125,7 +125,7 @@ ContentProcessManager::GetAllChildProcessById(const ContentParentId& aParentCpId
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();
@ -134,7 +134,7 @@ ContentProcessManager::GetAllChildProcessById(const ContentParentId& aParentCpId
cpIdArray.AppendElement(*cpIter);
}
return std::move(cpIdArray);
return cpIdArray;
}
bool
@ -236,7 +236,7 @@ ContentProcessManager::GetTabContextByContentProcess(const ContentParentId& aChi
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();
@ -245,7 +245,7 @@ ContentProcessManager::GetTabContextByContentProcess(const ContentParentId& aChi
tabContextArray.AppendElement(remoteFrameIter->second.mContext);
}
return std::move(tabContextArray);
return tabContextArray;
}
bool
@ -337,7 +337,7 @@ ContentProcessManager::GetTabParentsByProcessId(const ContentParentId& aChildCpI
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();
@ -346,7 +346,7 @@ ContentProcessManager::GetTabParentsByProcessId(const ContentParentId& aChildCpI
tabIdList.AppendElement(remoteFrameIter->first);
}
return std::move(tabIdList);
return tabIdList;
}
uint32_t

View File

@ -2592,7 +2592,7 @@ MediaStream::SetTrackEnabledImpl(TrackID aTrackID, DisabledTrackMode aMode)
return;
}
}
mDisabledTracks.AppendElement(std::move(DisabledTrack(aTrackID, aMode)));
mDisabledTracks.AppendElement(DisabledTrack(aTrackID, aMode));
}
}

View File

@ -764,7 +764,7 @@ GetSupportedCapabilities(
// 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

View File

@ -1078,7 +1078,7 @@ ChromiumCDMParent::RecvDrainComplete()
MediaDataDecoder::DecodedData samples;
while (!mReorderQueue.IsEmpty()) {
samples.AppendElement(std::move(mReorderQueue.Pop()));
samples.AppendElement(mReorderQueue.Pop());
}
mDecodePromise.ResolveIfExists(std::move(samples), __func__);

View File

@ -946,7 +946,7 @@ already_AddRefed<GMPContentParent>
GMPParent::ForgetGMPContentParent()
{
MOZ_ASSERT(mGetContentParentPromises.IsEmpty());
return std::move(mGMPContentParent.forget());
return mGMPContentParent.forget();
}
bool

View File

@ -1885,7 +1885,7 @@ GMPServiceParent::ActorDestroy(ActorDestroyReason aWhy)
&GMPServiceParent::CloseTransport,
&monitor,
&completed);
XRE_GetIOMessageLoop()->PostTask(std::move(task.forget()));
XRE_GetIOMessageLoop()->PostTask(task.forget());
while (!completed) {
lock.Wait();

View File

@ -26,7 +26,7 @@ ToArray(const uint8_t* aData, uint32_t aDataSize)
{
nsTArray<uint8_t> data;
data.AppendElements(aData, aDataSize);
return std::move(data);
return data;
}
namespace mozilla {

View File

@ -44,7 +44,7 @@ VideoDecoderManagerParent::StoreImage(Image* aImage, TextureClient* aTexture)
mImageMap[ret.handle()] = aImage;
mTextureMap[ret.handle()] = aTexture;
return std::move(ret);
return ret;
}
StaticRefPtr<nsIThread> sVideoDecoderManagerThread;

View File

@ -257,7 +257,7 @@ AppleVTDecoder::ProcessDrain()
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__);
}

View File

@ -173,7 +173,7 @@ ConfigForMime(const nsACString& aMimeType)
conf.reset(new OmxAmrConfig<OmxAmrSampleRate::kWideBand>());
}
}
return std::move(conf);
return conf;
}
// There should be a better way to calculate it.
@ -231,7 +231,7 @@ ConfigForMime(const nsACString& aMimeType)
if (OmxPlatformLayer::SupportsMimeType(aMimeType)) {
conf.reset(new OmxCommonVideoConfig());
}
return std::move(conf);
return conf;
}
OMX_ERRORTYPE

View File

@ -103,7 +103,7 @@ ServiceWorkerDescriptor::GetPrincipal() const
{
AssertIsOnMainThread();
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo());
return std::move(ref);
return ref;
}
const nsCString&

View File

@ -324,7 +324,7 @@ ServiceWorkerManager::StartControllingClient(const ClientInfo& aClientInfo,
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) {
@ -334,14 +334,14 @@ ServiceWorkerManager::StartControllingClient(const ClientInfo& aClientInfo,
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();
@ -358,7 +358,7 @@ ServiceWorkerManager::StartControllingClient(const ClientInfo& aClientInfo,
Telemetry::Accumulate(Telemetry::SERVICE_WORKER_CONTROLLED_DOCUMENTS, 1);
return std::move(ref);
return ref;
}
void

View File

@ -1281,7 +1281,7 @@ ServiceWorkerRegistrar::GetShutdownPhase() const
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

View File

@ -27,7 +27,7 @@ ServiceWorkerRegistrationDescriptor::NewestInternal() const
} else if (mData->active().type() != OptionalIPCServiceWorkerDescriptor::Tvoid_t) {
result.emplace(mData->active().get_IPCServiceWorkerDescriptor());
}
return std::move(result);
return result;
}
ServiceWorkerRegistrationDescriptor::ServiceWorkerRegistrationDescriptor(
@ -138,7 +138,7 @@ ServiceWorkerRegistrationDescriptor::GetPrincipal() const
{
AssertIsOnMainThread();
nsCOMPtr<nsIPrincipal> ref = PrincipalInfoToPrincipal(mData->principalInfo());
return std::move(ref);
return ref;
}
const nsCString&
@ -157,7 +157,7 @@ ServiceWorkerRegistrationDescriptor::GetInstalling() const
mData->installing().get_IPCServiceWorkerDescriptor()));
}
return std::move(result);
return result;
}
Maybe<ServiceWorkerDescriptor>
@ -170,7 +170,7 @@ ServiceWorkerRegistrationDescriptor::GetWaiting() const
mData->waiting().get_IPCServiceWorkerDescriptor()));
}
return std::move(result);
return result;
}
Maybe<ServiceWorkerDescriptor>
@ -183,7 +183,7 @@ ServiceWorkerRegistrationDescriptor::GetActive() const
mData->active().get_IPCServiceWorkerDescriptor()));
}
return std::move(result);
return result;
}
Maybe<ServiceWorkerDescriptor>
@ -194,7 +194,7 @@ ServiceWorkerRegistrationDescriptor::Newest() const
if (newest.isSome()) {
result.emplace(ServiceWorkerDescriptor(newest.ref()));
}
return std::move(result);
return result;
}
namespace {

View File

@ -277,7 +277,7 @@ U2F::Register(const nsAString& aAppId,
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);
}
@ -423,7 +423,7 @@ U2F::Sign(const nsAString& aAppId,
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);
}

View File

@ -3497,10 +3497,10 @@ WorkerPrivate::GetClientInfo() const
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
@ -3510,7 +3510,7 @@ WorkerPrivate::GetClientState() const
MOZ_DIAGNOSTIC_ASSERT(mClientSource);
ClientState state;
mClientSource->SnapshotState(&state);
return std::move(state);
return state;
}
const Maybe<ServiceWorkerDescriptor>

View File

@ -548,7 +548,7 @@ WorkerGlobalScope::GetClientState() const
{
Maybe<ClientState> state;
state.emplace(mWorkerPrivate->GetClientState());
return std::move(state);
return state;
}
Maybe<ServiceWorkerDescriptor>

View File

@ -230,7 +230,7 @@ HTMLEditor::CreateAnonymousElement(nsAtom* aTag,
// display the element
ps->PostRecreateFramesFor(newContent);
return std::move(newContent);
return newContent;
}
// Removes event listener and calls DeleteRefToAnonymousNode.

View File

@ -6021,8 +6021,7 @@ HTMLEditRules::CreateStyleForInsertText(nsIDocument& aDocument)
}
// 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.
@ -6040,14 +6039,14 @@ HTMLEditRules::CreateStyleForInsertText(nsIDocument& aDocument)
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

View File

@ -145,7 +145,7 @@ HTMLEditor::CreateResizer(int16_t aLocation,
nsresult rv =
ret->SetAttr(kNameSpaceID_None, nsGkAtoms::anonlocation, locationStr, true);
NS_ENSURE_SUCCESS(rv, nullptr);
return std::move(ret);
return ret;
}
ManualNACPtr

View File

@ -39,7 +39,7 @@ RemoteSpellcheckEngineChild::SetCurrentDictionaryFromList(
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

View File

@ -139,7 +139,7 @@ SFNTData::Create(const uint8_t *aFontData, uint32_t aDataLength)
++offset;
}
return std::move(sfntData);
return sfntData;
}
UniquePtr<SFNTData> sfntData(new SFNTData);
@ -147,7 +147,7 @@ SFNTData::Create(const uint8_t *aFontData, uint32_t aDataLength)
return nullptr;
}
return std::move(sfntData);
return sfntData;
}
/* static */

View File

@ -48,7 +48,7 @@ GLScreenBuffer::Create(GLContext* gl,
if (caps.antialias &&
!gl->IsSupported(GLFeature::framebuffer_multisample))
{
return std::move(ret);
return ret;
}
layers::TextureFlags flags = layers::TextureFlags::ORIGIN_BOTTOM_LEFT;
@ -59,7 +59,7 @@ GLScreenBuffer::Create(GLContext* gl,
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>
@ -953,7 +953,7 @@ ReadBuffer::Create(GLContext* gl,
if (!isComplete)
return nullptr;
return std::move(ret);
return ret;
}
ReadBuffer::~ReadBuffer()

View File

@ -134,7 +134,7 @@ MozFramebuffer::CreateWith(GLContext* const gl, const gfx::IntSize& size,
return nullptr;
}
return std::move(mozFB);
return mozFB;
}
////////////////////

View File

@ -332,7 +332,7 @@ SurfaceFactory::NewTexClient(const gfx::IntSize& size)
StopRecycling(cur);
}
UniquePtr<SharedSurface> surf = std::move(CreateShared(size));
UniquePtr<SharedSurface> surf = CreateShared(size);
if (!surf)
return nullptr;

View File

@ -30,13 +30,13 @@ SharedSurface_EGLImage::Create(GLContext* prodGL,
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));
@ -45,12 +45,12 @@ SharedSurface_EGLImage::Create(GLContext* prodGL,
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
@ -177,7 +177,7 @@ SurfaceFactory_EGLImage::Create(GLContext* prodGL, const SurfaceCaps& caps,
ret.reset( new ptrT(prodGL, caps, allocator, flags, context) );
}
return std::move(ret);
return ret;
}
////////////////////////////////////////////////////////////////////////
@ -200,12 +200,12 @@ SharedSurface_SurfaceTexture::Create(GLContext* 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,
@ -292,7 +292,7 @@ SurfaceFactory_SurfaceTexture::Create(GLContext* prodGL, const SurfaceCaps& caps
{
UniquePtr<SurfaceFactory_SurfaceTexture> ret(
new SurfaceFactory_SurfaceTexture(prodGL, caps, allocator, flags));
return std::move(ret);
return ret;
}
UniquePtr<SharedSurface>

View File

@ -33,12 +33,12 @@ SharedSurface_Basic::Create(GLContext* gl,
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;
}
@ -51,7 +51,7 @@ SharedSurface_Basic::Wrap(GLContext* gl,
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,
@ -126,12 +126,12 @@ SharedSurface_GLTexture::Create(GLContext* prodGL,
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()

View File

@ -26,7 +26,7 @@ SharedSurface_IOSurface::Create(const RefPtr<MacIOSurface>& ioSurf,
typedef SharedSurface_IOSurface ptrT;
UniquePtr<ptrT> ret( new ptrT(ioSurf, gl, size, hasAlpha) );
return std::move(ret);
return ret;
}
void
@ -219,7 +219,7 @@ SurfaceFactory_IOSurface::Create(GLContext* gl, const SurfaceCaps& caps,
typedef SurfaceFactory_IOSurface ptrT;
UniquePtr<ptrT> ret( new ptrT(gl, caps, allocator, flags, maxDims) );
return std::move(ret);
return ret;
}
UniquePtr<SharedSurface>

View File

@ -113,7 +113,7 @@ CompositorAnimationStorage::SetAnimatedValue(uint64_t aId,
const TransformData dontCare = {};
SetAnimatedValue(aId,
std::move(aTransformInDevSpace),
std::move(gfx::Matrix4x4()),
gfx::Matrix4x4(),
dontCare);
}
@ -581,8 +581,8 @@ AnimationHelper::SetAnimations(
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;

View File

@ -346,7 +346,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase
{
for (Layer* child = aLayer->GetFirstChild(); child; child = child->GetNextSibling()) {
child->CheckCanary();
mChildren.AppendElement(std::move(CloneLayerTreePropertiesInternal(child)));
mChildren.AppendElement(CloneLayerTreePropertiesInternal(child));
}
}

View File

@ -144,7 +144,7 @@ CompositorVsyncScheduler::PostVRTask(TimeStamp aTimestamp)
&CompositorVsyncScheduler::DispatchVREvents,
aTimestamp);
mCurrentVRListenerTask = task;
VRListenerThreadHolder::Loop()->PostDelayedTask(std::move(task.forget()), 0);
VRListenerThreadHolder::Loop()->PostDelayedTask(task.forget(), 0);
}
}

View File

@ -29,7 +29,7 @@ UiCompositorControllerParent::GetFromRootLayerTreeId(const LayersId& aRootLayerT
[&](LayerTreeState& aState) -> void {
controller = aState.mUiControllerParent;
});
return std::move(controller);
return controller;
}
/* static */ RefPtr<UiCompositorControllerParent>

View File

@ -1543,7 +1543,7 @@ PaintByLayer(nsDisplayItem* aItem,
{
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);

View File

@ -2554,7 +2554,7 @@ gfxFont::Measure(const gfxTextRun *aTextRun,
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

View File

@ -1834,7 +1834,7 @@ gfxPlatform::GetBackendPrefs() const
data.mCanvasDefault = BackendType::CAIRO;
data.mContentDefault = BackendType::CAIRO;
return std::move(data);
return data;
}
void

View File

@ -103,7 +103,7 @@ gfxPlatformMac::GetBackendPrefs() const
data.mCanvasDefault = BackendType::SKIA;
data.mContentDefault = BackendType::SKIA;
return std::move(data);
return data;
}
bool

View File

@ -203,7 +203,7 @@ nsICODecoder::IterateUnsizedDirEntry()
// 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.
@ -223,7 +223,7 @@ nsICODecoder::IterateUnsizedDirEntry()
// 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();

View File

@ -241,8 +241,8 @@ WriteUninterpolatedPixels(SurfaceFilter* aFilter,
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();
@ -275,8 +275,8 @@ CheckHorizontallyInterpolatedImage(Decoder* aDecoder,
// 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;

View File

@ -28,7 +28,7 @@ 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;
}
@ -133,7 +133,7 @@ TEST_F(ImageAnimationFrameBuffer, FinishUnderBatchAndThreshold)
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());

View File

@ -613,7 +613,8 @@ TEST_F(ImageSourceBuffer, SourceBufferIteratorsCanBeMoved)
// 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);
@ -626,7 +627,8 @@ TEST_F(ImageSourceBuffer, SourceBufferIteratorsCanBeMoved)
// 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);

View File

@ -26,7 +26,7 @@ public:
static SurfacePipe SimpleSurfacePipe()
{
SurfacePipe pipe;
return std::move(pipe);
return pipe;
}
template <typename T>

View File

@ -3527,7 +3527,7 @@ struct FindPathHandler {
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) {

View File

@ -5758,7 +5758,7 @@ ArrayType::BuildFFIType(JSContext* cx, JSObject* obj)
ffiType->elements[i] = ffiBaseType;
ffiType->elements[length] = nullptr;
return std::move(ffiType);
return ffiType;
}
bool
@ -6306,7 +6306,7 @@ StructType::BuildFFIType(JSContext* cx, JSObject* obj)
ffiType->alignment = structAlign;
#endif
return std::move(ffiType);
return ffiType;
}
bool

View File

@ -51,11 +51,11 @@ 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());
}
@ -105,7 +105,7 @@ LifoAlloc::getOrCreateChunk(size_t n)
// chunks.
if (!unused_.empty()) {
if (unused_.begin()->canAlloc(n)) {
chunks_.append(std::move(unused_.popFirst()));
chunks_.append(unused_.popFirst());
return true;
}
@ -114,8 +114,8 @@ LifoAlloc::getOrCreateChunk(size_t n)
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;
}

View File

@ -711,7 +711,7 @@ class LifoAlloc
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)

View File

@ -516,7 +516,7 @@ LCovRealm::lookupOrAdd(JS::Realm* realm, const char* name)
}
// 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;
}

View File

@ -267,7 +267,7 @@ class EdgeVectorTracer : public JS::CallbackTracer {
// 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;
}
@ -548,7 +548,7 @@ RootList::addRoot(Node node, const char16_t* edgeName)
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";

View File

@ -28,7 +28,7 @@ BackEdge::clone() const
if (!clone->name_)
return nullptr;
}
return std::move(clone);
return clone;
}
#ifdef DEBUG

View File

@ -1601,7 +1601,7 @@ DecodeExportName(Decoder& d, CStringSet* dupSet)
if (!dupSet->add(p, exportName.get()))
return nullptr;
return std::move(exportName);
return exportName;
}
static bool

View File

@ -624,11 +624,11 @@ URLPreloader::CacheKey::ToFileLocation()
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>

View File

@ -6253,7 +6253,7 @@ PresShell::Paint(nsView* aViewToPaint,
// 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);

View File

@ -6618,8 +6618,8 @@ FrameLayerBuilder::DrawPaintedLayer(PaintedLayer* aLayer,
RefPtr<TimelineConsumers> timelines = TimelineConsumers::Get();
if (timelines && timelines->HasConsumer(docShell)) {
timelines->AddMarkerForDocShell(docShell, std::move(
MakeUnique<LayerTimelineMarker>(aRegionToDraw)));
timelines->AddMarkerForDocShell(docShell,
MakeUnique<LayerTimelineMarker>(aRegionToDraw));
}
}

View File

@ -514,7 +514,7 @@ RetainedDisplayListBuilder::MergeDisplayLists(nsDisplayList* aNewList,
previousItemIndex = Some(merge.ProcessItemFromNewList(item, previousItemIndex));
}
*aOutList = std::move(merge.Finalize());
*aOutList = merge.Finalize();
aOutContainerASR = merge.mContainerASR;
return merge.mResultIsModified;
}

View File

@ -2733,7 +2733,7 @@ already_AddRefed<LayerManager> nsDisplayList::PaintRoot(nsDisplayListBuilder* aB
widgetTransaction;
if (computeInvalidRect) {
props = std::move(LayerProperties::CloneFrom(layerManager->GetRoot()));
props = LayerProperties::CloneFrom(layerManager->GetRoot());
}
if (doBeginTransaction) {

View File

@ -1046,7 +1046,7 @@ StyleSheet::ParseSheet(css::Loader* aLoader,
aLoader->GetCompatibilityMode());
}
return std::move(p);
return p;
}
void

View File

@ -606,7 +606,7 @@ AppendKeyframe(double aOffset,
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");
}

View File

@ -1511,10 +1511,10 @@ class NewSdpTest : public ::testing::Test,
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
@ -1531,9 +1531,9 @@ class NewSdpTest : public ::testing::Test,
// 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

View File

@ -75,7 +75,7 @@ static UniqueA
ReturnLocalA()
{
UniqueA a(new A);
return std::move(a);
return a;
}
static void
@ -368,7 +368,7 @@ 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()

View File

@ -183,8 +183,8 @@ TEST_F(CTSerializationTest, EncodesSCTList)
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));

View File

@ -302,7 +302,7 @@ nsPKCS12Blob::newPKCS12FilePassword(uint32_t& passwordBufferLength,
if (!pressedOK) {
return NS_OK;
}
passwordBuffer = std::move(stringToBigEndianBytes(password, passwordBufferLength));
passwordBuffer = stringToBigEndianBytes(password, passwordBufferLength);
return NS_OK;
}
@ -328,7 +328,7 @@ nsPKCS12Blob::getPKCS12FilePassword(uint32_t& passwordBufferLength,
if (!pressedOK) {
return NS_OK;
}
passwordBuffer = std::move(stringToBigEndianBytes(password, passwordBufferLength));
passwordBuffer = stringToBigEndianBytes(password, passwordBufferLength);
return NS_OK;
}

View File

@ -47,7 +47,7 @@ WebRequestService::RegisterChannel(ChannelWrapper* aChannel)
MOZ_DIAGNOSTIC_ASSERT(!key);
key.OrInsert([&entry]() { return entry.get(); });
return std::move(entry);
return entry;
}

View File

@ -22,7 +22,7 @@ GetClassifier()
nsresult rv = classifier->Open(*file);
EXPECT_TRUE(rv == NS_OK);
return std::move(classifier);
return classifier;
}
static nsresult

View File

@ -1792,7 +1792,7 @@ CollectJavaThreadProfileData()
}
sampleId++;
}
return std::move(buffer);
return buffer;
}
#endif

View File

@ -244,7 +244,7 @@ protected:
// 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
@ -255,7 +255,7 @@ protected:
sLatencyCount[latencyType]++;
sLatencyTime[latencyType] += latency;
#endif
return std::move(event);
return event;
}
} mEventQueue;

View File

@ -197,7 +197,14 @@ TEST(PLDHashTableTest, MoveSemantics)
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

View File

@ -138,8 +138,16 @@ TEST(TArray, AssignmentOperatorSelfAssignment)
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)