Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj

Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
This commit is contained in:
Emilio Cobos Álvarez
2018-06-01 18:30:30 +02:00
parent 60c53c2aa9
commit 6100dee429
122 changed files with 409 additions and 439 deletions

View File

@@ -63,7 +63,7 @@ public:
private: private:
explicit xpcAccessibleTextRange(TextRange&& aRange) : explicit xpcAccessibleTextRange(TextRange&& aRange) :
mRange(Forward<TextRange>(aRange)) {} mRange(std::forward<TextRange>(aRange)) {}
xpcAccessibleTextRange() {} xpcAccessibleTextRange() {}
~xpcAccessibleTextRange() {} ~xpcAccessibleTextRange() {}

View File

@@ -918,13 +918,13 @@ class TwoByteString : public Variant<JSAtom*, const char16_t*, JS::ubi::EdgeName
public: public:
template<typename T> template<typename T>
MOZ_IMPLICIT TwoByteString(T&& rhs) : Base(Forward<T>(rhs)) { } MOZ_IMPLICIT TwoByteString(T&& rhs) : Base(std::forward<T>(rhs)) { }
template<typename T> template<typename T>
TwoByteString& operator=(T&& rhs) { TwoByteString& operator=(T&& rhs) {
MOZ_ASSERT(this != &rhs, "self-move disallowed"); MOZ_ASSERT(this != &rhs, "self-move disallowed");
this->~TwoByteString(); this->~TwoByteString();
new (this) TwoByteString(Forward<T>(rhs)); new (this) TwoByteString(std::forward<T>(rhs));
return *this; return *this;
} }

View File

@@ -13,7 +13,7 @@
#include "mozilla/AutoRestore.h" #include "mozilla/AutoRestore.h"
#include "mozilla/AsyncEventDispatcher.h" // For AsyncEventDispatcher #include "mozilla/AsyncEventDispatcher.h" // For AsyncEventDispatcher
#include "mozilla/Maybe.h" // For Maybe #include "mozilla/Maybe.h" // For Maybe
#include "mozilla/TypeTraits.h" // For Forward<> #include "mozilla/TypeTraits.h" // For std::forward<>
#include "nsAnimationManager.h" // For CSSAnimation #include "nsAnimationManager.h" // For CSSAnimation
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch #include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
#include "nsIDocument.h" // For nsIDocument #include "nsIDocument.h" // For nsIDocument

View File

@@ -24,7 +24,7 @@
#include "mozilla/ServoBindings.h" // Servo_GetProperties_Overriding_Animation #include "mozilla/ServoBindings.h" // Servo_GetProperties_Overriding_Animation
#include "mozilla/ServoStyleSet.h" #include "mozilla/ServoStyleSet.h"
#include "mozilla/StyleAnimationValue.h" #include "mozilla/StyleAnimationValue.h"
#include "mozilla/TypeTraits.h" // For Forward<> #include "mozilla/TypeTraits.h" // For std::forward<>
#include "nsContentUtils.h" #include "nsContentUtils.h"
#include "nsCSSPseudoElements.h" #include "nsCSSPseudoElements.h"
#include "nsCSSPropertyIDSet.h" #include "nsCSSPropertyIDSet.h"

View File

@@ -178,7 +178,7 @@ public:
template<typename... Args> template<typename... Args>
InternalType& Construct(Args&&... aArgs) InternalType& Construct(Args&&... aArgs)
{ {
mImpl.emplace(Forward<Args>(aArgs)...); mImpl.emplace(std::forward<Args>(aArgs)...);
return *mImpl; return *mImpl;
} }

View File

@@ -78,7 +78,7 @@ inline bool
ThrowErrorMessage(JSContext* aCx, const ErrNum aErrorNumber, Ts&&... aArgs) ThrowErrorMessage(JSContext* aCx, const ErrNum aErrorNumber, Ts&&... aArgs)
{ {
binding_detail::ThrowErrorMessage(aCx, static_cast<unsigned>(aErrorNumber), binding_detail::ThrowErrorMessage(aCx, static_cast<unsigned>(aErrorNumber),
mozilla::Forward<Ts>(aArgs)...); std::forward<Ts>(aArgs)...);
return false; return false;
} }
@@ -97,7 +97,7 @@ struct StringArrayAppender
return; return;
} }
aArgs.AppendElement(aFirst); aArgs.AppendElement(aFirst);
Append(aArgs, aCount - 1, Forward<Ts>(aOtherArgs)...); Append(aArgs, aCount - 1, std::forward<Ts>(aOtherArgs)...);
} }
}; };
@@ -293,14 +293,14 @@ public:
void ThrowTypeError(Ts&&... messageArgs) void ThrowTypeError(Ts&&... messageArgs)
{ {
ThrowErrorWithMessage<errorNumber>(NS_ERROR_INTERNAL_ERRORRESULT_TYPEERROR, ThrowErrorWithMessage<errorNumber>(NS_ERROR_INTERNAL_ERRORRESULT_TYPEERROR,
Forward<Ts>(messageArgs)...); std::forward<Ts>(messageArgs)...);
} }
template<dom::ErrNum errorNumber, typename... Ts> template<dom::ErrNum errorNumber, typename... Ts>
void ThrowRangeError(Ts&&... messageArgs) void ThrowRangeError(Ts&&... messageArgs)
{ {
ThrowErrorWithMessage<errorNumber>(NS_ERROR_INTERNAL_ERRORRESULT_RANGEERROR, ThrowErrorWithMessage<errorNumber>(NS_ERROR_INTERNAL_ERRORRESULT_RANGEERROR,
Forward<Ts>(messageArgs)...); std::forward<Ts>(messageArgs)...);
} }
bool IsErrorWithMessage() const bool IsErrorWithMessage() const
@@ -434,7 +434,7 @@ private:
nsTArray<nsString>& messageArgsArray = CreateErrorMessageHelper(errorNumber, errorType); nsTArray<nsString>& messageArgsArray = CreateErrorMessageHelper(errorNumber, errorType);
uint16_t argCount = dom::GetErrorArgCount(errorNumber); uint16_t argCount = dom::GetErrorArgCount(errorNumber);
dom::StringArrayAppender::Append(messageArgsArray, argCount, dom::StringArrayAppender::Append(messageArgsArray, argCount,
Forward<Ts>(messageArgs)...); std::forward<Ts>(messageArgs)...);
#ifdef DEBUG #ifdef DEBUG
mUnionState = HasMessage; mUnionState = HasMessage;
#endif // DEBUG #endif // DEBUG

View File

@@ -20,7 +20,7 @@ ClientManagerOpParent::DoServiceOp(Method aMethod, Args&&... aArgs)
{ {
// Note, we need perfect forarding of the template type in order // Note, we need perfect forarding of the template type in order
// to allow already_AddRefed<> to be passed as an arg. // to allow already_AddRefed<> to be passed as an arg.
RefPtr<ClientOpPromise> p = (mService->*aMethod)(Forward<Args>(aArgs)...); RefPtr<ClientOpPromise> p = (mService->*aMethod)(std::forward<Args>(aArgs)...);
// Capturing `this` is safe here because we disconnect the promise in // Capturing `this` is safe here because we disconnect the promise in
// ActorDestroy() which ensures neither lambda is called if the actor // ActorDestroy() which ensures neither lambda is called if the actor

View File

@@ -61,7 +61,7 @@ public:
{ {
nsTArray<nsString> params; nsTArray<nsString> params;
mozilla::dom::StringArrayAppender::Append(params, sizeof...(Params), mozilla::dom::StringArrayAppender::Append(params, sizeof...(Params),
mozilla::Forward<Params>(aParams)...); std::forward<Params>(aParams)...);
AddConsoleReport(aErrorFlags, aCategory, aPropertiesFile, aSourceFileURI, AddConsoleReport(aErrorFlags, aCategory, aPropertiesFile, aSourceFileURI,
aLineNumber, aColumnNumber, aMessageName, params); aLineNumber, aColumnNumber, aMessageName, params);
} }

View File

@@ -4855,7 +4855,7 @@ HTMLMediaElement::SetupDecoder(DecoderType* aDecoder, LoadArgs&&... aArgs)
aDecoder, aDecoder,
aDecoder->ContainerType().OriginalString().Data())); aDecoder->ContainerType().OriginalString().Data()));
nsresult rv = aDecoder->Load(Forward<LoadArgs>(aArgs)...); nsresult rv = aDecoder->Load(std::forward<LoadArgs>(aArgs)...);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
aDecoder->Shutdown(); aDecoder->Shutdown();
LOG(LogLevel::Debug, ("%p Failed to load for decoder %p", this, aDecoder)); LOG(LogLevel::Debug, ("%p Failed to load for decoder %p", this, aDecoder));

View File

@@ -331,7 +331,7 @@ template <typename Function, typename... Args>
int AudioStream::InvokeCubeb(Function aFunction, Args&&... aArgs) int AudioStream::InvokeCubeb(Function aFunction, Args&&... aArgs)
{ {
MonitorAutoUnlock mon(mMonitor); MonitorAutoUnlock mon(mMonitor);
return aFunction(mCubebStream.get(), Forward<Args>(aArgs)...); return aFunction(mCubebStream.get(), std::forward<Args>(aArgs)...);
} }
nsresult nsresult

View File

@@ -49,8 +49,8 @@ public:
template<typename StartArg, typename EndArg> template<typename StartArg, typename EndArg>
Interval(StartArg&& aStart, EndArg&& aEnd) Interval(StartArg&& aStart, EndArg&& aEnd)
: mStart(Forward<StartArg>(aStart)) : mStart(std::forward<StartArg>(aStart))
, mEnd(Forward<EndArg>(aEnd)) , mEnd(std::forward<EndArg>(aEnd))
, mFuzz() , mFuzz()
{ {
MOZ_ASSERT(aStart <= aEnd); MOZ_ASSERT(aStart <= aEnd);
@@ -58,9 +58,9 @@ public:
template<typename StartArg, typename EndArg, typename FuzzArg> template<typename StartArg, typename EndArg, typename FuzzArg>
Interval(StartArg&& aStart, EndArg&& aEnd, FuzzArg&& aFuzz) Interval(StartArg&& aStart, EndArg&& aEnd, FuzzArg&& aFuzz)
: mStart(Forward<StartArg>(aStart)) : mStart(std::forward<StartArg>(aStart))
, mEnd(Forward<EndArg>(aEnd)) , mEnd(std::forward<EndArg>(aEnd))
, mFuzz(Forward<FuzzArg>(aFuzz)) , mFuzz(std::forward<FuzzArg>(aFuzz))
{ {
MOZ_ASSERT(aStart <= aEnd); MOZ_ASSERT(aStart <= aEnd);
} }

View File

@@ -275,7 +275,7 @@ protected:
// So we 1) pass the parameters by reference, but then 2) immediately copy // So we 1) pass the parameters by reference, but then 2) immediately copy
// them into a Tuple to be safe against modification, and finally 3) move // them into a Tuple to be safe against modification, and finally 3) move
// the elements of the Tuple into the final function call. // the elements of the Tuple into the final function call.
auto copiedArgs = MakeTuple(Forward<Ts>(aArgs)...); auto copiedArgs = MakeTuple(std::forward<Ts>(aArgs)...);
// Copy mMaster which will reset to null. // Copy mMaster which will reset to null.
auto master = mMaster; auto master = mMaster;

View File

@@ -145,7 +145,7 @@ struct MediaPlaybackEvent
template<typename T> template<typename T>
MediaPlaybackEvent(EventType aType, T&& aArg) MediaPlaybackEvent(EventType aType, T&& aArg)
: mType(aType) : mType(aType)
, mData(Forward<T>(aArg)) , mData(std::forward<T>(aArg))
{ {
} }
}; };

View File

@@ -138,7 +138,7 @@ public:
"detail::Listener::ApplyWithArgs", "detail::Listener::ApplyWithArgs",
this, this,
&Listener::ApplyWithArgs, &Listener::ApplyWithArgs,
Forward<Ts>(aEvents)...)); std::forward<Ts>(aEvents)...));
} else { } else {
DispatchTask(NewRunnableMethod( DispatchTask(NewRunnableMethod(
"detail::Listener::ApplyWithNoArgs", this, &Listener::ApplyWithNoArgs)); "detail::Listener::ApplyWithNoArgs", this, &Listener::ApplyWithNoArgs));
@@ -178,7 +178,7 @@ public:
template <typename F> template <typename F>
ListenerImpl(Target* aTarget, F&& aFunction) ListenerImpl(Target* aTarget, F&& aFunction)
: mTarget(aTarget) : mTarget(aTarget)
, mFunction(Forward<F>(aFunction)) , mFunction(std::forward<F>(aFunction))
{ {
} }
@@ -345,7 +345,7 @@ class MediaEventSourceImpl {
MOZ_ASSERT(Lp == ListenerPolicy::NonExclusive || mListeners.IsEmpty()); MOZ_ASSERT(Lp == ListenerPolicy::NonExclusive || mListeners.IsEmpty());
auto l = mListeners.AppendElement(); auto l = mListeners.AppendElement();
*l = new ListenerImpl<Target, Function>( *l = new ListenerImpl<Target, Function>(
aTarget, Forward<Function>(aFunction)); aTarget, std::forward<Function>(aFunction));
return MediaEventListener(*l); return MediaEventListener(*l);
} }
@@ -383,13 +383,13 @@ public:
template<typename Function> template<typename Function>
MediaEventListener MediaEventListener
Connect(AbstractThread* aTarget, Function&& aFunction) { Connect(AbstractThread* aTarget, Function&& aFunction) {
return ConnectInternal(aTarget, Forward<Function>(aFunction)); return ConnectInternal(aTarget, std::forward<Function>(aFunction));
} }
template<typename Function> template<typename Function>
MediaEventListener MediaEventListener
Connect(nsIEventTarget* aTarget, Function&& aFunction) { Connect(nsIEventTarget* aTarget, Function&& aFunction) {
return ConnectInternal(aTarget, Forward<Function>(aFunction)); return ConnectInternal(aTarget, std::forward<Function>(aFunction));
} }
/** /**
@@ -430,7 +430,7 @@ protected:
mListeners.RemoveElementAt(i); mListeners.RemoveElementAt(i);
continue; continue;
} }
l->Dispatch(Forward<Ts>(aEvents)...); l->Dispatch(std::forward<Ts>(aEvents)...);
} }
} }
@@ -482,7 +482,7 @@ class MediaEventProducerExc : public MediaEventSourceExc<Es...> {
public: public:
template <typename... Ts> template <typename... Ts>
void Notify(Ts&&... aEvents) { void Notify(Ts&&... aEvents) {
this->NotifyInternal(Forward<Ts>(aEvents)...); this->NotifyInternal(std::forward<Ts>(aEvents)...);
} }
}; };

View File

@@ -436,7 +436,7 @@ public:
template<typename AInitDatas> template<typename AInitDatas>
InitData(const nsAString& aType, AInitDatas&& aInitData) InitData(const nsAString& aType, AInitDatas&& aInitData)
: mType(aType) : mType(aType)
, mInitData(Forward<AInitDatas>(aInitData)) , mInitData(std::forward<AInitDatas>(aInitData))
{ {
} }
@@ -463,7 +463,7 @@ public:
template<typename AInitDatas> template<typename AInitDatas>
void AddInitData(const nsAString& aType, AInitDatas&& aInitData) void AddInitData(const nsAString& aType, AInitDatas&& aInitData)
{ {
mInitDatas.AppendElement(InitData(aType, Forward<AInitDatas>(aInitData))); mInitDatas.AppendElement(InitData(aType, std::forward<AInitDatas>(aInitData)));
mEncrypted = true; mEncrypted = true;
} }

View File

@@ -2243,7 +2243,7 @@ MediaManager::PostTask(const char* aName, FunctionType&& aFunction)
MozPromiseHolder<MozPromiseType> holder; MozPromiseHolder<MozPromiseType> holder;
RefPtr<MozPromiseType> promise = holder.Ensure(aName); RefPtr<MozPromiseType> promise = holder.Ensure(aName);
MediaManager::PostTask(NS_NewRunnableFunction(aName, MediaManager::PostTask(NS_NewRunnableFunction(aName,
[h = std::move(holder), func = Forward<FunctionType>(aFunction)]() mutable [h = std::move(holder), func = std::forward<FunctionType>(aFunction)]() mutable
{ {
func(h); func(h);
})); }));

View File

@@ -155,7 +155,7 @@ public:
*/ */
void SetLastPrincipalHandle(PrincipalHandle aLastPrincipalHandle) void SetLastPrincipalHandle(PrincipalHandle aLastPrincipalHandle)
{ {
mLastPrincipalHandle = Forward<PrincipalHandle>(aLastPrincipalHandle); mLastPrincipalHandle = std::forward<PrincipalHandle>(aLastPrincipalHandle);
} }
/** /**

View File

@@ -153,8 +153,8 @@ public:
mTarget = aTarget; mTarget = aTarget;
mMediaTimer->WaitUntil(mTarget, __func__)->Then( mMediaTimer->WaitUntil(mTarget, __func__)->Then(
mTargetThread, __func__, mTargetThread, __func__,
Forward<ResolveFunc>(aResolver), std::forward<ResolveFunc>(aResolver),
Forward<RejectFunc>(aRejector)) std::forward<RejectFunc>(aRejector))
->Track(mRequest); ->Track(mRequest);
} }

View File

@@ -42,7 +42,7 @@ public:
bool GetForceBlack() const { return mForceBlack; } bool GetForceBlack() const { return mForceBlack; }
void SetPrincipalHandle(PrincipalHandle aPrincipalHandle) void SetPrincipalHandle(PrincipalHandle aPrincipalHandle)
{ {
mPrincipalHandle = Forward<PrincipalHandle>(aPrincipalHandle); mPrincipalHandle = std::forward<PrincipalHandle>(aPrincipalHandle);
} }
const PrincipalHandle& GetPrincipalHandle() const { return mPrincipalHandle; } const PrincipalHandle& GetPrincipalHandle() const { return mPrincipalHandle; }
const gfx::IntSize& GetIntrinsicSize() const { return mIntrinsicSize; } const gfx::IntSize& GetIntrinsicSize() const { return mIntrinsicSize; }

View File

@@ -87,7 +87,7 @@ public:
aSubjectPointer, aSubjectPointer,
aCategory, aCategory,
aLabel, aLabel,
DDLogValue{ Forward<Value>(aValue) }); DDLogValue{ std::forward<Value>(aValue) });
} }
template<typename Subject, typename Value> template<typename Subject, typename Value>
@@ -100,7 +100,7 @@ public:
aSubject, aSubject,
aCategory, aCategory,
aLabel, aLabel,
Forward<Value>(aValue)); std::forward<Value>(aValue));
} }
// EagerLogValue that can explicitly take strings, as the templated function // EagerLogValue that can explicitly take strings, as the templated function
@@ -154,7 +154,7 @@ public:
aCategory, aCategory,
aLabel, aLabel,
DDLogValue{ DDLogValue{
nsCString{ nsPrintfCString(aFormat, Forward<Args>(aArgs)...) } }); nsCString{ nsPrintfCString(aFormat, std::forward<Args>(aArgs)...) } });
} }
template<typename Subject> template<typename Subject>
@@ -182,7 +182,7 @@ public:
aCategory, aCategory,
aLabel, aLabel,
aFormat, aFormat,
Forward<Args>(aArgs)...); std::forward<Args>(aArgs)...);
} }
static void MozLogPrintf(const char* aSubjectTypeName, static void MozLogPrintf(const char* aSubjectTypeName,
@@ -209,7 +209,7 @@ public:
const char* aFormat, const char* aFormat,
Args&&... aArgs) Args&&... aArgs)
{ {
nsCString printed = nsPrintfCString(aFormat, Forward<Args>(aArgs)...); nsCString printed = nsPrintfCString(aFormat, std::forward<Args>(aArgs)...);
Log(aSubjectTypeName, Log(aSubjectTypeName,
aSubjectPointer, aSubjectPointer,
CategoryForMozLogLevel(aLogLevel), CategoryForMozLogLevel(aLogLevel),
@@ -245,7 +245,7 @@ public:
aLogModule, aLogModule,
aLogLevel, aLogLevel,
aFormat, aFormat,
Forward<Args>(aArgs)...); std::forward<Args>(aArgs)...);
} }
// Special logging functions. Consider using DecoderDoctorLifeLogger to // Special logging functions. Consider using DecoderDoctorLifeLogger to

View File

@@ -21,7 +21,7 @@ void ChromiumCDMCallbackProxy::DispatchToMainThread(const char* const aLabel,
aLabel, aLabel,
mProxy, mProxy,
aFunc, aFunc,
Forward<Args>(aArgs)...), std::forward<Args>(aArgs)...),
NS_DISPATCH_NORMAL); NS_DISPATCH_NORMAL);
} }

View File

@@ -197,7 +197,7 @@ ChromiumCDMChild::CallMethod(MethodType aMethod, ParamType&&... aParams)
MOZ_ASSERT(IsOnMessageLoopThread()); MOZ_ASSERT(IsOnMessageLoopThread());
// Avoid calling member function after destroy. // Avoid calling member function after destroy.
if (!mDestroyed) { if (!mDestroyed) {
Unused << (this->*aMethod)(Forward<ParamType>(aParams)...); Unused << (this->*aMethod)(std::forward<ParamType>(aParams)...);
} }
} }
@@ -208,7 +208,7 @@ ChromiumCDMChild::CallOnMessageLoopThread(const char* const aName,
ParamType&&... aParams) ParamType&&... aParams)
{ {
if (IsOnMessageLoopThread()) { if (IsOnMessageLoopThread()) {
CallMethod(aMethod, Forward<ParamType>(aParams)...); CallMethod(aMethod, std::forward<ParamType>(aParams)...);
} else { } else {
auto m = &ChromiumCDMChild::CallMethod< auto m = &ChromiumCDMChild::CallMethod<
decltype(aMethod), const typename RemoveReference<ParamType>::Type&...>; decltype(aMethod), const typename RemoveReference<ParamType>::Type&...>;
@@ -219,7 +219,7 @@ ChromiumCDMChild::CallOnMessageLoopThread(const char* const aName,
this, this,
m, m,
aMethod, aMethod,
Forward<ParamType>(aParams)...); std::forward<ParamType>(aParams)...);
mPlugin->GMPMessageLoop()->PostTask(t.forget()); mPlugin->GMPMessageLoop()->PostTask(t.forget());
} }
} }

View File

@@ -67,7 +67,7 @@ public:
public: public:
template <typename M2, typename T2> template <typename M2, typename T2>
ResultAndType(M2&& aM, T2&& aT) ResultAndType(M2&& aM, T2&& aT)
: mResult(Forward<M2>(aM)), mT(Forward<T2>(aT)) : mResult(std::forward<M2>(aM)), mT(std::forward<T2>(aT))
{ {
} }
ResultAndType(const ResultAndType&) = default; ResultAndType(const ResultAndType&) = default;

View File

@@ -113,7 +113,7 @@ public:
void void
AddToCheckList(Func&& aChecker) AddToCheckList(Func&& aChecker)
{ {
mCheckerList.AppendElement(mozilla::Forward<Func>(aChecker)); mCheckerList.AppendElement(std::forward<Func>(aChecker));
} }
void void

View File

@@ -71,7 +71,7 @@ struct MOZ_STACK_CLASS CreateDecoderParams final
CreateDecoderParams(const TrackInfo& aConfig, T1&& a1, Ts&&... args) CreateDecoderParams(const TrackInfo& aConfig, T1&& a1, Ts&&... args)
: mConfig(aConfig) : mConfig(aConfig)
{ {
Set(mozilla::Forward<T1>(a1), mozilla::Forward<Ts>(args)...); Set(std::forward<T1>(a1), std::forward<Ts>(args)...);
} }
const VideoInfo& VideoConfig() const const VideoInfo& VideoConfig() const
@@ -140,8 +140,8 @@ private:
template <typename T1, typename T2, typename... Ts> template <typename T1, typename T2, typename... Ts>
void Set(T1&& a1, T2&& a2, Ts&&... args) void Set(T1&& a1, T2&& a2, Ts&&... args)
{ {
Set(mozilla::Forward<T1>(a1)); Set(std::forward<T1>(a1));
Set(mozilla::Forward<T2>(a2), mozilla::Forward<Ts>(args)...); Set(std::forward<T2>(a2), std::forward<Ts>(args)...);
} }
}; };

View File

@@ -142,7 +142,7 @@ int GetChildAndCall(MEM_FUN&& f, ARGS&&... args)
OffTheBooksMutexAutoLock lock(CamerasSingleton::Mutex()); OffTheBooksMutexAutoLock lock(CamerasSingleton::Mutex());
CamerasChild* child = GetCamerasChild(); CamerasChild* child = GetCamerasChild();
if (child) { if (child) {
return (child->*f)(mozilla::Forward<ARGS>(args)...); return (child->*f)(std::forward<ARGS>(args)...);
} else { } else {
return -1; return -1;
} }

View File

@@ -45,7 +45,7 @@ already_AddRefed<LambdaTask<OnRunType>>
NewTaskFrom(OnRunType&& aOnRun) NewTaskFrom(OnRunType&& aOnRun)
{ {
typedef LambdaTask<OnRunType> LambdaType; typedef LambdaTask<OnRunType> LambdaType;
RefPtr<LambdaType> lambda = new LambdaType(Forward<OnRunType>(aOnRun)); RefPtr<LambdaType> lambda = new LambdaType(std::forward<OnRunType>(aOnRun));
return lambda.forget(); return lambda.forget();
} }

View File

@@ -81,7 +81,7 @@ public:
template<typename OnSuccessType> template<typename OnSuccessType>
void Then(OnSuccessType&& aOnSuccess) void Then(OnSuccessType&& aOnSuccess)
{ {
Then(Forward<OnSuccessType>(aOnSuccess), [](ErrorType&){}); Then(std::forward<OnSuccessType>(aOnSuccess), [](ErrorType&){});
} }
template<typename OnSuccessType, typename OnFailureType> template<typename OnSuccessType, typename OnFailureType>
@@ -105,8 +105,8 @@ public:
OnSuccessType mOnSuccess; OnSuccessType mOnSuccess;
OnFailureType mOnFailure; OnFailureType mOnFailure;
}; };
mFunctors = MakeUnique<Functors>(Forward<OnSuccessType>(aOnSuccess), mFunctors = MakeUnique<Functors>(std::forward<OnSuccessType>(aOnSuccess),
Forward<OnFailureType>(aOnFailure)); std::forward<OnFailureType>(aOnFailure));
if (mDone) { if (mDone) {
if (!mRejected) { if (!mRejected) {
mFunctors->Succeed(mValue); mFunctors->Succeed(mValue);
@@ -216,7 +216,7 @@ already_AddRefed<LambdaRunnable<OnRunType>>
NewRunnableFrom(OnRunType&& aOnRun) NewRunnableFrom(OnRunType&& aOnRun)
{ {
typedef LambdaRunnable<OnRunType> LambdaType; typedef LambdaRunnable<OnRunType> LambdaType;
RefPtr<LambdaType> lambda = new LambdaType(Forward<OnRunType>(aOnRun)); RefPtr<LambdaType> lambda = new LambdaType(std::forward<OnRunType>(aOnRun));
return lambda.forget(); return lambda.forget();
} }
@@ -448,13 +448,13 @@ Await(
__func__, __func__,
[&](ResolveValueType&& aResolveValue) { [&](ResolveValueType&& aResolveValue) {
MonitorAutoLock lock(mon); MonitorAutoLock lock(mon);
aResolveFunction(Forward<ResolveValueType>(aResolveValue)); aResolveFunction(std::forward<ResolveValueType>(aResolveValue));
done = true; done = true;
mon.Notify(); mon.Notify();
}, },
[&](RejectValueType&& aRejectValue) { [&](RejectValueType&& aRejectValue) {
MonitorAutoLock lock(mon); MonitorAutoLock lock(mon);
aRejectFunction(Forward<RejectValueType>(aRejectValue)); aRejectFunction(std::forward<RejectValueType>(aRejectValue));
done = true; done = true;
mon.Notify(); mon.Notify();
}); });

View File

@@ -71,7 +71,7 @@ class MediaEngineRemoteVideoSource : public MediaEngineSource,
struct CapabilityCandidate { struct CapabilityCandidate {
explicit CapabilityCandidate(webrtc::CaptureCapability&& aCapability, explicit CapabilityCandidate(webrtc::CaptureCapability&& aCapability,
uint32_t aDistance = 0) uint32_t aDistance = 0)
: mCapability(Forward<webrtc::CaptureCapability>(aCapability)) : mCapability(std::forward<webrtc::CaptureCapability>(aCapability))
, mDistance(aDistance) {} , mDistance(aDistance) {}
const webrtc::CaptureCapability mCapability; const webrtc::CaptureCapability mCapability;

View File

@@ -87,7 +87,7 @@ AsyncLog(nsIInterceptedChannel* aInterceptedChannel,
{ {
nsTArray<nsString> paramsList(sizeof...(Params) + 1); nsTArray<nsString> paramsList(sizeof...(Params) + 1);
StringArrayAppender::Append(paramsList, sizeof...(Params) + 1, StringArrayAppender::Append(paramsList, sizeof...(Params) + 1,
aFirstParam, Forward<Params>(aParams)...); aFirstParam, std::forward<Params>(aParams)...);
AsyncLog(aInterceptedChannel, aRespondWithScriptSpec, aRespondWithLineNumber, AsyncLog(aInterceptedChannel, aRespondWithScriptSpec, aRespondWithLineNumber,
aRespondWithColumnNumber, aMessageName, paramsList); aRespondWithColumnNumber, aMessageName, paramsList);
} }
@@ -559,7 +559,7 @@ public:
mMessageName = aMessageName; mMessageName = aMessageName;
mParams.Clear(); mParams.Clear();
StringArrayAppender::Append(mParams, sizeof...(Params), StringArrayAppender::Append(mParams, sizeof...(Params),
Forward<Params>(aParams)...); std::forward<Params>(aParams)...);
} }
template<typename... Params> template<typename... Params>
@@ -579,7 +579,7 @@ public:
mMessageName = aMessageName; mMessageName = aMessageName;
mParams.Clear(); mParams.Clear();
StringArrayAppender::Append(mParams, sizeof...(Params), StringArrayAppender::Append(mParams, sizeof...(Params),
Forward<Params>(aParams)...); std::forward<Params>(aParams)...);
} }
void Reset() void Reset()

View File

@@ -74,7 +74,7 @@ public:
{ {
static_assert(IsBaseOf<DrawingCommand, T>::value, static_assert(IsBaseOf<DrawingCommand, T>::value,
"T must derive from DrawingCommand"); "T must derive from DrawingCommand");
return mCommands->mStorage.Alloc<T>(Forward<Args>(aArgs)...); return mCommands->mStorage.Alloc<T>(std::forward<Args>(aArgs)...);
} }
bool HasCommands() const { return !!mCommands; } bool HasCommands() const { return !!mCommands; }

View File

@@ -78,7 +78,7 @@ public:
if (offset < 0) { if (offset < 0) {
return offset; return offset;
} }
new (storage) T(Forward<Args>(aArgs)...); new (storage) T(std::forward<Args>(aArgs)...);
return offset; return offset;
} }

View File

@@ -310,7 +310,7 @@ DecoderFactory::CreateDecoderForICOResource(DecoderType aType,
// Initialize the decoder, copying settings from @aICODecoder. // Initialize the decoder, copying settings from @aICODecoder.
decoder->SetMetadataDecode(aIsMetadataDecode); decoder->SetMetadataDecode(aIsMetadataDecode);
decoder->SetIterator(Forward<SourceBufferIterator>(aIterator)); decoder->SetIterator(std::forward<SourceBufferIterator>(aIterator));
if (!aIsMetadataDecode) { if (!aIsMetadataDecode) {
decoder->SetOutputSize(aICODecoder->OutputSize()); decoder->SetOutputSize(aICODecoder->OutputSize());
} }

View File

@@ -172,7 +172,7 @@ public:
WriteState WritePixels(Func aFunc) WriteState WritePixels(Func aFunc)
{ {
Maybe<WriteState> result; Maybe<WriteState> result;
while (!(result = DoWritePixelsToRow<PixelType>(Forward<Func>(aFunc)))) { } while (!(result = DoWritePixelsToRow<PixelType>(std::forward<Func>(aFunc)))) { }
return *result; return *result;
} }
@@ -209,7 +209,7 @@ public:
WriteState WritePixelBlocks(Func aFunc) WriteState WritePixelBlocks(Func aFunc)
{ {
Maybe<WriteState> result; Maybe<WriteState> result;
while (!(result = DoWritePixelBlockToRow<PixelType>(Forward<Func>(aFunc)))) { } while (!(result = DoWritePixelBlockToRow<PixelType>(std::forward<Func>(aFunc)))) { }
return *result; return *result;
} }
@@ -246,7 +246,7 @@ public:
template <typename PixelType, typename Func> template <typename PixelType, typename Func>
WriteState WritePixelsToRow(Func aFunc) WriteState WritePixelsToRow(Func aFunc)
{ {
return DoWritePixelsToRow<PixelType>(Forward<Func>(aFunc)) return DoWritePixelsToRow<PixelType>(std::forward<Func>(aFunc))
.valueOr(WriteState::NEED_MORE_DATA); .valueOr(WriteState::NEED_MORE_DATA);
} }
@@ -639,7 +639,7 @@ public:
WriteState WritePixels(Func aFunc) WriteState WritePixels(Func aFunc)
{ {
MOZ_ASSERT(mHead, "Use before configured!"); MOZ_ASSERT(mHead, "Use before configured!");
return mHead->WritePixels<PixelType>(Forward<Func>(aFunc)); return mHead->WritePixels<PixelType>(std::forward<Func>(aFunc));
} }
/** /**
@@ -653,7 +653,7 @@ public:
WriteState WritePixelBlocks(Func aFunc) WriteState WritePixelBlocks(Func aFunc)
{ {
MOZ_ASSERT(mHead, "Use before configured!"); MOZ_ASSERT(mHead, "Use before configured!");
return mHead->WritePixelBlocks<PixelType>(Forward<Func>(aFunc)); return mHead->WritePixelBlocks<PixelType>(std::forward<Func>(aFunc));
} }
/** /**
@@ -667,7 +667,7 @@ public:
WriteState WritePixelsToRow(Func aFunc) WriteState WritePixelsToRow(Func aFunc)
{ {
MOZ_ASSERT(mHead, "Use before configured!"); MOZ_ASSERT(mHead, "Use before configured!");
return mHead->WritePixelsToRow<PixelType>(Forward<Func>(aFunc)); return mHead->WritePixelsToRow<PixelType>(std::forward<Func>(aFunc));
} }
/** /**

View File

@@ -31,7 +31,7 @@ WithADAM7InterpolatingFilter(const IntSize& aSize, Func aFunc)
RefPtr<Decoder> decoder = CreateTrivialDecoder(); RefPtr<Decoder> decoder = CreateTrivialDecoder();
ASSERT_TRUE(bool(decoder)); ASSERT_TRUE(bool(decoder));
WithFilterPipeline(decoder, Forward<Func>(aFunc), WithFilterPipeline(decoder, std::forward<Func>(aFunc),
ADAM7InterpolatingConfig { }, ADAM7InterpolatingConfig { },
SurfaceConfig { decoder, aSize, SurfaceConfig { decoder, aSize,
SurfaceFormat::B8G8R8A8, false }); SurfaceFormat::B8G8R8A8, false });

View File

@@ -26,7 +26,7 @@ WithDeinterlacingFilter(const IntSize& aSize,
RefPtr<Decoder> decoder = CreateTrivialDecoder(); RefPtr<Decoder> decoder = CreateTrivialDecoder();
ASSERT_TRUE(bool(decoder)); ASSERT_TRUE(bool(decoder));
WithFilterPipeline(decoder, Forward<Func>(aFunc), WithFilterPipeline(decoder, std::forward<Func>(aFunc),
DeinterlacingConfig<uint32_t> { aProgressiveDisplay }, DeinterlacingConfig<uint32_t> { aProgressiveDisplay },
SurfaceConfig { decoder, aSize, SurfaceConfig { decoder, aSize,
SurfaceFormat::B8G8R8A8, false }); SurfaceFormat::B8G8R8A8, false });
@@ -39,7 +39,7 @@ WithPalettedDeinterlacingFilter(const IntSize& aSize,
RefPtr<Decoder> decoder = CreateTrivialDecoder(); RefPtr<Decoder> decoder = CreateTrivialDecoder();
ASSERT_TRUE(decoder != nullptr); ASSERT_TRUE(decoder != nullptr);
WithFilterPipeline(decoder, Forward<Func>(aFunc), WithFilterPipeline(decoder, std::forward<Func>(aFunc),
DeinterlacingConfig<uint8_t> { /* mProgressiveDisplay = */ true }, DeinterlacingConfig<uint8_t> { /* mProgressiveDisplay = */ true },
PalettedSurfaceConfig { decoder, aSize, PalettedSurfaceConfig { decoder, aSize,
IntRect(0, 0, 100, 100), IntRect(0, 0, 100, 100),

View File

@@ -26,7 +26,7 @@ WithDownscalingFilter(const IntSize& aInputSize,
RefPtr<Decoder> decoder = CreateTrivialDecoder(); RefPtr<Decoder> decoder = CreateTrivialDecoder();
ASSERT_TRUE(decoder != nullptr); ASSERT_TRUE(decoder != nullptr);
WithFilterPipeline(decoder, Forward<Func>(aFunc), WithFilterPipeline(decoder, std::forward<Func>(aFunc),
DownscalingConfig { aInputSize, DownscalingConfig { aInputSize,
SurfaceFormat::B8G8R8A8 }, SurfaceFormat::B8G8R8A8 },
SurfaceConfig { decoder, aOutputSize, SurfaceConfig { decoder, aOutputSize,

View File

@@ -26,7 +26,7 @@ WithRemoveFrameRectFilter(const IntSize& aSize,
RefPtr<Decoder> decoder = CreateTrivialDecoder(); RefPtr<Decoder> decoder = CreateTrivialDecoder();
ASSERT_TRUE(decoder != nullptr); ASSERT_TRUE(decoder != nullptr);
WithFilterPipeline(decoder, Forward<Func>(aFunc), WithFilterPipeline(decoder, std::forward<Func>(aFunc),
RemoveFrameRectConfig { aFrameRect }, RemoveFrameRectConfig { aFrameRect },
SurfaceConfig { decoder, aSize, SurfaceConfig { decoder, aSize,
SurfaceFormat::B8G8R8A8, false }); SurfaceFormat::B8G8R8A8, false });

View File

@@ -31,7 +31,7 @@ WithSurfaceSink(Func aFunc)
const bool flipVertically = Orientation == Orient::FLIP_VERTICALLY; const bool flipVertically = Orientation == Orient::FLIP_VERTICALLY;
WithFilterPipeline(decoder, Forward<Func>(aFunc), WithFilterPipeline(decoder, std::forward<Func>(aFunc),
SurfaceConfig { decoder, IntSize(100, 100), SurfaceConfig { decoder, IntSize(100, 100),
SurfaceFormat::B8G8R8A8, flipVertically }); SurfaceFormat::B8G8R8A8, flipVertically });
} }
@@ -42,7 +42,7 @@ WithPalettedSurfaceSink(const IntRect& aFrameRect, Func aFunc)
RefPtr<Decoder> decoder = CreateTrivialDecoder(); RefPtr<Decoder> decoder = CreateTrivialDecoder();
ASSERT_TRUE(decoder != nullptr); ASSERT_TRUE(decoder != nullptr);
WithFilterPipeline(decoder, Forward<Func>(aFunc), WithFilterPipeline(decoder, std::forward<Func>(aFunc),
PalettedSurfaceConfig { decoder, IntSize(100, 100), PalettedSurfaceConfig { decoder, IntSize(100, 100),
aFrameRect, SurfaceFormat::B8G8R8A8, aFrameRect, SurfaceFormat::B8G8R8A8,
8, false }); 8, false });

View File

@@ -150,7 +150,7 @@ class ScopedRunnableMethodFactory : public RevocableStore {
typedef typename ScopedTaskFactory<Runnable>::TaskWrapper TaskWrapper; typedef typename ScopedTaskFactory<Runnable>::TaskWrapper TaskWrapper;
RefPtr<TaskWrapper> task = new TaskWrapper(this); RefPtr<TaskWrapper> task = new TaskWrapper(this);
task->Init(object_, method, mozilla::MakeTuple(mozilla::Forward<Elements>(elements)...)); task->Init(object_, method, mozilla::MakeTuple(std::forward<Elements>(elements)...));
return task.forget(); return task.forget();
} }
@@ -167,7 +167,7 @@ class ScopedRunnableMethodFactory : public RevocableStore {
{ {
obj_ = obj; obj_ = obj;
meth_ = meth; meth_ = meth;
params_ = mozilla::Forward<Params>(params); params_ = std::forward<Params>(params);
} }
NS_IMETHOD Run() override { NS_IMETHOD Run() override {
@@ -280,7 +280,7 @@ class RunnableMethod : public mozilla::CancelableRunnable,
: mozilla::CancelableRunnable("RunnableMethod") : mozilla::CancelableRunnable("RunnableMethod")
, obj_(obj) , obj_(obj)
, meth_(meth) , meth_(meth)
, params_(mozilla::Forward<Params>(params)) , params_(std::forward<Params>(params))
{ {
this->RetainCallee(obj_); this->RetainCallee(obj_);
} }
@@ -323,7 +323,7 @@ NewRunnableMethod(T* object, Method method, Args&&... args) {
typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple; typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple;
RefPtr<mozilla::Runnable> t = RefPtr<mozilla::Runnable> t =
new RunnableMethod<T, Method, ArgsTuple>(object, method, new RunnableMethod<T, Method, ArgsTuple>(object, method,
mozilla::MakeTuple(mozilla::Forward<Args>(args)...)); mozilla::MakeTuple(std::forward<Args>(args)...));
return t.forget(); return t.forget();
} }
@@ -337,7 +337,7 @@ class RunnableFunction : public mozilla::CancelableRunnable {
RunnableFunction(const char* name, Function function, Params&& params) RunnableFunction(const char* name, Function function, Params&& params)
: mozilla::CancelableRunnable(name) : mozilla::CancelableRunnable(name)
, function_(function) , function_(function)
, params_(mozilla::Forward<Params>(params)) , params_(std::forward<Params>(params))
{ {
} }
@@ -365,7 +365,7 @@ NewCancelableRunnableFunction(const char* name, Function function, Args&&... arg
typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple; typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple;
RefPtr<mozilla::CancelableRunnable> t = RefPtr<mozilla::CancelableRunnable> t =
new RunnableFunction<Function, ArgsTuple>(name, function, new RunnableFunction<Function, ArgsTuple>(name, function,
mozilla::MakeTuple(mozilla::Forward<Args>(args)...)); mozilla::MakeTuple(std::forward<Args>(args)...));
return t.forget(); return t.forget();
} }
@@ -375,7 +375,7 @@ NewRunnableFunction(const char* name, Function function, Args&&... args) {
typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple; typedef mozilla::Tuple<typename mozilla::Decay<Args>::Type...> ArgsTuple;
RefPtr<mozilla::Runnable> t = RefPtr<mozilla::Runnable> t =
new RunnableFunction<Function, ArgsTuple>(name, function, new RunnableFunction<Function, ArgsTuple>(name, function,
mozilla::MakeTuple(mozilla::Forward<Args>(args)...)); mozilla::MakeTuple(std::forward<Args>(args)...));
return t.forget(); return t.forget();
} }

View File

@@ -132,7 +132,7 @@ template<typename P>
static inline void static inline void
WriteParam(Message* m, P&& p) { WriteParam(Message* m, P&& p) {
ParamTraits<typename ParamTraitsSelector<P>::Type> ParamTraits<typename ParamTraitsSelector<P>::Type>
::Write(m, mozilla::Forward<P>(p)); ::Write(m, std::forward<P>(p));
} }
template<typename P> template<typename P>

View File

@@ -31,7 +31,7 @@ struct IPDLParamTraits
static_assert(IsSame<P, typename IPC::ParamTraitsSelector<R>::Type>::value, static_assert(IsSame<P, typename IPC::ParamTraitsSelector<R>::Type>::value,
"IPDLParamTraits::Write only forwards calls which work via WriteParam"); "IPDLParamTraits::Write only forwards calls which work via WriteParam");
IPC::ParamTraits<P>::Write(aMsg, Forward<R>(aParam)); IPC::ParamTraits<P>::Write(aMsg, std::forward<R>(aParam));
} }
template<typename R> template<typename R>
@@ -61,7 +61,7 @@ WriteIPDLParam(IPC::Message* aMsg,
P&& aParam) P&& aParam)
{ {
IPDLParamTraits<typename IPC::ParamTraitsSelector<P>::Type> IPDLParamTraits<typename IPC::ParamTraitsSelector<P>::Type>
::Write(aMsg, aActor, Forward<P>(aParam)); ::Write(aMsg, aActor, std::forward<P>(aParam));
} }
template<typename P> template<typename P>

View File

@@ -33,7 +33,7 @@ private:
public: public:
template<typename... Args> template<typename... Args>
explicit TaskWrapper(RevocableStore* store, Args&&... args) explicit TaskWrapper(RevocableStore* store, Args&&... args)
: TaskType(mozilla::Forward<Args>(args)...) : TaskType(std::forward<Args>(args)...)
, revocable_(store) , revocable_(store)
{ {
} }
@@ -56,20 +56,20 @@ public:
{ {
typedef TaskWrapper<TaskParamType> TaskWrapper; typedef TaskWrapper<TaskParamType> TaskWrapper;
RefPtr<TaskWrapper> task = RefPtr<TaskWrapper> task =
new TaskWrapper(this, mozilla::Forward<Args>(args)...); new TaskWrapper(this, std::forward<Args>(args)...);
return task.forget(); return task.forget();
} }
template <class Method, typename... Args> template <class Method, typename... Args>
inline already_AddRefed<Runnable> inline already_AddRefed<Runnable>
NewRunnableMethod(Method method, Args&&... args) { NewRunnableMethod(Method method, Args&&... args) {
typedef decltype(base::MakeTuple(mozilla::Forward<Args>(args)...)) ArgTuple; typedef decltype(base::MakeTuple(std::forward<Args>(args)...)) ArgTuple;
typedef RunnableMethod<Method, ArgTuple> RunnableMethod; typedef RunnableMethod<Method, ArgTuple> RunnableMethod;
typedef TaskWrapper<RunnableMethod> TaskWrapper; typedef TaskWrapper<RunnableMethod> TaskWrapper;
RefPtr<TaskWrapper> task = RefPtr<TaskWrapper> task =
new TaskWrapper(this, object_, method, new TaskWrapper(this, object_, method,
base::MakeTuple(mozilla::Forward<Args>(args)...)); base::MakeTuple(std::forward<Args>(args)...));
return task.forget(); return task.forget();
} }

View File

@@ -65,7 +65,7 @@ class MOZ_NON_TEMPORARY_CLASS ActivationContextRegion final
public: public:
template <typename... Args> template <typename... Args>
explicit ActivationContextRegion(Args... aArgs) explicit ActivationContextRegion(Args... aArgs)
: mActCtx(Forward<Args>(aArgs)...) : mActCtx(std::forward<Args>(aArgs)...)
, mActCookie(0) , mActCookie(0)
{ {
Activate(); Activate();

View File

@@ -303,7 +303,7 @@ public:
HRESULT Invoke(SyncMethod aSyncMethod, AsyncMethod aAsyncMethod, Args... aArgs) HRESULT Invoke(SyncMethod aSyncMethod, AsyncMethod aAsyncMethod, Args... aArgs)
{ {
if (mSyncObj) { if (mSyncObj) {
return (mSyncObj->*aSyncMethod)(Forward<Args>(aArgs)...); return (mSyncObj->*aSyncMethod)(std::forward<Args>(aArgs)...);
} }
MOZ_ASSERT(mAsyncCall); MOZ_ASSERT(mAsyncCall);
@@ -317,7 +317,7 @@ public:
return E_POINTER; return E_POINTER;
} }
return (asyncInterface->*aAsyncMethod)(Forward<Args>(aArgs)...); return (asyncInterface->*aAsyncMethod)(std::forward<Args>(aArgs)...);
} }
AsyncInvoker(const AsyncInvoker& aOther) = delete; AsyncInvoker(const AsyncInvoker& aOther) = delete;

View File

@@ -36,12 +36,12 @@ public:
} }
explicit COMPtrHolder(COMPtrType&& aPtr) explicit COMPtrHolder(COMPtrType&& aPtr)
: mPtr(Forward<COMPtrType>(aPtr)) : mPtr(std::forward<COMPtrType>(aPtr))
{ {
} }
COMPtrHolder(COMPtrType&& aPtr, const ActivationContext& aActCtx) COMPtrHolder(COMPtrType&& aPtr, const ActivationContext& aActCtx)
: mPtr(Forward<COMPtrType>(aPtr)) : mPtr(std::forward<COMPtrType>(aPtr))
, mActCtx(aActCtx) , mActCtx(aActCtx)
{ {
} }
@@ -58,7 +58,7 @@ public:
void Set(COMPtrType&& aPtr) void Set(COMPtrType&& aPtr)
{ {
mPtr = Forward<COMPtrType>(aPtr); mPtr = std::forward<COMPtrType>(aPtr);
} }
void SetActCtx(const ActivationContext& aActCtx) void SetActCtx(const ActivationContext& aActCtx)

View File

@@ -47,7 +47,7 @@ InvokeOnMainThread(const char* aName,
{ {
nsCOMPtr<nsIRunnable> runnable( nsCOMPtr<nsIRunnable> runnable(
NewNonOwningRunnableMethod<Args...>(aName, aObject, aMethod, NewNonOwningRunnableMethod<Args...>(aName, aObject, aMethod,
Forward<Args>(aArgs)...)); std::forward<Args>(aArgs)...));
MainThreadInvoker invoker; MainThreadInvoker invoker;
return invoker.Invoke(runnable.forget()); return invoker.Invoke(runnable.forget());

View File

@@ -338,7 +338,7 @@ RegisteredProxy::~RegisteredProxy()
RegisteredProxy::RegisteredProxy(RegisteredProxy&& aOther) RegisteredProxy::RegisteredProxy(RegisteredProxy&& aOther)
{ {
*this = mozilla::Forward<RegisteredProxy>(aOther); *this = std::forward<RegisteredProxy>(aOther);
} }
RegisteredProxy& RegisteredProxy&

View File

@@ -41,7 +41,7 @@ class MOZ_NONHEAP_CLASS Factory : public IClassFactory
template <typename... Args> template <typename... Args>
HRESULT DoCreate(HRESULT (*aFnPtr)(IUnknown*, REFIID, void**), Args... args) HRESULT DoCreate(HRESULT (*aFnPtr)(IUnknown*, REFIID, void**), Args... args)
{ {
return aFnPtr(mozilla::Forward<Args>(args)...); return aFnPtr(std::forward<Args>(args)...);
} }
public: public:

View File

@@ -191,29 +191,29 @@ class MutableWrappedPtrOperations<JS::GCHashMap<Args...>, Wrapper>
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) { bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) {
return map().add(p, mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v)); return map().add(p, std::forward<KeyInput>(k), std::forward<ValueInput>(v));
} }
template<typename KeyInput> template<typename KeyInput>
bool add(AddPtr& p, KeyInput&& k) { bool add(AddPtr& p, KeyInput&& k) {
return map().add(p, mozilla::Forward<KeyInput>(k), Map::Value()); return map().add(p, std::forward<KeyInput>(k), Map::Value());
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) { bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) {
return map().relookupOrAdd(p, k, return map().relookupOrAdd(p, k,
mozilla::Forward<KeyInput>(k), std::forward<KeyInput>(k),
mozilla::Forward<ValueInput>(v)); std::forward<ValueInput>(v));
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool put(KeyInput&& k, ValueInput&& v) { bool put(KeyInput&& k, ValueInput&& v) {
return map().put(mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v)); return map().put(std::forward<KeyInput>(k), std::forward<ValueInput>(v));
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool putNew(KeyInput&& k, ValueInput&& v) { bool putNew(KeyInput&& k, ValueInput&& v) {
return map().putNew(mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v)); return map().putNew(std::forward<KeyInput>(k), std::forward<ValueInput>(v));
} }
}; };
@@ -336,27 +336,27 @@ class MutableWrappedPtrOperations<JS::GCHashSet<Args...>, Wrapper>
template<typename TInput> template<typename TInput>
bool add(AddPtr& p, TInput&& t) { bool add(AddPtr& p, TInput&& t) {
return set().add(p, mozilla::Forward<TInput>(t)); return set().add(p, std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool relookupOrAdd(AddPtr& p, const Lookup& l, TInput&& t) { bool relookupOrAdd(AddPtr& p, const Lookup& l, TInput&& t) {
return set().relookupOrAdd(p, l, mozilla::Forward<TInput>(t)); return set().relookupOrAdd(p, l, std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool put(TInput&& t) { bool put(TInput&& t) {
return set().put(mozilla::Forward<TInput>(t)); return set().put(std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool putNew(TInput&& t) { bool putNew(TInput&& t) {
return set().putNew(mozilla::Forward<TInput>(t)); return set().putNew(std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool putNew(const Lookup& l, TInput&& t) { bool putNew(const Lookup& l, TInput&& t) {
return set().putNew(l, mozilla::Forward<TInput>(t)); return set().putNew(l, std::forward<TInput>(t));
} }
}; };
@@ -380,11 +380,11 @@ class WeakCache<GCHashMap<Key, Value, HashPolicy, AllocPolicy, MapSweepPolicy>>
public: public:
template <typename... Args> template <typename... Args>
explicit WeakCache(Zone* zone, Args&&... args) explicit WeakCache(Zone* zone, Args&&... args)
: WeakCacheBase(zone), map(mozilla::Forward<Args>(args)...), needsBarrier(false) : WeakCacheBase(zone), map(std::forward<Args>(args)...), needsBarrier(false)
{} {}
template <typename... Args> template <typename... Args>
explicit WeakCache(JSRuntime* rt, Args&&... args) explicit WeakCache(JSRuntime* rt, Args&&... args)
: WeakCacheBase(rt), map(mozilla::Forward<Args>(args)...), needsBarrier(false) : WeakCacheBase(rt), map(std::forward<Args>(args)...), needsBarrier(false)
{} {}
~WeakCache() { ~WeakCache() {
MOZ_ASSERT(!needsBarrier); MOZ_ASSERT(!needsBarrier);
@@ -558,32 +558,27 @@ class WeakCache<GCHashMap<Key, Value, HashPolicy, AllocPolicy, MapSweepPolicy>>
template<typename KeyInput> template<typename KeyInput>
bool add(AddPtr& p, KeyInput&& k) { bool add(AddPtr& p, KeyInput&& k) {
using mozilla::Forward; return map.add(p, std::forward<KeyInput>(k));
return map.add(p, Forward<KeyInput>(k));
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) { bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) {
using mozilla::Forward; return map.add(p, std::forward<KeyInput>(k), std::forward<ValueInput>(v));
return map.add(p, Forward<KeyInput>(k), Forward<ValueInput>(v));
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) { bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) {
using mozilla::Forward; return map.relookupOrAdd(p, std::forward<KeyInput>(k), std::forward<ValueInput>(v));
return map.relookupOrAdd(p, Forward<KeyInput>(k), Forward<ValueInput>(v));
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool put(KeyInput&& k, ValueInput&& v) { bool put(KeyInput&& k, ValueInput&& v) {
using mozilla::Forward; return map.put(std::forward<KeyInput>(k), std::forward<ValueInput>(v));
return map.put(Forward<KeyInput>(k), Forward<ValueInput>(v));
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
bool putNew(KeyInput&& k, ValueInput&& v) { bool putNew(KeyInput&& k, ValueInput&& v) {
using mozilla::Forward; return map.putNew(std::forward<KeyInput>(k), std::forward<ValueInput>(v));
return map.putNew(Forward<KeyInput>(k), Forward<ValueInput>(v));
} }
}; };
@@ -604,11 +599,11 @@ class WeakCache<GCHashSet<T, HashPolicy, AllocPolicy>>
template <typename... Args> template <typename... Args>
explicit WeakCache(Zone* zone, Args&&... args) explicit WeakCache(Zone* zone, Args&&... args)
: WeakCacheBase(zone), set(mozilla::Forward<Args>(args)...), needsBarrier(false) : WeakCacheBase(zone), set(std::forward<Args>(args)...), needsBarrier(false)
{} {}
template <typename... Args> template <typename... Args>
explicit WeakCache(JSRuntime* rt, Args&&... args) explicit WeakCache(JSRuntime* rt, Args&&... args)
: WeakCacheBase(rt), set(mozilla::Forward<Args>(args)...), needsBarrier(false) : WeakCacheBase(rt), set(std::forward<Args>(args)...), needsBarrier(false)
{} {}
size_t sweep() override { size_t sweep() override {
@@ -775,27 +770,27 @@ class WeakCache<GCHashSet<T, HashPolicy, AllocPolicy>>
template<typename TInput> template<typename TInput>
bool add(AddPtr& p, TInput&& t) { bool add(AddPtr& p, TInput&& t) {
return set.add(p, mozilla::Forward<TInput>(t)); return set.add(p, std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool relookupOrAdd(AddPtr& p, const Lookup& l, TInput&& t) { bool relookupOrAdd(AddPtr& p, const Lookup& l, TInput&& t) {
return set.relookupOrAdd(p, l, mozilla::Forward<TInput>(t)); return set.relookupOrAdd(p, l, std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool put(TInput&& t) { bool put(TInput&& t) {
return set.put(mozilla::Forward<TInput>(t)); return set.put(std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool putNew(TInput&& t) { bool putNew(TInput&& t) {
return set.putNew(mozilla::Forward<TInput>(t)); return set.putNew(std::forward<TInput>(t));
} }
template<typename TInput> template<typename TInput>
bool putNew(const Lookup& l, TInput&& t) { bool putNew(const Lookup& l, TInput&& t) {
return set.putNew(l, mozilla::Forward<TInput>(t)); return set.putNew(l, std::forward<TInput>(t));
} }
}; };

View File

@@ -76,17 +76,17 @@ class GCVector
void clear() { return vector.clear(); } void clear() { return vector.clear(); }
void clearAndFree() { return vector.clearAndFree(); } void clearAndFree() { return vector.clearAndFree(); }
template<typename U> bool append(U&& item) { return vector.append(mozilla::Forward<U>(item)); } template<typename U> bool append(U&& item) { return vector.append(std::forward<U>(item)); }
template<typename... Args> template<typename... Args>
MOZ_MUST_USE bool MOZ_MUST_USE bool
emplaceBack(Args&&... args) { emplaceBack(Args&&... args) {
return vector.emplaceBack(mozilla::Forward<Args>(args)...); return vector.emplaceBack(std::forward<Args>(args)...);
} }
template<typename U> template<typename U>
void infallibleAppend(U&& aU) { void infallibleAppend(U&& aU) {
return vector.infallibleAppend(mozilla::Forward<U>(aU)); return vector.infallibleAppend(std::forward<U>(aU));
} }
void infallibleAppendN(const T& aT, size_t aN) { void infallibleAppendN(const T& aT, size_t aN) {
return vector.infallibleAppendN(aT, aN); return vector.infallibleAppendN(aT, aN);
@@ -214,10 +214,10 @@ class MutableWrappedPtrOperations<JS::GCVector<T, Capacity, AllocPolicy>, Wrappe
void clear() { vec().clear(); } void clear() { vec().clear(); }
void clearAndFree() { vec().clearAndFree(); } void clearAndFree() { vec().clearAndFree(); }
template<typename U> template<typename U>
MOZ_MUST_USE bool append(U&& aU) { return vec().append(mozilla::Forward<U>(aU)); } MOZ_MUST_USE bool append(U&& aU) { return vec().append(std::forward<U>(aU)); }
template<typename... Args> template<typename... Args>
MOZ_MUST_USE bool emplaceBack(Args&&... aArgs) { MOZ_MUST_USE bool emplaceBack(Args&&... aArgs) {
return vec().emplaceBack(mozilla::Forward<Args...>(aArgs...)); return vec().emplaceBack(std::forward<Args...>(aArgs...));
} }
template<typename U> template<typename U>
MOZ_MUST_USE bool appendAll(const U& aU) { return vec().appendAll(aU); } MOZ_MUST_USE bool appendAll(const U& aU) { return vec().appendAll(aU); }
@@ -231,7 +231,7 @@ class MutableWrappedPtrOperations<JS::GCVector<T, Capacity, AllocPolicy>, Wrappe
return vec().append(aBegin, aLength); return vec().append(aBegin, aLength);
} }
template<typename U> void infallibleAppend(U&& aU) { template<typename U> void infallibleAppend(U&& aU) {
vec().infallibleAppend(mozilla::Forward<U>(aU)); vec().infallibleAppend(std::forward<U>(aU));
} }
void infallibleAppendN(const T& aT, size_t aN) { vec().infallibleAppendN(aT, aN); } void infallibleAppendN(const T& aT, size_t aN) { vec().infallibleAppendN(aT, aN); }
template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) { template<typename U> void infallibleAppend(const U* aBegin, const U* aEnd) {
@@ -243,7 +243,7 @@ class MutableWrappedPtrOperations<JS::GCVector<T, Capacity, AllocPolicy>, Wrappe
void popBack() { vec().popBack(); } void popBack() { vec().popBack(); }
T popCopy() { return vec().popCopy(); } T popCopy() { return vec().popCopy(); }
template<typename U> T* insert(T* aP, U&& aVal) { template<typename U> T* insert(T* aP, U&& aVal) {
return vec().insert(aP, mozilla::Forward<U>(aVal)); return vec().insert(aP, std::forward<U>(aVal));
} }
void erase(T* aT) { vec().erase(aT); } void erase(T* aT) { vec().erase(aT); }
void erase(T* aBegin, T* aEnd) { vec().erase(aBegin, aEnd); } void erase(T* aBegin, T* aEnd) { vec().erase(aBegin, aEnd); }

View File

@@ -155,20 +155,20 @@ class HashMap
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) { MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& k, ValueInput&& v) {
return impl.add(p, return impl.add(p,
mozilla::Forward<KeyInput>(k), std::forward<KeyInput>(k),
mozilla::Forward<ValueInput>(v)); std::forward<ValueInput>(v));
} }
template<typename KeyInput> template<typename KeyInput>
MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& k) { MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& k) {
return impl.add(p, mozilla::Forward<KeyInput>(k), Value()); return impl.add(p, std::forward<KeyInput>(k), Value());
} }
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
MOZ_MUST_USE bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) { MOZ_MUST_USE bool relookupOrAdd(AddPtr& p, KeyInput&& k, ValueInput&& v) {
return impl.relookupOrAdd(p, k, return impl.relookupOrAdd(p, k,
mozilla::Forward<KeyInput>(k), std::forward<KeyInput>(k),
mozilla::Forward<ValueInput>(v)); std::forward<ValueInput>(v));
} }
// |all()| returns a Range containing |count()| elements. E.g.: // |all()| returns a Range containing |count()| elements. E.g.:
@@ -241,22 +241,22 @@ class HashMap
MOZ_MUST_USE bool put(KeyInput&& k, ValueInput&& v) { MOZ_MUST_USE bool put(KeyInput&& k, ValueInput&& v) {
AddPtr p = lookupForAdd(k); AddPtr p = lookupForAdd(k);
if (p) { if (p) {
p->value() = mozilla::Forward<ValueInput>(v); p->value() = std::forward<ValueInput>(v);
return true; return true;
} }
return add(p, mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v)); return add(p, std::forward<KeyInput>(k), std::forward<ValueInput>(v));
} }
// Like put, but assert that the given key is not already present. // Like put, but assert that the given key is not already present.
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
MOZ_MUST_USE bool putNew(KeyInput&& k, ValueInput&& v) { MOZ_MUST_USE bool putNew(KeyInput&& k, ValueInput&& v) {
return impl.putNew(k, mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v)); return impl.putNew(k, std::forward<KeyInput>(k), std::forward<ValueInput>(v));
} }
// Only call this to populate an empty map after reserving space with init(). // Only call this to populate an empty map after reserving space with init().
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
void putNewInfallible(KeyInput&& k, ValueInput&& v) { void putNewInfallible(KeyInput&& k, ValueInput&& v) {
impl.putNewInfallible(k, mozilla::Forward<KeyInput>(k), mozilla::Forward<ValueInput>(v)); impl.putNewInfallible(k, std::forward<KeyInput>(k), std::forward<ValueInput>(v));
} }
// Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom. // Add (k,defaultValue) if |k| is not found. Return a false-y Ptr on oom.
@@ -410,12 +410,12 @@ class HashSet
template <typename U> template <typename U>
MOZ_MUST_USE bool add(AddPtr& p, U&& u) { MOZ_MUST_USE bool add(AddPtr& p, U&& u) {
return impl.add(p, mozilla::Forward<U>(u)); return impl.add(p, std::forward<U>(u));
} }
template <typename U> template <typename U>
MOZ_MUST_USE bool relookupOrAdd(AddPtr& p, const Lookup& l, U&& u) { MOZ_MUST_USE bool relookupOrAdd(AddPtr& p, const Lookup& l, U&& u) {
return impl.relookupOrAdd(p, l, mozilla::Forward<U>(u)); return impl.relookupOrAdd(p, l, std::forward<U>(u));
} }
// |all()| returns a Range containing |count()| elements: // |all()| returns a Range containing |count()| elements:
@@ -487,24 +487,24 @@ class HashSet
template <typename U> template <typename U>
MOZ_MUST_USE bool put(U&& u) { MOZ_MUST_USE bool put(U&& u) {
AddPtr p = lookupForAdd(u); AddPtr p = lookupForAdd(u);
return p ? true : add(p, mozilla::Forward<U>(u)); return p ? true : add(p, std::forward<U>(u));
} }
// Like put, but assert that the given key is not already present. // Like put, but assert that the given key is not already present.
template <typename U> template <typename U>
MOZ_MUST_USE bool putNew(U&& u) { MOZ_MUST_USE bool putNew(U&& u) {
return impl.putNew(u, mozilla::Forward<U>(u)); return impl.putNew(u, std::forward<U>(u));
} }
template <typename U> template <typename U>
MOZ_MUST_USE bool putNew(const Lookup& l, U&& u) { MOZ_MUST_USE bool putNew(const Lookup& l, U&& u) {
return impl.putNew(l, mozilla::Forward<U>(u)); return impl.putNew(l, std::forward<U>(u));
} }
// Only call this to populate an empty set after reserving space with init(). // Only call this to populate an empty set after reserving space with init().
template <typename U> template <typename U>
void putNewInfallible(const Lookup& l, U&& u) { void putNewInfallible(const Lookup& l, U&& u) {
impl.putNewInfallible(l, mozilla::Forward<U>(u)); impl.putNewInfallible(l, std::forward<U>(u));
} }
void remove(const Lookup& l) { void remove(const Lookup& l) {
@@ -712,13 +712,13 @@ struct FallibleHashMethods
template <typename HashPolicy, typename Lookup> template <typename HashPolicy, typename Lookup>
static bool static bool
HasHash(Lookup&& l) { HasHash(Lookup&& l) {
return FallibleHashMethods<typename HashPolicy::Base>::hasHash(mozilla::Forward<Lookup>(l)); return FallibleHashMethods<typename HashPolicy::Base>::hasHash(std::forward<Lookup>(l));
} }
template <typename HashPolicy, typename Lookup> template <typename HashPolicy, typename Lookup>
static bool static bool
EnsureHash(Lookup&& l) { EnsureHash(Lookup&& l) {
return FallibleHashMethods<typename HashPolicy::Base>::ensureHash(mozilla::Forward<Lookup>(l)); return FallibleHashMethods<typename HashPolicy::Base>::ensureHash(std::forward<Lookup>(l));
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -741,8 +741,8 @@ class HashMapEntry
public: public:
template<typename KeyInput, typename ValueInput> template<typename KeyInput, typename ValueInput>
HashMapEntry(KeyInput&& k, ValueInput&& v) HashMapEntry(KeyInput&& k, ValueInput&& v)
: key_(mozilla::Forward<KeyInput>(k)), : key_(std::forward<KeyInput>(k)),
value_(mozilla::Forward<ValueInput>(v)) value_(std::forward<ValueInput>(v))
{} {}
HashMapEntry(HashMapEntry&& rhs) HashMapEntry(HashMapEntry&& rhs)
@@ -920,7 +920,7 @@ class HashTableEntry
{ {
MOZ_ASSERT(!isLive()); MOZ_ASSERT(!isLive());
keyHash = hn; keyHash = hn;
new (valuePtr()) T(mozilla::Forward<Args>(args)...); new (valuePtr()) T(std::forward<Args>(args)...);
MOZ_ASSERT(isLive()); MOZ_ASSERT(isLive());
} }
}; };
@@ -1729,7 +1729,7 @@ class HashTable : private AllocPolicy
keyHash |= sCollisionBit; keyHash |= sCollisionBit;
} }
entry->setLive(keyHash, mozilla::Forward<Args>(args)...); entry->setLive(keyHash, std::forward<Args>(args)...);
entryCount++; entryCount++;
#ifdef JS_DEBUG #ifdef JS_DEBUG
mutationCount++; mutationCount++;
@@ -1880,7 +1880,7 @@ class HashTable : private AllocPolicy
p.entry_ = &findFreeEntry(p.keyHash); p.entry_ = &findFreeEntry(p.keyHash);
} }
p.entry_->setLive(p.keyHash, mozilla::Forward<Args>(args)...); p.entry_->setLive(p.keyHash, std::forward<Args>(args)...);
entryCount++; entryCount++;
#ifdef JS_DEBUG #ifdef JS_DEBUG
mutationCount++; mutationCount++;
@@ -1897,7 +1897,7 @@ class HashTable : private AllocPolicy
{ {
MOZ_ASSERT(!lookup(l).found()); MOZ_ASSERT(!lookup(l).found());
mozilla::ReentrancyGuard g(*this); mozilla::ReentrancyGuard g(*this);
putNewInfallibleInternal(l, mozilla::Forward<Args>(args)...); putNewInfallibleInternal(l, std::forward<Args>(args)...);
} }
// Note: |l| may be alias arguments in |args|, so this function must take // Note: |l| may be alias arguments in |args|, so this function must take
@@ -1914,7 +1914,7 @@ class HashTable : private AllocPolicy
if (checkOverloaded() == RehashFailed) if (checkOverloaded() == RehashFailed)
return false; return false;
putNewInfallible(l, mozilla::Forward<Args>(args)...); putNewInfallible(l, std::forward<Args>(args)...);
return true; return true;
} }
@@ -1936,7 +1936,7 @@ class HashTable : private AllocPolicy
MOZ_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed MOZ_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
p.entry_ = &lookup(l, p.keyHash, sCollisionBit); p.entry_ = &lookup(l, p.keyHash, sCollisionBit);
} }
return p.found() || add(p, mozilla::Forward<Args>(args)...); return p.found() || add(p, std::forward<Args>(args)...);
} }
void remove(Ptr p) void remove(Ptr p)

View File

@@ -347,12 +347,12 @@ class JS_FRIEND_API(GCCellPtr)
template <typename F, typename... Args> template <typename F, typename... Args>
auto auto
DispatchTyped(F f, GCCellPtr thing, Args&&... args) DispatchTyped(F f, GCCellPtr thing, Args&&... args)
-> decltype(f(static_cast<JSObject*>(nullptr), mozilla::Forward<Args>(args)...)) -> decltype(f(static_cast<JSObject*>(nullptr), std::forward<Args>(args)...))
{ {
switch (thing.kind()) { switch (thing.kind()) {
#define JS_EXPAND_DEF(name, type, _) \ #define JS_EXPAND_DEF(name, type, _) \
case JS::TraceKind::name: \ case JS::TraceKind::name: \
return f(&thing.as<type>(), mozilla::Forward<Args>(args)...); return f(&thing.as<type>(), std::forward<Args>(args)...);
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF); JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
#undef JS_EXPAND_DEF #undef JS_EXPAND_DEF
default: default:

View File

@@ -229,12 +229,12 @@ struct BarrierMethods<jsid>
template <typename F, typename... Args> template <typename F, typename... Args>
auto auto
DispatchTyped(F f, const jsid& id, Args&&... args) DispatchTyped(F f, const jsid& id, Args&&... args)
-> decltype(f(static_cast<JSString*>(nullptr), mozilla::Forward<Args>(args)...)) -> decltype(f(static_cast<JSString*>(nullptr), std::forward<Args>(args)...))
{ {
if (JSID_IS_STRING(id)) if (JSID_IS_STRING(id))
return f(JSID_TO_STRING(id), mozilla::Forward<Args>(args)...); return f(JSID_TO_STRING(id), std::forward<Args>(args)...);
if (JSID_IS_SYMBOL(id)) if (JSID_IS_SYMBOL(id))
return f(JSID_TO_SYMBOL(id), mozilla::Forward<Args>(args)...); return f(JSID_TO_SYMBOL(id), std::forward<Args>(args)...);
MOZ_ASSERT(!JSID_IS_GCTHING(id)); MOZ_ASSERT(!JSID_IS_GCTHING(id));
return F::defaultValue(id); return F::defaultValue(id);
} }

View File

@@ -768,10 +768,10 @@ template <typename T>
struct FallibleHashMethods<MovableCellHasher<T>> struct FallibleHashMethods<MovableCellHasher<T>>
{ {
template <typename Lookup> static bool hasHash(Lookup&& l) { template <typename Lookup> static bool hasHash(Lookup&& l) {
return MovableCellHasher<T>::hasHash(mozilla::Forward<Lookup>(l)); return MovableCellHasher<T>::hasHash(std::forward<Lookup>(l));
} }
template <typename Lookup> static bool ensureHash(Lookup&& l) { template <typename Lookup> static bool ensureHash(Lookup&& l) {
return MovableCellHasher<T>::ensureHash(mozilla::Forward<Lookup>(l)); return MovableCellHasher<T>::ensureHash(std::forward<Lookup>(l));
} }
}; };
@@ -801,7 +801,7 @@ class alignas(8) DispatchWrapper
template <typename U> template <typename U>
MOZ_IMPLICIT DispatchWrapper(U&& initial) MOZ_IMPLICIT DispatchWrapper(U&& initial)
: tracer(&JS::GCPolicy<T>::trace), : tracer(&JS::GCPolicy<T>::trace),
storage(mozilla::Forward<U>(initial)) storage(std::forward<U>(initial))
{ } { }
// Mimic a pointer type, so that we can drop into Rooted. // Mimic a pointer type, so that we can drop into Rooted.
@@ -995,7 +995,7 @@ class MOZ_RAII Rooted : public js::RootedBase<T, Rooted<T>>
template <typename RootingContext, typename S> template <typename RootingContext, typename S>
Rooted(const RootingContext& cx, S&& initial) Rooted(const RootingContext& cx, S&& initial)
: ptr(mozilla::Forward<S>(initial)) : ptr(std::forward<S>(initial))
{ {
MOZ_ASSERT(GCPolicy<T>::isValid(ptr)); MOZ_ASSERT(GCPolicy<T>::isValid(ptr));
registerWithRootLists(rootLists(cx)); registerWithRootLists(rootLists(cx));
@@ -1279,14 +1279,14 @@ class PersistentRooted : public js::RootedBase<T, PersistentRooted<T>>,
template <typename U> template <typename U>
PersistentRooted(RootingContext* cx, U&& initial) PersistentRooted(RootingContext* cx, U&& initial)
: ptr(mozilla::Forward<U>(initial)) : ptr(std::forward<U>(initial))
{ {
registerWithRootLists(cx); registerWithRootLists(cx);
} }
template <typename U> template <typename U>
PersistentRooted(JSContext* cx, U&& initial) PersistentRooted(JSContext* cx, U&& initial)
: ptr(mozilla::Forward<U>(initial)) : ptr(std::forward<U>(initial))
{ {
registerWithRootLists(RootingContext::get(cx)); registerWithRootLists(RootingContext::get(cx));
} }
@@ -1299,7 +1299,7 @@ class PersistentRooted : public js::RootedBase<T, PersistentRooted<T>>,
template <typename U> template <typename U>
PersistentRooted(JSRuntime* rt, U&& initial) PersistentRooted(JSRuntime* rt, U&& initial)
: ptr(mozilla::Forward<U>(initial)) : ptr(std::forward<U>(initial))
{ {
registerWithRootLists(rt); registerWithRootLists(rt);
} }
@@ -1329,7 +1329,7 @@ class PersistentRooted : public js::RootedBase<T, PersistentRooted<T>>,
template <typename U> template <typename U>
void init(JSContext* cx, U&& initial) { void init(JSContext* cx, U&& initial) {
ptr = mozilla::Forward<U>(initial); ptr = std::forward<U>(initial);
registerWithRootLists(RootingContext::get(cx)); registerWithRootLists(RootingContext::get(cx));
} }
@@ -1360,7 +1360,7 @@ class PersistentRooted : public js::RootedBase<T, PersistentRooted<T>>,
template <typename U> template <typename U>
void set(U&& value) { void set(U&& value) {
MOZ_ASSERT(initialized()); MOZ_ASSERT(initialized());
ptr = mozilla::Forward<U>(value); ptr = std::forward<U>(value);
} }
detail::MaybeWrapped<T> ptr; detail::MaybeWrapped<T> ptr;

View File

@@ -66,11 +66,11 @@ class WeakCache : protected detail::WeakCacheBase,
template <typename... Args> template <typename... Args>
explicit WeakCache(Zone* zone, Args&&... args) explicit WeakCache(Zone* zone, Args&&... args)
: WeakCacheBase(zone), cache(mozilla::Forward<Args>(args)...) : WeakCacheBase(zone), cache(std::forward<Args>(args)...)
{} {}
template <typename... Args> template <typename... Args>
explicit WeakCache(JSRuntime* rt, Args&&... args) explicit WeakCache(JSRuntime* rt, Args&&... args)
: WeakCacheBase(rt), cache(mozilla::Forward<Args>(args)...) : WeakCacheBase(rt), cache(std::forward<Args>(args)...)
{} {}
const T& get() const { return cache; } const T& get() const { return cache; }

View File

@@ -196,12 +196,12 @@ template <> struct MapTypeToRootKind<JSFunction*> : public MapTypeToRootKind<JSO
template <typename F, typename... Args> template <typename F, typename... Args>
auto auto
DispatchTraceKindTyped(F f, JS::TraceKind traceKind, Args&&... args) DispatchTraceKindTyped(F f, JS::TraceKind traceKind, Args&&... args)
-> decltype(f. JS_DEPENDENT_TEMPLATE_HINT operator()<JSObject>(mozilla::Forward<Args>(args)...)) -> decltype(f. JS_DEPENDENT_TEMPLATE_HINT operator()<JSObject>(std::forward<Args>(args)...))
{ {
switch (traceKind) { switch (traceKind) {
#define JS_EXPAND_DEF(name, type, _) \ #define JS_EXPAND_DEF(name, type, _) \
case JS::TraceKind::name: \ case JS::TraceKind::name: \
return f. JS_DEPENDENT_TEMPLATE_HINT operator()<type>(mozilla::Forward<Args>(args)...); return f. JS_DEPENDENT_TEMPLATE_HINT operator()<type>(std::forward<Args>(args)...);
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF); JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
#undef JS_EXPAND_DEF #undef JS_EXPAND_DEF
default: default:
@@ -213,12 +213,12 @@ DispatchTraceKindTyped(F f, JS::TraceKind traceKind, Args&&... args)
template <typename F, typename... Args> template <typename F, typename... Args>
auto auto
DispatchTraceKindTyped(F f, void* thing, JS::TraceKind traceKind, Args&&... args) DispatchTraceKindTyped(F f, void* thing, JS::TraceKind traceKind, Args&&... args)
-> decltype(f(static_cast<JSObject*>(nullptr), mozilla::Forward<Args>(args)...)) -> decltype(f(static_cast<JSObject*>(nullptr), std::forward<Args>(args)...))
{ {
switch (traceKind) { switch (traceKind) {
#define JS_EXPAND_DEF(name, type, _) \ #define JS_EXPAND_DEF(name, type, _) \
case JS::TraceKind::name: \ case JS::TraceKind::name: \
return f(static_cast<type*>(thing), mozilla::Forward<Args>(args)...); return f(static_cast<type*>(thing), std::forward<Args>(args)...);
JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF); JS_FOR_EACH_TRACEKIND(JS_EXPAND_DEF);
#undef JS_EXPAND_DEF #undef JS_EXPAND_DEF
default: default:

View File

@@ -176,7 +176,6 @@ class StackFrame;
namespace JS { namespace JS {
namespace ubi { namespace ubi {
using mozilla::Forward;
using mozilla::Maybe; using mozilla::Maybe;
using mozilla::RangedPtr; using mozilla::RangedPtr;
using mozilla::Variant; using mozilla::Variant;
@@ -196,13 +195,13 @@ class JS_PUBLIC_API(AtomOrTwoByteChars) : public Variant<JSAtom*, const char16_t
public: public:
template<typename T> template<typename T>
MOZ_IMPLICIT AtomOrTwoByteChars(T&& rhs) : Base(Forward<T>(rhs)) { } MOZ_IMPLICIT AtomOrTwoByteChars(T&& rhs) : Base(std::forward<T>(rhs)) { }
template<typename T> template<typename T>
AtomOrTwoByteChars& operator=(T&& rhs) { AtomOrTwoByteChars& operator=(T&& rhs) {
MOZ_ASSERT(this != &rhs, "self-move disallowed"); MOZ_ASSERT(this != &rhs, "self-move disallowed");
this->~AtomOrTwoByteChars(); this->~AtomOrTwoByteChars();
new (this) AtomOrTwoByteChars(Forward<T>(rhs)); new (this) AtomOrTwoByteChars(std::forward<T>(rhs));
return *this; return *this;
} }

View File

@@ -45,7 +45,7 @@ template<typename T, typename... Args>
typename detail::UniqueSelector<T>::SingleObject typename detail::UniqueSelector<T>::SingleObject
MakeUnique(Args&&... aArgs) MakeUnique(Args&&... aArgs)
{ {
return UniquePtr<T>(js_new<T>(mozilla::Forward<Args>(aArgs)...)); return UniquePtr<T>(js_new<T>(std::forward<Args>(aArgs)...));
} }
template<typename T> template<typename T>

View File

@@ -479,7 +479,7 @@ JS_PUBLIC_API(char*) js_strdup(const char* s);
NEWNAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \ NEWNAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \
void* memory = ALLOCATOR(sizeof(T)); \ void* memory = ALLOCATOR(sizeof(T)); \
return MOZ_LIKELY(memory) \ return MOZ_LIKELY(memory) \
? new(memory) T(mozilla::Forward<Args>(args)...) \ ? new(memory) T(std::forward<Args>(args)...) \
: nullptr; \ : nullptr; \
} }
@@ -497,7 +497,7 @@ JS_PUBLIC_API(char*) js_strdup(const char* s);
template <class T, typename... Args> \ template <class T, typename... Args> \
QUALIFIERS mozilla::UniquePtr<T, JS::DeletePolicy<T>> \ QUALIFIERS mozilla::UniquePtr<T, JS::DeletePolicy<T>> \
MAKENAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \ MAKENAME(Args&&... args) MOZ_HEAP_ALLOCATOR { \
T* ptr = NEWNAME<T>(mozilla::Forward<Args>(args)...); \ T* ptr = NEWNAME<T>(std::forward<Args>(args)...); \
return mozilla::UniquePtr<T, JS::DeletePolicy<T>>(ptr); \ return mozilla::UniquePtr<T, JS::DeletePolicy<T>>(ptr); \
} }

View File

@@ -1429,33 +1429,33 @@ class HeapBase<JS::Value, Wrapper> : public WrappedPtrOperations<JS::Value, Wrap
template <typename F, typename... Args> template <typename F, typename... Args>
auto auto
DispatchTyped(F f, const JS::Value& val, Args&&... args) DispatchTyped(F f, const JS::Value& val, Args&&... args)
-> decltype(f(static_cast<JSObject*>(nullptr), mozilla::Forward<Args>(args)...)) -> decltype(f(static_cast<JSObject*>(nullptr), std::forward<Args>(args)...))
{ {
if (val.isString()) { if (val.isString()) {
JSString* str = val.toString(); JSString* str = val.toString();
MOZ_ASSERT(gc::IsCellPointerValid(str)); MOZ_ASSERT(gc::IsCellPointerValid(str));
return f(str, mozilla::Forward<Args>(args)...); return f(str, std::forward<Args>(args)...);
} }
if (val.isObject()) { if (val.isObject()) {
JSObject* obj = &val.toObject(); JSObject* obj = &val.toObject();
MOZ_ASSERT(gc::IsCellPointerValid(obj)); MOZ_ASSERT(gc::IsCellPointerValid(obj));
return f(obj, mozilla::Forward<Args>(args)...); return f(obj, std::forward<Args>(args)...);
} }
if (val.isSymbol()) { if (val.isSymbol()) {
JS::Symbol* sym = val.toSymbol(); JS::Symbol* sym = val.toSymbol();
MOZ_ASSERT(gc::IsCellPointerValid(sym)); MOZ_ASSERT(gc::IsCellPointerValid(sym));
return f(sym, mozilla::Forward<Args>(args)...); return f(sym, std::forward<Args>(args)...);
} }
#ifdef ENABLE_BIGINT #ifdef ENABLE_BIGINT
if (val.isBigInt()) { if (val.isBigInt()) {
JS::BigInt* bi = val.toBigInt(); JS::BigInt* bi = val.toBigInt();
MOZ_ASSERT(gc::IsCellPointerValid(bi)); MOZ_ASSERT(gc::IsCellPointerValid(bi));
return f(bi, mozilla::Forward<Args>(args)...); return f(bi, std::forward<Args>(args)...);
} }
#endif #endif
if (MOZ_UNLIKELY(val.isPrivateGCThing())) { if (MOZ_UNLIKELY(val.isPrivateGCThing())) {
MOZ_ASSERT(gc::IsCellPointerValid(val.toGCThing())); MOZ_ASSERT(gc::IsCellPointerValid(val.toGCThing()));
return DispatchTyped(f, val.toGCCellPtr(), mozilla::Forward<Args>(args)...); return DispatchTyped(f, val.toGCCellPtr(), std::forward<Args>(args)...);
} }
MOZ_ASSERT(!val.isGCThing()); MOZ_ASSERT(!val.isGCThing());
return F::defaultValue(val); return F::defaultValue(val);

View File

@@ -31,7 +31,6 @@ using namespace js::frontend;
using JS::AutoValueArray; using JS::AutoValueArray;
using mozilla::DebugOnly; using mozilla::DebugOnly;
using mozilla::Forward;
enum ASTType { enum ASTType {
AST_ERROR = -1, AST_ERROR = -1,
@@ -322,7 +321,7 @@ class NodeBuilder
// Recursive loop to store the arguments into args. This eventually // Recursive loop to store the arguments into args. This eventually
// bottoms out in a call to the non-template callbackHelper() above. // bottoms out in a call to the non-template callbackHelper() above.
args[i].set(head); args[i].set(head);
return callbackHelper(fun, args, i + 1, Forward<Arguments>(tail)...); return callbackHelper(fun, args, i + 1, std::forward<Arguments>(tail)...);
} }
// Invoke a user-defined callback. The actual signature is: // Invoke a user-defined callback. The actual signature is:
@@ -335,7 +334,7 @@ class NodeBuilder
if (!iargs.init(cx, sizeof...(args) - 2 + size_t(saveLoc))) if (!iargs.init(cx, sizeof...(args) - 2 + size_t(saveLoc)))
return false; return false;
return callbackHelper(fun, iargs, 0, Forward<Arguments>(args)...); return callbackHelper(fun, iargs, 0, std::forward<Arguments>(args)...);
} }
// WARNING: Returning a Handle is non-standard, but it works in this case // WARNING: Returning a Handle is non-standard, but it works in this case
@@ -388,7 +387,7 @@ class NodeBuilder
// `name` and `value`. This eventually bottoms out in a call to the // `name` and `value`. This eventually bottoms out in a call to the
// non-template newNodeHelper() above. // non-template newNodeHelper() above.
return defineProperty(obj, name, value) return defineProperty(obj, name, value)
&& newNodeHelper(obj, Forward<Arguments>(rest)...); && newNodeHelper(obj, std::forward<Arguments>(rest)...);
} }
// Create a node object with "type" and "loc" properties, as well as zero // Create a node object with "type" and "loc" properties, as well as zero
@@ -402,7 +401,7 @@ class NodeBuilder
MOZ_MUST_USE bool newNode(ASTType type, TokenPos* pos, Arguments&&... args) { MOZ_MUST_USE bool newNode(ASTType type, TokenPos* pos, Arguments&&... args) {
RootedObject node(cx); RootedObject node(cx);
return createNode(type, pos, &node) && return createNode(type, pos, &node) &&
newNodeHelper(node, Forward<Arguments>(args)...); newNodeHelper(node, std::forward<Arguments>(args)...);
} }
MOZ_MUST_USE bool listNode(ASTType type, const char* propName, NodeVector& elts, TokenPos* pos, MOZ_MUST_USE bool listNode(ASTType type, const char* propName, NodeVector& elts, TokenPos* pos,

View File

@@ -124,7 +124,7 @@ class Fifo
// |const T&| or a |T&&|. // |const T&| or a |T&&|.
template <typename U> template <typename U>
MOZ_MUST_USE bool pushBack(U&& u) { MOZ_MUST_USE bool pushBack(U&& u) {
if (!rear_.append(mozilla::Forward<U>(u))) if (!rear_.append(std::forward<U>(u)))
return false; return false;
fixup(); fixup();
return true; return true;
@@ -133,7 +133,7 @@ class Fifo
// Construct a T in-place at the back of the queue. // Construct a T in-place at the back of the queue.
template <typename... Args> template <typename... Args>
MOZ_MUST_USE bool emplaceBack(Args&&... args) { MOZ_MUST_USE bool emplaceBack(Args&&... args) {
if (!rear_.emplaceBack(mozilla::Forward<Args>(args)...)) if (!rear_.emplaceBack(std::forward<Args>(args)...))
return false; return false;
fixup(); fixup();
return true; return true;

View File

@@ -298,8 +298,8 @@ class InlineTable : private AllocPolicy
if (addPtr == inlineStart() + InlineEntries) { if (addPtr == inlineStart() + InlineEntries) {
if (!switchToTable()) if (!switchToTable())
return false; return false;
return table_.putNew(mozilla::Forward<KeyInput>(key), return table_.putNew(std::forward<KeyInput>(key),
mozilla::Forward<Args>(args)...); std::forward<Args>(args)...);
} }
MOZ_ASSERT(!p.found()); MOZ_ASSERT(!p.found());
@@ -308,16 +308,16 @@ class InlineTable : private AllocPolicy
if (!this->checkSimulatedOOM()) if (!this->checkSimulatedOOM())
return false; return false;
addPtr->update(mozilla::Forward<KeyInput>(key), addPtr->update(std::forward<KeyInput>(key),
mozilla::Forward<Args>(args)...); std::forward<Args>(args)...);
++inlCount_; ++inlCount_;
++inlNext_; ++inlNext_;
return true; return true;
} }
return table_.add(p.tableAddPtr_, return table_.add(p.tableAddPtr_,
mozilla::Forward<KeyInput>(key), std::forward<KeyInput>(key),
mozilla::Forward<Args>(args)...); std::forward<Args>(args)...);
} }
void remove(Ptr& p) { void remove(Ptr& p) {
@@ -440,8 +440,8 @@ class InlineMap
template <typename KeyInput, typename ValueInput> template <typename KeyInput, typename ValueInput>
void update(KeyInput&& key, ValueInput&& value) { void update(KeyInput&& key, ValueInput&& value) {
this->key = mozilla::Forward<KeyInput>(key); this->key = std::forward<KeyInput>(key);
this->value = mozilla::Forward<ValueInput>(value); this->value = std::forward<ValueInput>(value);
} }
MOZ_MUST_USE bool moveTo(Map& map) { MOZ_MUST_USE bool moveTo(Map& map) {
@@ -537,17 +537,17 @@ class InlineMap
template <typename KeyInput, typename ValueInput> template <typename KeyInput, typename ValueInput>
MOZ_ALWAYS_INLINE MOZ_ALWAYS_INLINE
MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& key, ValueInput&& value) { MOZ_MUST_USE bool add(AddPtr& p, KeyInput&& key, ValueInput&& value) {
return impl_.add(p, mozilla::Forward<KeyInput>(key), mozilla::Forward<ValueInput>(value)); return impl_.add(p, std::forward<KeyInput>(key), std::forward<ValueInput>(value));
} }
template <typename KeyInput, typename ValueInput> template <typename KeyInput, typename ValueInput>
MOZ_MUST_USE bool put(KeyInput&& key, ValueInput&& value) { MOZ_MUST_USE bool put(KeyInput&& key, ValueInput&& value) {
AddPtr p = lookupForAdd(key); AddPtr p = lookupForAdd(key);
if (p) { if (p) {
p->value() = mozilla::Forward<ValueInput>(value); p->value() = std::forward<ValueInput>(value);
return true; return true;
} }
return add(p, mozilla::Forward<KeyInput>(key), mozilla::Forward<ValueInput>(value)); return add(p, std::forward<KeyInput>(key), std::forward<ValueInput>(value));
} }
void remove(Ptr& p) { void remove(Ptr& p) {
@@ -579,7 +579,7 @@ class InlineSet
template <typename TInput> template <typename TInput>
void update(TInput&& key) { void update(TInput&& key) {
this->key = mozilla::Forward<TInput>(key); this->key = std::forward<TInput>(key);
} }
MOZ_MUST_USE bool moveTo(Set& set) { MOZ_MUST_USE bool moveTo(Set& set) {
@@ -668,13 +668,13 @@ class InlineSet
template <typename TInput> template <typename TInput>
MOZ_ALWAYS_INLINE MOZ_ALWAYS_INLINE
MOZ_MUST_USE bool add(AddPtr& p, TInput&& key) { MOZ_MUST_USE bool add(AddPtr& p, TInput&& key) {
return impl_.add(p, mozilla::Forward<TInput>(key)); return impl_.add(p, std::forward<TInput>(key));
} }
template <typename TInput> template <typename TInput>
MOZ_MUST_USE bool put(TInput&& key) { MOZ_MUST_USE bool put(TInput&& key) {
AddPtr p = lookupForAdd(key); AddPtr p = lookupForAdd(key);
return p ? true : add(p, mozilla::Forward<TInput>(key)); return p ? true : add(p, std::forward<TInput>(key));
} }
void remove(Ptr& p) { void remove(Ptr& p) {

View File

@@ -606,7 +606,7 @@ class LifoAlloc
if (!ptr) if (!ptr)
return nullptr; return nullptr;
return new (ptr) T(mozilla::Forward<Args>(args)...); return new (ptr) T(std::forward<Args>(args)...);
} }
MOZ_ALWAYS_INLINE MOZ_ALWAYS_INLINE

View File

@@ -40,8 +40,6 @@
#include "mozilla/HashFunctions.h" #include "mozilla/HashFunctions.h"
#include "mozilla/Move.h" #include "mozilla/Move.h"
using mozilla::Forward;
namespace js { namespace js {
namespace detail { namespace detail {
@@ -176,7 +174,7 @@ class OrderedHashTable
MOZ_MUST_USE bool put(ElementInput&& element) { MOZ_MUST_USE bool put(ElementInput&& element) {
HashNumber h = prepareHash(Ops::getKey(element)); HashNumber h = prepareHash(Ops::getKey(element));
if (Data* e = lookup(Ops::getKey(element), h)) { if (Data* e = lookup(Ops::getKey(element), h)) {
e->element = Forward<ElementInput>(element); e->element = std::forward<ElementInput>(element);
return true; return true;
} }
@@ -191,7 +189,7 @@ class OrderedHashTable
h >>= hashShift; h >>= hashShift;
liveCount++; liveCount++;
Data* e = &data[dataLength++]; Data* e = &data[dataLength++];
new (e) Data(Forward<ElementInput>(element), hashTable[h]); new (e) Data(std::forward<ElementInput>(element), hashTable[h]);
hashTable[h] = e; hashTable[h] = e;
return true; return true;
} }
@@ -761,7 +759,7 @@ class OrderedHashMap
public: public:
Entry() : key(), value() {} Entry() : key(), value() {}
template <typename V> template <typename V>
Entry(const Key& k, V&& v) : key(k), value(Forward<V>(v)) {} Entry(const Key& k, V&& v) : key(k), value(std::forward<V>(v)) {}
Entry(Entry&& rhs) : key(std::move(rhs.key)), value(std::move(rhs.value)) {} Entry(Entry&& rhs) : key(std::move(rhs.key)), value(std::move(rhs.value)) {}
const Key key; const Key key;
@@ -808,7 +806,7 @@ class OrderedHashMap
template <typename V> template <typename V>
MOZ_MUST_USE bool put(const Key& key, V&& value) { MOZ_MUST_USE bool put(const Key& key, V&& value) {
return impl.put(Entry(key, Forward<V>(value))); return impl.put(Entry(key, std::forward<V>(value)));
} }
HashNumber hash(const Key& key) const { return impl.prepareHash(key); } HashNumber hash(const Key& key) const { return impl.prepareHash(key); }

View File

@@ -74,9 +74,9 @@ class MutableWrappedPtrOperations<TraceableFifo<T, Capacity, AllocPolicy>, Wrapp
public: public:
T& front() { return fifo().front(); } T& front() { return fifo().front(); }
template<typename U> bool pushBack(U&& u) { return fifo().pushBack(mozilla::Forward<U>(u)); } template<typename U> bool pushBack(U&& u) { return fifo().pushBack(std::forward<U>(u)); }
template<typename... Args> bool emplaceBack(Args&&... args) { template<typename... Args> bool emplaceBack(Args&&... args) {
return fifo().emplaceBack(mozilla::Forward<Args...>(args...)); return fifo().emplaceBack(std::forward<Args...>(args...));
} }
void popFront() { fifo().popFront(); } void popFront() { fifo().popFront(); }

View File

@@ -46,7 +46,7 @@ struct InvokeMemberFunction
public: public:
template<typename... ActualArgs> template<typename... ActualArgs>
explicit InvokeMemberFunction(ActualArgs&&... actualArgs) explicit InvokeMemberFunction(ActualArgs&&... actualArgs)
: args { mozilla::Forward<ActualArgs>(actualArgs)... } : args { std::forward<ActualArgs>(actualArgs)... }
{} {}
template<class Parser> template<class Parser>

View File

@@ -6252,7 +6252,7 @@ struct IncrementalIter
: maybeIter(maybeIter) : maybeIter(maybeIter)
{ {
if (maybeIter.isNothing()) if (maybeIter.isNothing())
maybeIter.emplace(mozilla::Forward<Args>(args)...); maybeIter.emplace(std::forward<Args>(args)...);
} }
~IncrementalIter() { ~IncrementalIter() {

View File

@@ -1466,12 +1466,12 @@ CallTraceHook(Functor f, JSTracer* trc, JSObject* obj, CheckGeneration check, Ar
if (clasp->isTrace(InlineTypedObject::obj_trace)) { if (clasp->isTrace(InlineTypedObject::obj_trace)) {
Shape** pshape = obj->as<InlineTypedObject>().addressOfShapeFromGC(); Shape** pshape = obj->as<InlineTypedObject>().addressOfShapeFromGC();
f(pshape, mozilla::Forward<Args>(args)...); f(pshape, std::forward<Args>(args)...);
InlineTypedObject& tobj = obj->as<InlineTypedObject>(); InlineTypedObject& tobj = obj->as<InlineTypedObject>();
if (tobj.typeDescr().hasTraceList()) { if (tobj.typeDescr().hasTraceList()) {
VisitTraceList(f, tobj.typeDescr().traceList(), tobj.inlineTypedMemForGC(), VisitTraceList(f, tobj.typeDescr().traceList(), tobj.inlineTypedMemForGC(),
mozilla::Forward<Args>(args)...); std::forward<Args>(args)...);
} }
return nullptr; return nullptr;
@@ -1480,7 +1480,7 @@ CallTraceHook(Functor f, JSTracer* trc, JSObject* obj, CheckGeneration check, Ar
if (clasp == &UnboxedPlainObject::class_) { if (clasp == &UnboxedPlainObject::class_) {
JSObject** pexpando = obj->as<UnboxedPlainObject>().addressOfExpando(); JSObject** pexpando = obj->as<UnboxedPlainObject>().addressOfExpando();
if (*pexpando) if (*pexpando)
f(pexpando, mozilla::Forward<Args>(args)...); f(pexpando, std::forward<Args>(args)...);
UnboxedPlainObject& unboxed = obj->as<UnboxedPlainObject>(); UnboxedPlainObject& unboxed = obj->as<UnboxedPlainObject>();
const UnboxedLayout& layout = check == CheckGeneration::DoChecks const UnboxedLayout& layout = check == CheckGeneration::DoChecks
@@ -1488,7 +1488,7 @@ CallTraceHook(Functor f, JSTracer* trc, JSObject* obj, CheckGeneration check, Ar
: unboxed.layoutDontCheckGeneration(); : unboxed.layoutDontCheckGeneration();
if (layout.traceList()) { if (layout.traceList()) {
VisitTraceList(f, layout.traceList(), unboxed.data(), VisitTraceList(f, layout.traceList(), unboxed.data(),
mozilla::Forward<Args>(args)...); std::forward<Args>(args)...);
} }
return nullptr; return nullptr;
@@ -1506,19 +1506,19 @@ static void
VisitTraceList(F f, const int32_t* traceList, uint8_t* memory, Args&&... args) VisitTraceList(F f, const int32_t* traceList, uint8_t* memory, Args&&... args)
{ {
while (*traceList != -1) { while (*traceList != -1) {
f(reinterpret_cast<JSString**>(memory + *traceList), mozilla::Forward<Args>(args)...); f(reinterpret_cast<JSString**>(memory + *traceList), std::forward<Args>(args)...);
traceList++; traceList++;
} }
traceList++; traceList++;
while (*traceList != -1) { while (*traceList != -1) {
JSObject** objp = reinterpret_cast<JSObject**>(memory + *traceList); JSObject** objp = reinterpret_cast<JSObject**>(memory + *traceList);
if (*objp) if (*objp)
f(objp, mozilla::Forward<Args>(args)...); f(objp, std::forward<Args>(args)...);
traceList++; traceList++;
} }
traceList++; traceList++;
while (*traceList != -1) { while (*traceList != -1) {
f(reinterpret_cast<Value*>(memory + *traceList), mozilla::Forward<Args>(args)...); f(reinterpret_cast<Value*>(memory + *traceList), std::forward<Args>(args)...);
traceList++; traceList++;
} }
} }

View File

@@ -207,7 +207,7 @@ struct Zone : public JS::shadow::Zone,
// in gc/GC-inl.h for the possible arguments and documentation. // in gc/GC-inl.h for the possible arguments and documentation.
template <typename T, typename... Args> template <typename T, typename... Args>
js::gc::ZoneCellIter<T> cellIter(Args&&... args) { js::gc::ZoneCellIter<T> cellIter(Args&&... args) {
return js::gc::ZoneCellIter<T>(const_cast<Zone*>(this), mozilla::Forward<Args>(args)...); return js::gc::ZoneCellIter<T>(const_cast<Zone*>(this), std::forward<Args>(args)...);
} }
MOZ_MUST_USE void* onOutOfMemory(js::AllocFunction allocFunc, size_t nbytes, MOZ_MUST_USE void* onOutOfMemory(js::AllocFunction allocFunc, size_t nbytes,

View File

@@ -25,12 +25,12 @@ class CFGControlInstruction;
#define TRIVIAL_CFG_NEW_WRAPPERS \ #define TRIVIAL_CFG_NEW_WRAPPERS \
template <typename... Args> \ template <typename... Args> \
static CFGThisOpcode* New(TempAllocator& alloc, Args&&... args) { \ static CFGThisOpcode* New(TempAllocator& alloc, Args&&... args) { \
return new(alloc) CFGThisOpcode(mozilla::Forward<Args>(args)...); \ return new(alloc) CFGThisOpcode(std::forward<Args>(args)...); \
} \ } \
template <typename... Args> \ template <typename... Args> \
static CFGThisOpcode* New(TempAllocator::Fallible alloc, Args&&... args) \ static CFGThisOpcode* New(TempAllocator::Fallible alloc, Args&&... args) \
{ \ { \
return new(alloc) CFGThisOpcode(mozilla::Forward<Args>(args)...); \ return new(alloc) CFGThisOpcode(std::forward<Args>(args)...); \
} }
class CFGSpace class CFGSpace

View File

@@ -1251,23 +1251,23 @@ class MInstruction
#define TRIVIAL_NEW_WRAPPERS \ #define TRIVIAL_NEW_WRAPPERS \
template <typename... Args> \ template <typename... Args> \
static MThisOpcode* New(TempAllocator& alloc, Args&&... args) { \ static MThisOpcode* New(TempAllocator& alloc, Args&&... args) { \
return new(alloc) MThisOpcode(mozilla::Forward<Args>(args)...); \ return new(alloc) MThisOpcode(std::forward<Args>(args)...); \
} \ } \
template <typename... Args> \ template <typename... Args> \
static MThisOpcode* New(TempAllocator::Fallible alloc, Args&&... args) \ static MThisOpcode* New(TempAllocator::Fallible alloc, Args&&... args) \
{ \ { \
return new(alloc) MThisOpcode(mozilla::Forward<Args>(args)...); \ return new(alloc) MThisOpcode(std::forward<Args>(args)...); \
} }
#define TRIVIAL_NEW_WRAPPERS_WITH_ALLOC \ #define TRIVIAL_NEW_WRAPPERS_WITH_ALLOC \
template <typename... Args> \ template <typename... Args> \
static MThisOpcode* New(TempAllocator& alloc, Args&&... args) { \ static MThisOpcode* New(TempAllocator& alloc, Args&&... args) { \
return new(alloc) MThisOpcode(alloc, mozilla::Forward<Args>(args)...); \ return new(alloc) MThisOpcode(alloc, std::forward<Args>(args)...); \
} \ } \
template <typename... Args> \ template <typename... Args> \
static MThisOpcode* New(TempAllocator::Fallible alloc, Args&&... args) \ static MThisOpcode* New(TempAllocator::Fallible alloc, Args&&... args) \
{ \ { \
return new(alloc) MThisOpcode(alloc, mozilla::Forward<Args>(args)...); \ return new(alloc) MThisOpcode(alloc, std::forward<Args>(args)...); \
} }
// These macros are used as a syntactic sugar for writting getOperand // These macros are used as a syntactic sugar for writting getOperand

View File

@@ -536,7 +536,7 @@ class ICStub
static T* New(JSContext* cx, ICStubSpace* space, JitCode* code, Args&&... args) { static T* New(JSContext* cx, ICStubSpace* space, JitCode* code, Args&&... args) {
if (!code) if (!code)
return nullptr; return nullptr;
T* result = space->allocate<T>(code, mozilla::Forward<Args>(args)...); T* result = space->allocate<T>(code, std::forward<Args>(args)...);
if (!result) if (!result)
ReportOutOfMemory(cx); ReportOutOfMemory(cx);
return result; return result;
@@ -1130,7 +1130,7 @@ class ICStubCompiler
protected: protected:
template <typename T, typename... Args> template <typename T, typename... Args>
T* newStub(Args&&... args) { T* newStub(Args&&... args) {
return ICStub::New<T>(cx, mozilla::Forward<Args>(args)...); return ICStub::New<T>(cx, std::forward<Args>(args)...);
} }
public: public:

View File

@@ -927,7 +927,7 @@ class AssemblerShared
template <typename... Args> template <typename... Args>
void append(const wasm::CallSiteDesc& desc, CodeOffset retAddr, Args&&... args) { void append(const wasm::CallSiteDesc& desc, CodeOffset retAddr, Args&&... args) {
enoughMemory_ &= callSites_.emplaceBack(desc, retAddr.offset()); enoughMemory_ &= callSites_.emplaceBack(desc, retAddr.offset());
enoughMemory_ &= callSiteTargets_.emplaceBack(mozilla::Forward<Args>(args)...); enoughMemory_ &= callSiteTargets_.emplaceBack(std::forward<Args>(args)...);
} }
void append(wasm::Trap trap, wasm::TrapSite site) { void append(wasm::Trap trap, wasm::TrapSite site) {
enoughMemory_ &= trapSites_[trap].append(site); enoughMemory_ &= trapSites_[trap].append(site);

View File

@@ -653,8 +653,8 @@ class ArgSeq<HeadType, TailTypes...> : public ArgSeq<TailTypes...>
public: public:
template <typename ProvidedHead, typename... ProvidedTail> template <typename ProvidedHead, typename... ProvidedTail>
explicit ArgSeq(ProvidedHead&& head, ProvidedTail&&... tail) explicit ArgSeq(ProvidedHead&& head, ProvidedTail&&... tail)
: ArgSeq<TailTypes...>(mozilla::Forward<ProvidedTail>(tail)...), : ArgSeq<TailTypes...>(std::forward<ProvidedTail>(tail)...),
head_(mozilla::Forward<ProvidedHead>(head)) head_(std::forward<ProvidedHead>(head))
{ } { }
// Arguments are pushed in reverse order, from last argument to first // Arguments are pushed in reverse order, from last argument to first
@@ -669,7 +669,7 @@ template <typename... ArgTypes>
inline ArgSeq<ArgTypes...> inline ArgSeq<ArgTypes...>
ArgList(ArgTypes&&... args) ArgList(ArgTypes&&... args)
{ {
return ArgSeq<ArgTypes...>(mozilla::Forward<ArgTypes>(args)...); return ArgSeq<ArgTypes...>(std::forward<ArgTypes>(args)...);
} }
// Store wrappers, to generate the right move of data after the VM call. // Store wrappers, to generate the right move of data after the VM call.

View File

@@ -480,7 +480,7 @@ LIRGeneratorShared::allocateVariadic(uint32_t numOperands, Args&&... args)
return nullptr; return nullptr;
LClass* ins = static_cast<LClass*>(buf); LClass* ins = static_cast<LClass*>(buf);
new(ins) LClass(numOperands, mozilla::Forward<Args>(args)...); new(ins) LClass(numOperands, std::forward<Args>(args)...);
ins->initOperandsOffset(sizeof(LClass)); ins->initOperandsOffset(sizeof(LClass));

View File

@@ -99,7 +99,7 @@ class ExclusiveData
template <typename U> template <typename U>
explicit ExclusiveData(const MutexId& id, U&& u) explicit ExclusiveData(const MutexId& id, U&& u)
: lock_(id), : lock_(id),
value_(mozilla::Forward<U>(u)) value_(std::forward<U>(u))
{} {}
/** /**
@@ -108,7 +108,7 @@ class ExclusiveData
template <typename... Args> template <typename... Args>
explicit ExclusiveData(const MutexId& id, Args&&... args) explicit ExclusiveData(const MutexId& id, Args&&... args)
: lock_(id), : lock_(id),
value_(mozilla::Forward<Args>(args)...) value_(std::forward<Args>(args)...)
{} {}
ExclusiveData(ExclusiveData&& rhs) ExclusiveData(ExclusiveData&& rhs)
@@ -196,12 +196,12 @@ class ExclusiveWaitableData : public ExclusiveData<T>
public: public:
template <typename U> template <typename U>
explicit ExclusiveWaitableData(const MutexId& id, U&& u) explicit ExclusiveWaitableData(const MutexId& id, U&& u)
: Base(id, mozilla::Forward<U>(u)) : Base(id, std::forward<U>(u))
{} {}
template <typename... Args> template <typename... Args>
explicit ExclusiveWaitableData(const MutexId& id, Args&&... args) explicit ExclusiveWaitableData(const MutexId& id, Args&&... args)
: Base(id, mozilla::Forward<Args>(args)...) : Base(id, std::forward<Args>(args)...)
{} {}
class MOZ_STACK_CLASS Guard : public ExclusiveData<T>::Guard class MOZ_STACK_CLASS Guard : public ExclusiveData<T>::Guard

View File

@@ -72,7 +72,7 @@ class ProtectedData
public: public:
template <typename... Args> template <typename... Args>
explicit ProtectedData(const Check& check, Args&&... args) explicit ProtectedData(const Check& check, Args&&... args)
: value(mozilla::Forward<Args>(args)...) : value(std::forward<Args>(args)...)
#ifdef JS_HAS_PROTECTED_DATA_CHECKS #ifdef JS_HAS_PROTECTED_DATA_CHECKS
, check(check) , check(check)
#endif #endif
@@ -136,7 +136,7 @@ class ProtectedDataNoCheckArgs : public ProtectedData<Check, T>
public: public:
template <typename... Args> template <typename... Args>
explicit ProtectedDataNoCheckArgs(Args&&... args) explicit ProtectedDataNoCheckArgs(Args&&... args)
: ProtectedData<Check, T>(Check(), mozilla::Forward<Args>(args)...) : ProtectedData<Check, T>(Check(), std::forward<Args>(args)...)
{} {}
template <typename U> template <typename U>
@@ -152,7 +152,7 @@ class ProtectedDataZoneArg : public ProtectedData<Check, T>
public: public:
template <typename... Args> template <typename... Args>
explicit ProtectedDataZoneArg(JS::Zone* zone, Args&&... args) explicit ProtectedDataZoneArg(JS::Zone* zone, Args&&... args)
: ProtectedData<Check, T>(Check(zone), mozilla::Forward<Args>(args)...) : ProtectedData<Check, T>(Check(zone), std::forward<Args>(args)...)
{} {}
template <typename U> template <typename U>
@@ -315,7 +315,7 @@ class ProtectedDataWriteOnce
public: public:
template <typename... Args> template <typename... Args>
explicit ProtectedDataWriteOnce(Args&&... args) explicit ProtectedDataWriteOnce(Args&&... args)
: value(mozilla::Forward<Args>(args)...) : value(std::forward<Args>(args)...)
#ifdef JS_HAS_PROTECTED_DATA_CHECKS #ifdef JS_HAS_PROTECTED_DATA_CHECKS
, nwrites(0) , nwrites(0)
#endif #endif

View File

@@ -101,7 +101,7 @@ public:
explicit Thread(O&& options = Options()) explicit Thread(O&& options = Options())
: idMutex_(mutexid::ThreadId) : idMutex_(mutexid::ThreadId)
, id_(Id()) , id_(Id())
, options_(mozilla::Forward<O>(options)) , options_(std::forward<O>(options))
{ {
MOZ_ASSERT(js::IsInitialized()); MOZ_ASSERT(js::IsInitialized());
} }
@@ -117,8 +117,8 @@ public:
MOZ_RELEASE_ASSERT(id_ == Id()); MOZ_RELEASE_ASSERT(id_ == Id());
using Trampoline = detail::ThreadTrampoline<F, Args...>; using Trampoline = detail::ThreadTrampoline<F, Args...>;
AutoEnterOOMUnsafeRegion oom; AutoEnterOOMUnsafeRegion oom;
auto trampoline = js_new<Trampoline>(mozilla::Forward<F>(f), auto trampoline = js_new<Trampoline>(std::forward<F>(f),
mozilla::Forward<Args>(args)...); std::forward<Args>(args)...);
if (!trampoline) if (!trampoline)
oom.crash("js::Thread::init"); oom.crash("js::Thread::init");
return create(Trampoline::Start, trampoline); return create(Trampoline::Start, trampoline);
@@ -225,8 +225,8 @@ public:
// even if the class template arguments are correct. // even if the class template arguments are correct.
template <typename G, typename... ArgsT> template <typename G, typename... ArgsT>
explicit ThreadTrampoline(G&& aG, ArgsT&&... aArgsT) explicit ThreadTrampoline(G&& aG, ArgsT&&... aArgsT)
: f(mozilla::Forward<F>(aG)), : f(std::forward<F>(aG)),
args(mozilla::Forward<Args>(aArgsT)...) args(std::forward<Args>(aArgsT)...)
{ {
} }

View File

@@ -31,7 +31,6 @@
using namespace js; using namespace js;
using mozilla::Forward;
using mozilla::Maybe; using mozilla::Maybe;
using mozilla::Nothing; using mozilla::Nothing;

View File

@@ -434,10 +434,10 @@ template <>
struct FallibleHashMethods<ObjectGroupRealm::NewEntry> struct FallibleHashMethods<ObjectGroupRealm::NewEntry>
{ {
template <typename Lookup> static bool hasHash(Lookup&& l) { template <typename Lookup> static bool hasHash(Lookup&& l) {
return ObjectGroupRealm::NewEntry::hasHash(mozilla::Forward<Lookup>(l)); return ObjectGroupRealm::NewEntry::hasHash(std::forward<Lookup>(l));
} }
template <typename Lookup> static bool ensureHash(Lookup&& l) { template <typename Lookup> static bool ensureHash(Lookup&& l) {
return ObjectGroupRealm::NewEntry::ensureHash(mozilla::Forward<Lookup>(l)); return ObjectGroupRealm::NewEntry::ensureHash(std::forward<Lookup>(l));
} }
}; };
} // namespace js } // namespace js

View File

@@ -176,10 +176,10 @@ template <>
struct FallibleHashMethods<SavedFrame::HashPolicy> struct FallibleHashMethods<SavedFrame::HashPolicy>
{ {
template <typename Lookup> static bool hasHash(Lookup&& l) { template <typename Lookup> static bool hasHash(Lookup&& l) {
return SavedFrame::HashPolicy::hasHash(mozilla::Forward<Lookup>(l)); return SavedFrame::HashPolicy::hasHash(std::forward<Lookup>(l));
} }
template <typename Lookup> static bool ensureHash(Lookup&& l) { template <typename Lookup> static bool ensureHash(Lookup&& l) {
return SavedFrame::HashPolicy::ensureHash(mozilla::Forward<Lookup>(l)); return SavedFrame::HashPolicy::ensureHash(std::forward<Lookup>(l));
} }
}; };

View File

@@ -137,10 +137,10 @@ class WrappedPtrOperations<TaggedProto, Wrapper>
template <typename F, typename... Args> template <typename F, typename... Args>
auto auto
DispatchTyped(F f, const TaggedProto& proto, Args&&... args) DispatchTyped(F f, const TaggedProto& proto, Args&&... args)
-> decltype(f(static_cast<JSObject*>(nullptr), mozilla::Forward<Args>(args)...)) -> decltype(f(static_cast<JSObject*>(nullptr), std::forward<Args>(args)...))
{ {
if (proto.isObject()) if (proto.isObject())
return f(proto.toObject(), mozilla::Forward<Args>(args)...); return f(proto.toObject(), std::forward<Args>(args)...);
return F::defaultValue(proto); return F::defaultValue(proto);
} }

View File

@@ -2308,7 +2308,7 @@ class BaseCompiler final : public BaseCompilerInterface
template<typename... Args> template<typename... Args>
void push(Args&&... args) { void push(Args&&... args) {
stk_.infallibleEmplaceBack(Stk(Forward<Args>(args)...)); stk_.infallibleEmplaceBack(Stk(std::forward<Args>(args)...));
} }
void pushConstRef(intptr_t v) { void pushConstRef(intptr_t v) {

View File

@@ -809,7 +809,7 @@ ScriptPreloader::NoteScript(const nsCString& url, const nsCString& cachePath,
MOZ_ASSERT(!script->HasArray()); MOZ_ASSERT(!script->HasArray());
script->mSize = xdrData.Length(); script->mSize = xdrData.Length();
script->mXDRData.construct<nsTArray<uint8_t>>(Forward<nsTArray<uint8_t>>(xdrData)); script->mXDRData.construct<nsTArray<uint8_t>>(std::forward<nsTArray<uint8_t>>(xdrData));
auto& data = script->Array(); auto& data = script->Array();
script->mXDRRange.emplace(data.Elements(), data.Length()); script->mXDRRange.emplace(data.Elements(), data.Length());

View File

@@ -2011,7 +2011,7 @@ template<typename T, typename... Args>
MOZ_ALWAYS_INLINE T* MOZ_ALWAYS_INLINE T*
MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs) MakeDisplayItem(nsDisplayListBuilder* aBuilder, Args&&... aArgs)
{ {
T* item = new (aBuilder) T(aBuilder, mozilla::Forward<Args>(aArgs)...); T* item = new (aBuilder) T(aBuilder, std::forward<Args>(aArgs)...);
const mozilla::SmallPointerArray<mozilla::DisplayItemData>& array = const mozilla::SmallPointerArray<mozilla::DisplayItemData>& array =
item->Frame()->DisplayItemData(); item->Frame()->DisplayItemData();

View File

@@ -96,7 +96,7 @@ public:
// |explicit| to pacify static analysis when there are no |args|. // |explicit| to pacify static analysis when there are no |args|.
template<typename... Arguments> template<typename... Arguments>
explicit runnable_args_func(FunType f, Arguments&&... args) explicit runnable_args_func(FunType f, Arguments&&... args)
: mFunc(f), mArgs(Forward<Arguments>(args)...) : mFunc(f), mArgs(std::forward<Arguments>(args)...)
{} {}
NS_IMETHOD Run() override { NS_IMETHOD Run() override {
@@ -113,7 +113,7 @@ template<typename FunType, typename... Args>
runnable_args_func<FunType, typename mozilla::Decay<Args>::Type...>* runnable_args_func<FunType, typename mozilla::Decay<Args>::Type...>*
WrapRunnableNM(FunType f, Args&&... args) WrapRunnableNM(FunType f, Args&&... args)
{ {
return new runnable_args_func<FunType, typename mozilla::Decay<Args>::Type...>(f, Forward<Args>(args)...); return new runnable_args_func<FunType, typename mozilla::Decay<Args>::Type...>(f, std::forward<Args>(args)...);
} }
template<typename Ret, typename FunType, typename... Args> template<typename Ret, typename FunType, typename... Args>
@@ -122,7 +122,7 @@ class runnable_args_func_ret : public detail::runnable_args_base<detail::Returns
public: public:
template<typename... Arguments> template<typename... Arguments>
runnable_args_func_ret(Ret* ret, FunType f, Arguments&&... args) runnable_args_func_ret(Ret* ret, FunType f, Arguments&&... args)
: mReturn(ret), mFunc(f), mArgs(Forward<Arguments>(args)...) : mReturn(ret), mFunc(f), mArgs(std::forward<Arguments>(args)...)
{} {}
NS_IMETHOD Run() override { NS_IMETHOD Run() override {
@@ -140,7 +140,7 @@ template<typename R, typename FunType, typename... Args>
runnable_args_func_ret<R, FunType, typename mozilla::Decay<Args>::Type...>* runnable_args_func_ret<R, FunType, typename mozilla::Decay<Args>::Type...>*
WrapRunnableNMRet(R* ret, FunType f, Args&&... args) WrapRunnableNMRet(R* ret, FunType f, Args&&... args)
{ {
return new runnable_args_func_ret<R, FunType, typename mozilla::Decay<Args>::Type...>(ret, f, Forward<Args>(args)...); return new runnable_args_func_ret<R, FunType, typename mozilla::Decay<Args>::Type...>(ret, f, std::forward<Args>(args)...);
} }
template<typename Class, typename M, typename... Args> template<typename Class, typename M, typename... Args>
@@ -149,7 +149,7 @@ class runnable_args_memfn : public detail::runnable_args_base<detail::NoResult>
public: public:
template<typename... Arguments> template<typename... Arguments>
runnable_args_memfn(Class obj, M method, Arguments&&... args) runnable_args_memfn(Class obj, M method, Arguments&&... args)
: mObj(obj), mMethod(method), mArgs(Forward<Arguments>(args)...) : mObj(obj), mMethod(method), mArgs(std::forward<Arguments>(args)...)
{} {}
NS_IMETHOD Run() override { NS_IMETHOD Run() override {
@@ -167,7 +167,7 @@ template<typename Class, typename M, typename... Args>
runnable_args_memfn<Class, M, typename mozilla::Decay<Args>::Type...>* runnable_args_memfn<Class, M, typename mozilla::Decay<Args>::Type...>*
WrapRunnable(Class obj, M method, Args&&... args) WrapRunnable(Class obj, M method, Args&&... args)
{ {
return new runnable_args_memfn<Class, M, typename mozilla::Decay<Args>::Type...>(obj, method, Forward<Args>(args)...); return new runnable_args_memfn<Class, M, typename mozilla::Decay<Args>::Type...>(obj, method, std::forward<Args>(args)...);
} }
template<typename Ret, typename Class, typename M, typename... Args> template<typename Ret, typename Class, typename M, typename... Args>
@@ -176,7 +176,7 @@ class runnable_args_memfn_ret : public detail::runnable_args_base<detail::Return
public: public:
template<typename... Arguments> template<typename... Arguments>
runnable_args_memfn_ret(Ret* ret, Class obj, M method, Arguments... args) runnable_args_memfn_ret(Ret* ret, Class obj, M method, Arguments... args)
: mReturn(ret), mObj(obj), mMethod(method), mArgs(Forward<Arguments>(args)...) : mReturn(ret), mObj(obj), mMethod(method), mArgs(std::forward<Arguments>(args)...)
{} {}
NS_IMETHOD Run() override { NS_IMETHOD Run() override {
@@ -195,7 +195,7 @@ template<typename R, typename Class, typename M, typename... Args>
runnable_args_memfn_ret<R, Class, M, typename mozilla::Decay<Args>::Type...>* runnable_args_memfn_ret<R, Class, M, typename mozilla::Decay<Args>::Type...>*
WrapRunnableRet(R* ret, Class obj, M method, Args&&... args) WrapRunnableRet(R* ret, Class obj, M method, Args&&... args)
{ {
return new runnable_args_memfn_ret<R, Class, M, typename mozilla::Decay<Args>::Type...>(ret, obj, method, Forward<Args>(args)...); return new runnable_args_memfn_ret<R, Class, M, typename mozilla::Decay<Args>::Type...>(ret, obj, method, std::forward<Args>(args)...);
} }
static inline nsresult RUN_ON_THREAD(nsIEventTarget *thread, detail::runnable_args_base<detail::NoResult> *runnable, uint32_t flags) { static inline nsresult RUN_ON_THREAD(nsIEventTarget *thread, detail::runnable_args_base<detail::NoResult> *runnable, uint32_t flags) {

View File

@@ -28,7 +28,7 @@ public:
template <typename... Args> template <typename... Args>
MOZ_IMPLICIT Array(Args&&... aArgs) MOZ_IMPLICIT Array(Args&&... aArgs)
: mArr{mozilla::Forward<Args>(aArgs)...} : mArr{std::forward<Args>(aArgs)...}
{ {
static_assert(sizeof...(aArgs) == Length, static_assert(sizeof...(aArgs) == Length,
"The number of arguments should be equal to the template parameter Length"); "The number of arguments should be equal to the template parameter Length");

View File

@@ -56,7 +56,7 @@ public:
template <typename... Args> template <typename... Args>
MOZ_IMPLICIT EnumeratedArray(Args&&... aArgs) MOZ_IMPLICIT EnumeratedArray(Args&&... aArgs)
: mArray{mozilla::Forward<Args>(aArgs)...} : mArray{std::forward<Args>(aArgs)...}
{} {}
explicit EnumeratedArray(const EnumeratedArray& aOther) explicit EnumeratedArray(const EnumeratedArray& aOther)

View File

@@ -659,7 +659,7 @@ public:
AutoCleanLinkedList& operator=(AutoCleanLinkedList&& aOther) AutoCleanLinkedList& operator=(AutoCleanLinkedList&& aOther)
{ {
LinkedList<T>::operator=(Forward<LinkedList<T>>(aOther)); LinkedList<T>::operator=(std::forward<LinkedList<T>>(aOther));
return *this; return *this;
} }

View File

@@ -327,7 +327,7 @@ public:
if (isSome()) { if (isSome()) {
return ref(); return ref();
} }
return Forward<V>(aDefault); return std::forward<V>(aDefault);
} }
/* /*
@@ -596,7 +596,7 @@ void
Maybe<T>::emplace(Args&&... aArgs) Maybe<T>::emplace(Args&&... aArgs)
{ {
MOZ_DIAGNOSTIC_ASSERT(!mIsSome); MOZ_DIAGNOSTIC_ASSERT(!mIsSome);
::new (KnownNotNull, data()) T(Forward<Args>(aArgs)...); ::new (KnownNotNull, data()) T(std::forward<Args>(aArgs)...);
mIsSome = true; mIsSome = true;
} }
@@ -617,7 +617,7 @@ Maybe<U>
Some(T&& aValue) Some(T&& aValue)
{ {
Maybe<U> value; Maybe<U> value;
value.emplace(Forward<T>(aValue)); value.emplace(std::forward<T>(aValue));
return value; return value;
} }

View File

@@ -106,7 +106,7 @@ public:
{ {
MOZ_ASSERT(state == None); MOZ_ASSERT(state == None);
state = Type2State<T>::result; state = Type2State<T>::result;
::new (KnownNotNull, data()) T(Forward<Args>(aArgs)...); ::new (KnownNotNull, data()) T(std::forward<Args>(aArgs)...);
} }
template <class T> template <class T>

View File

@@ -137,7 +137,7 @@ namespace mozilla {
* template like so[0]: * template like so[0]:
* *
* template <typename XArg, typename YArg> * template <typename XArg, typename YArg>
* C::C(XArg&& x, YArg&& y) : x(Forward<XArg>(x)), y(Forward<YArg>(y)) { } * C::C(XArg&& x, YArg&& y) : x(std::forward<XArg>(x)), y(std::forward<YArg>(y)) { }
* *
* ("'Don't Repeat Yourself'? What's that?") * ("'Don't Repeat Yourself'? What's that?")
* *
@@ -165,7 +165,7 @@ namespace mozilla {
* collapses to 'Y&'. Because the arguments are declared as rvalue references * collapses to 'Y&'. Because the arguments are declared as rvalue references
* to template arguments, the lvalue-ness "shines through" where present. * to template arguments, the lvalue-ness "shines through" where present.
* *
* Then, the 'Forward<T>' function --- you must invoke 'Forward' with its type * Then, the 'std::forward<T>' function --- you must invoke 'Forward' with its type
* argument --- returns an lvalue reference or an rvalue reference to its * argument --- returns an lvalue reference or an rvalue reference to its
* argument, depending on what T is. In our unified constructor definition, that * argument, depending on what T is. In our unified constructor definition, that
* means that we'll invoke either the copy or move constructors for x and y, * means that we'll invoke either the copy or move constructors for x and y,
@@ -194,26 +194,6 @@ namespace mozilla {
* C(tmp, 0); // OK: tmp not a bit-field * C(tmp, 0); // OK: tmp not a bit-field
*/ */
/**
* These two overloads are identical to std::forward(); they are necessary until
* our stlport supports std::forward().
*/
template<typename T>
inline T&&
Forward(typename RemoveReference<T>::Type& aX)
{
return static_cast<T&&>(aX);
}
template<typename T>
inline T&&
Forward(typename RemoveReference<T>::Type&& aX)
{
static_assert(!IsLvalueReference<T>::value,
"misuse of Forward detected! try the other overload");
return static_cast<T&&>(aX);
}
/** Swap |aX| and |aY| using move-construction if possible. */ /** Swap |aX| and |aY| using move-construction if possible. */
template<typename T> template<typename T>
inline void inline void

View File

@@ -200,7 +200,7 @@ MakeNotNull(Args&&... aArgs)
using Pointee = typename detail::PointedTo<T>::NonConstType; using Pointee = typename detail::PointedTo<T>::NonConstType;
static_assert(!IsArray<Pointee>::value, static_assert(!IsArray<Pointee>::value,
"MakeNotNull cannot construct an array"); "MakeNotNull cannot construct an array");
return NotNull<T>(new Pointee(Forward<Args>(aArgs)...)); return NotNull<T>(new Pointee(std::forward<Args>(aArgs)...));
} }
// Compare two NotNulls. // Compare two NotNulls.

View File

@@ -41,8 +41,8 @@ struct PairHelper<A, B, AsMember, AsMember>
protected: protected:
template<typename AArg, typename BArg> template<typename AArg, typename BArg>
PairHelper(AArg&& aA, BArg&& aB) PairHelper(AArg&& aA, BArg&& aB)
: mFirstA(Forward<AArg>(aA)), : mFirstA(std::forward<AArg>(aA)),
mSecondB(Forward<BArg>(aB)) mSecondB(std::forward<BArg>(aB))
{} {}
A& first() { return mFirstA; } A& first() { return mFirstA; }
@@ -67,8 +67,8 @@ struct PairHelper<A, B, AsMember, AsBase> : private B
protected: protected:
template<typename AArg, typename BArg> template<typename AArg, typename BArg>
PairHelper(AArg&& aA, BArg&& aB) PairHelper(AArg&& aA, BArg&& aB)
: B(Forward<BArg>(aB)), : B(std::forward<BArg>(aB)),
mFirstA(Forward<AArg>(aA)) mFirstA(std::forward<AArg>(aA))
{} {}
A& first() { return mFirstA; } A& first() { return mFirstA; }
@@ -92,8 +92,8 @@ struct PairHelper<A, B, AsBase, AsMember> : private A
protected: protected:
template<typename AArg, typename BArg> template<typename AArg, typename BArg>
PairHelper(AArg&& aA, BArg&& aB) PairHelper(AArg&& aA, BArg&& aB)
: A(Forward<AArg>(aA)), : A(std::forward<AArg>(aA)),
mSecondB(Forward<BArg>(aB)) mSecondB(std::forward<BArg>(aB))
{} {}
A& first() { return *this; } A& first() { return *this; }
@@ -117,8 +117,8 @@ struct PairHelper<A, B, AsBase, AsBase> : private A, private B
protected: protected:
template<typename AArg, typename BArg> template<typename AArg, typename BArg>
PairHelper(AArg&& aA, BArg&& aB) PairHelper(AArg&& aA, BArg&& aB)
: A(Forward<AArg>(aA)), : A(std::forward<AArg>(aA)),
B(Forward<BArg>(aB)) B(std::forward<BArg>(aB))
{} {}
A& first() { return static_cast<A&>(*this); } A& first() { return static_cast<A&>(*this); }
@@ -157,7 +157,7 @@ struct Pair
public: public:
template<typename AArg, typename BArg> template<typename AArg, typename BArg>
Pair(AArg&& aA, BArg&& aB) Pair(AArg&& aA, BArg&& aB)
: Base(Forward<AArg>(aA), Forward<BArg>(aB)) : Base(std::forward<AArg>(aA), std::forward<BArg>(aB))
{} {}
Pair(Pair&& aOther) Pair(Pair&& aOther)
@@ -210,8 +210,8 @@ MakePair(A&& aA, B&& aB)
return return
Pair<typename RemoveCV<typename RemoveReference<A>::Type>::Type, Pair<typename RemoveCV<typename RemoveReference<A>::Type>::Type,
typename RemoveCV<typename RemoveReference<B>::Type>::Type>( typename RemoveCV<typename RemoveReference<B>::Type>::Type>(
Forward<A>(aA), std::forward<A>(aA),
Forward<B>(aB)); std::forward<B>(aB));
} }
} // namespace mozilla } // namespace mozilla

View File

@@ -343,7 +343,7 @@ public:
template<typename... ActualArgs> template<typename... ActualArgs>
R operator()(ActualArgs&&... aArgs) R operator()(ActualArgs&&... aArgs)
{ {
return ((*mRawPtr).*mFunction)(mozilla::Forward<ActualArgs>(aArgs)...); return ((*mRawPtr).*mFunction)(std::forward<ActualArgs>(aArgs)...);
} }
}; };
@@ -655,7 +655,7 @@ template<typename T, typename... Args>
already_AddRefed<T> already_AddRefed<T>
MakeAndAddRef(Args&&... aArgs) MakeAndAddRef(Args&&... aArgs)
{ {
RefPtr<T> p(new T(Forward<Args>(aArgs)...)); RefPtr<T> p(new T(std::forward<Args>(aArgs)...));
return p.forget(); return p.forget();
} }
@@ -669,7 +669,7 @@ template<typename T, typename... Args>
RefPtr<T> RefPtr<T>
MakeRefPtr(Args&&... aArgs) MakeRefPtr(Args&&... aArgs)
{ {
RefPtr<T> p(new T(Forward<Args>(aArgs)...)); RefPtr<T> p(new T(std::forward<Args>(aArgs)...));
return p; return p;
} }

View File

@@ -263,9 +263,9 @@ struct IsResult<Result<V, E>> : TrueType { };
template <typename V, typename E> template <typename V, typename E>
auto auto
ToResult(Result<V, E>&& aValue) ToResult(Result<V, E>&& aValue)
-> decltype(Forward<Result<V, E>>(aValue)) -> decltype(std::forward<Result<V, E>>(aValue))
{ {
return Forward<Result<V, E>>(aValue); return std::forward<Result<V, E>>(aValue);
} }
/** /**

View File

@@ -89,7 +89,7 @@ class SegmentedVector : private AllocPolicy
// Pre-increment mLength so that the bounds-check in operator[] passes. // Pre-increment mLength so that the bounds-check in operator[] passes.
mLength++; mLength++;
T* elem = &(*this)[mLength - 1]; T* elem = &(*this)[mLength - 1];
new (elem) T(mozilla::Forward<U>(aU)); new (elem) T(std::forward<U>(aU));
} }
void PopLast() void PopLast()
@@ -175,7 +175,7 @@ public:
new (last) Segment(); new (last) Segment();
mSegments.insertBack(last); mSegments.insertBack(last);
} }
last->Append(mozilla::Forward<U>(aU)); last->Append(std::forward<U>(aU));
return true; return true;
} }
@@ -184,7 +184,7 @@ public:
template<typename U> template<typename U>
void InfallibleAppend(U&& aU) void InfallibleAppend(U&& aU)
{ {
bool ok = Append(mozilla::Forward<U>(aU)); bool ok = Append(std::forward<U>(aU));
MOZ_RELEASE_ASSERT(ok); MOZ_RELEASE_ASSERT(ok);
} }

View File

@@ -60,7 +60,7 @@ template<class T, class U>
inline constexpr T inline constexpr T
narrow_cast(U&& u) narrow_cast(U&& u)
{ {
return static_cast<T>(mozilla::Forward<U>(u)); return static_cast<T>(std::forward<U>(u));
} }
// end gsl_util // end gsl_util

Some files were not shown because too many files have changed in this diff Show More