--- a/accessible/base/TextRange.h
+++ b/accessible/base/TextRange.h
@@ -107,17 +107,17 @@ public:
eParagraph,
ePage,
eDocument
};
/**
* Move the range or its points on specified amount of given units.
*/
- void std::move(ETextUnit aUnit, int32_t aCount)
+ void Move(ETextUnit aUnit, int32_t aCount)
{
MoveEnd(aUnit, aCount);
MoveStart(aUnit, aCount);
}
void MoveStart(ETextUnit aUnit, int32_t aCount)
{
MoveInternal(aUnit, aCount, *mStartContainer, mStartOffset,
mEndContainer, mEndOffset);
--- a/accessible/xpcom/xpcAccessibleTextRange.h
+++ b/accessible/xpcom/xpcAccessibleTextRange.h
@@ -40,17 +40,17 @@ public:
NS_IMETHOD GetEmbeddedChildren(nsIArray** aList) final;
NS_IMETHOD Compare(nsIAccessibleTextRange* aOtherRange, bool* aResult) final;
NS_IMETHOD CompareEndPoints(uint32_t aEndPoint,
nsIAccessibleTextRange* aOtherRange,
uint32_t aOtherRangeEndPoint,
int32_t* aResult) final;
NS_IMETHOD GetText(nsAString& aText) final;
NS_IMETHOD GetBounds(nsIArray** aRectList) final;
- NS_IMETHOD std::move(uint32_t aUnit, int32_t aCount) final;
+ NS_IMETHOD Move(uint32_t aUnit, int32_t aCount) final;
NS_IMETHOD MoveStart(uint32_t aUnit, int32_t aCount) final;
NS_IMETHOD MoveEnd(uint32_t aUnit, int32_t aCount) final;
NS_IMETHOD Normalize(uint32_t aUnit) final;
NS_IMETHOD Crop(nsIAccessible* aContainer, bool* aSuccess) final;
NS_IMETHOD FindText(const nsAString& aText, bool aIsBackward, bool aIsIgnoreCase,
nsIAccessibleTextRange** aRange) final;
NS_IMETHOD FindAttr(uint32_t aAttr, nsIVariant* aVal, bool aIsBackward,
nsIAccessibleTextRange** aRange) final;
--- a/editor/libeditor/PlaceholderTransaction.cpp
+++ b/editor/libeditor/PlaceholderTransaction.cpp
@@ -18,17 +18,17 @@ using namespace dom;
PlaceholderTransaction::PlaceholderTransaction(
EditorBase& aEditorBase,
nsAtom* aName,
Maybe<SelectionState>&& aSelState)
: mEditorBase(&aEditorBase)
, mForwarding(nullptr)
, mCompositionTransaction(nullptr)
- , mStartSel(*Move(aSelState))
+ , mStartSel(*std::move(aSelState))
, mAbsorb(true)
, mCommitted(false)
{
mName = aName;
}
PlaceholderTransaction::~PlaceholderTransaction()
{
--- a/gfx/layers/apz/src/APZUpdater.cpp
+++ b/gfx/layers/apz/src/APZUpdater.cpp
@@ -210,17 +210,17 @@ APZUpdater::UpdateScrollDataAndTreeState
if (aRootLayerTreeId == aOriginatingLayersId) {
self->mEpochData[aOriginatingLayersId].mIsRoot = true;
}
self->mEpochData[aOriginatingLayersId].mRequired = aEpoch;
}
));
RunOnUpdaterThread(aOriginatingLayersId, NS_NewRunnableFunction(
"APZUpdater::UpdateHitTestingTree",
- [=,aScrollData=Move(aScrollData)]() {
+ [=,aScrollData=std::move(aScrollData)]() {
self->mApz->UpdateFocusState(aRootLayerTreeId,
aOriginatingLayersId, aScrollData.GetFocusTarget());
self->mScrollData[aOriginatingLayersId] = aScrollData;
auto root = self->mScrollData.find(aRootLayerTreeId);
if (root == self->mScrollData.end()) {
return;
}
@@ -237,17 +237,17 @@ APZUpdater::UpdateScrollOffsets(LayersId
LayersId aOriginatingLayersId,
ScrollUpdatesMap&& aUpdates,
uint32_t aPaintSequenceNumber)
{
MOZ_ASSERT(CompositorThreadHolder::IsInCompositorThread());
RefPtr<APZUpdater> self = this;
RunOnUpdaterThread(aOriginatingLayersId, NS_NewRunnableFunction(
"APZUpdater::UpdateScrollOffsets",
- [=,updates=Move(aUpdates)]() {
+ [=,updates=std::move(aUpdates)]() {
self->mScrollData[aOriginatingLayersId].ApplyUpdates(updates, aPaintSequenceNumber);
auto root = self->mScrollData.find(aRootLayerTreeId);
if (root == self->mScrollData.end()) {
return;
}
self->mApz->UpdateHitTestingTree(aRootLayerTreeId,
WebRenderScrollDataWrapper(*self, &(root->second)),
/*isFirstPaint*/ false, aOriginatingLayersId,
--- a/gfx/tests/gtest/MockWidget.h
+++ b/gfx/tests/gtest/MockWidget.h
@@ -53,17 +53,17 @@ public:
const LayoutDeviceIntRect& aRect,
nsWidgetInitData* aInitData = nullptr) override { return NS_OK; }
virtual nsresult Create(nsIWidget* aParent,
nsNativeWidget aNativeParent,
const DesktopIntRect& aRect,
nsWidgetInitData* aInitData = nullptr) override { return NS_OK; }
virtual void Show(bool aState) override {}
virtual bool IsVisible() const override { return true; }
- virtual void std::move(double aX, double aY) override {}
+ virtual void Move(double aX, double aY) override {}
virtual void Resize(double aWidth, double aHeight, bool aRepaint) override {}
virtual void Resize(double aX, double aY,
double aWidth, double aHeight, bool aRepaint) override {}
virtual void Enable(bool aState) override {}
virtual bool IsEnabled() const override { return true; }
virtual nsresult SetFocus(bool aRaise) override { return NS_OK; }
virtual nsresult ConfigureChildren(const nsTArray<Configuration>& aConfigurations) override { return NS_OK; }
--- a/ipc/chromium/src/base/file_descriptor_shuffle.h
+++ b/ipc/chromium/src/base/file_descriptor_shuffle.h
@@ -33,26 +33,26 @@ namespace base {
// multimapping in place.
class InjectionDelegate {
public:
// Duplicate |fd|, an element of the domain, and write a fresh element of the
// domain into |result|. Returns true iff successful.
virtual bool Duplicate(int* result, int fd) = 0;
// Destructively move |src| to |dest|, overwriting |dest|. Returns true iff
// successful.
- virtual bool std::move(int src, int dest) = 0;
+ virtual bool Move(int src, int dest) = 0;
// Delete an element of the domain.
virtual void Close(int fd) = 0;
};
// An implementation of the InjectionDelegate interface using the file
// descriptor table of the current process as the domain.
class FileDescriptorTableInjection : public InjectionDelegate {
virtual bool Duplicate(int* result, int fd) override;
- virtual bool std::move(int src, int dest) override;
+ virtual bool Move(int src, int dest) override;
virtual void Close(int fd) override;
};
// A single arc of the directed graph which describes an injective multimapping.
struct InjectionArc {
InjectionArc(int in_source, int in_dest, bool in_close)
: source(in_source),
dest(in_dest),
--- a/mfbt/Move.h
+++ b/mfbt/Move.h
@@ -6,16 +6,18 @@
/* C++11-style, but C++98-usable, "move references" implementation. */
#ifndef mozilla_Move_h
#define mozilla_Move_h
#include "mozilla/TypeTraits.h"
+#include <utility>
+
namespace mozilla {
/*
* "Move" References
*
* Some types can be copied much more efficiently if we know the original's
* value need not be preserved --- that is, if we are doing a "move", not a
* "copy". For example, if we have:
@@ -56,17 +58,17 @@ namespace mozilla {
* If a constructor has a single argument of type 'T&&' (an 'rvalue reference
* to T'), that indicates that it is a 'move constructor'. That's 1). It should
* move, not copy, its argument into the object being constructed. It may leave
* the original in any safely-destructible state.
*
* If a constructor's argument is an rvalue, as in 'C(f(x))' or 'C(x + y)', as
* opposed to an lvalue, as in 'C(x)', then overload resolution will prefer the
* move constructor, if there is one. The 'std::move' function, defined in
- * this file, is an identity function you can use in a constructor invocation to
+ * <utility>, is an identity function you can use in a constructor invocation to
* make any argument into an rvalue, like this: C(std::move(x)). That's 2). (You
* could use any function that works, but 'Move' indicates your intention
* clearly.)
*
* Where we might define a copy constructor for a class C like this:
*
* C(const C& rhs) { ... copy rhs to this ... }
*
@@ -188,27 +190,16 @@ namespace mozilla {
* // C is as above
* struct S { int x : 1; } s;
* C(s.x, 0); // BAD: s.x is a reference to a bit-field, can't form those
* int tmp = s.x;
* C(tmp, 0); // OK: tmp not a bit-field
*/
/**
- * Identical to std::Move(); this is necessary until our stlport supports
- * std::move().
- */
-template<typename T>
-inline typename RemoveReference<T>::Type&&
-Move(T&& aX)
-{
- return static_cast<typename RemoveReference<T>::Type&&>(aX);
-}
-
-/**
* 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);
--- a/mfbt/tests/TestTuple.cpp
+++ b/mfbt/tests/TestTuple.cpp
@@ -71,17 +71,17 @@ TestConstruction()
Tuple<int> x2{x1};
Tuple<int, int> f(c);
CHECK(Get<0>(f) == 1);
CHECK(Get<0>(f) == 1);
// Move construction
Tuple<UniquePtr<int>> g{MakeUnique<int>(42)};
- Tuple<UniquePtr<int>> h{Move(g)};
+ Tuple<UniquePtr<int>> h{std::move(g)};
CHECK(Get<0>(g) == nullptr);
CHECK(*Get<0>(h) == 42);
}
static void
TestConstructionFromMozPair()
{
// Construction from elements
--- a/modules/pdfium/pdfium/fpdfsdk/pdfwindow/PWL_Wnd.h
+++ b/modules/pdfium/pdfium/fpdfsdk/pdfwindow/PWL_Wnd.h
@@ -274,17 +274,17 @@ class CPWL_Wnd : public CPWL_TimerHandle
virtual CFX_FloatRect GetFocusRect() const;
virtual CFX_FloatRect GetClientRect() const;
void InvalidateFocusHandler(IPWL_FocusHandler* handler);
void InvalidateProvider(IPWL_Provider* provider);
void Create(const PWL_CREATEPARAM& cp);
void Destroy();
- void std::move(const CFX_FloatRect& rcNew, bool bReset, bool bRefresh);
+ void Move(const CFX_FloatRect& rcNew, bool bReset, bool bRefresh);
void SetCapture();
void ReleaseCapture();
void DrawAppearance(CFX_RenderDevice* pDevice, CFX_Matrix* pUser2Device);
CPWL_Color GetBackgroundColor() const;
void SetBackgroundColor(const CPWL_Color& color);
--- a/toolkit/components/protobuf/src/google/protobuf/map_entry_lite.h
+++ b/toolkit/components/protobuf/src/google/protobuf/map_entry_lite.h
@@ -55,37 +55,37 @@ class MapFieldLite;
namespace protobuf {
namespace internal {
// MoveHelper::Move is used to set *dest. It copies *src, or moves it (in
// the C++11 sense), or swaps it. *src is left in a sane state for
// subsequent destruction, but shouldn't be used for anything.
template <bool is_enum, bool is_message, bool is_stringlike, typename T>
struct MoveHelper { // primitives
- static void std::move(T* src, T* dest) { *dest = *src; }
+ static void Move(T* src, T* dest) { *dest = *src; }
};
template <bool is_message, bool is_stringlike, typename T>
struct MoveHelper<true, is_message, is_stringlike, T> { // enums
- static void std::move(T* src, T* dest) { *dest = *src; }
+ static void Move(T* src, T* dest) { *dest = *src; }
// T is an enum here, so allow conversions to and from int.
- static void std::move(T* src, int* dest) { *dest = static_cast<int>(*src); }
- static void std::move(int* src, T* dest) { *dest = static_cast<T>(*src); }
+ static void Move(T* src, int* dest) { *dest = static_cast<int>(*src); }
+ static void Move(int* src, T* dest) { *dest = static_cast<T>(*src); }
};
template <bool is_stringlike, typename T>
struct MoveHelper<false, true, is_stringlike, T> { // messages
- static void std::move(T* src, T* dest) { dest->Swap(src); }
+ static void Move(T* src, T* dest) { dest->Swap(src); }
};
template <typename T>
struct MoveHelper<false, false, true, T> { // strings and similar
- static void std::move(T* src, T* dest) {
+ static void Move(T* src, T* dest) {
#if __cplusplus >= 201103L
- *dest = std::move(*src);
+ *dest = Move(*src);
#else
dest->swap(*src);
#endif
}
};
// MapEntryImpl is used to implement parsing and serialization of map entries.
// It uses Curious Recursive Template Pattern (CRTP) to provide the type of
--- a/widget/PuppetWidget.h
+++ b/widget/PuppetWidget.h
@@ -92,17 +92,17 @@ public:
{ return mVisible; }
virtual void ConstrainPosition(bool /*ignored aAllowSlop*/,
int32_t* aX,
int32_t* aY) override
{ *aX = kMaxDimension; *aY = kMaxDimension; }
// Widget position is controlled by the parent process via TabChild.
- virtual void std::move(double aX, double aY) override {}
+ virtual void Move(double aX, double aY) override {}
virtual void Resize(double aWidth,
double aHeight,
bool aRepaint) override;
virtual void Resize(double aX,
double aY,
double aWidth,
double aHeight,
--- a/widget/android/nsWindow.h
+++ b/widget/android/nsWindow.h
@@ -224,18 +224,17 @@ public:
virtual nsIWidget *GetParent(void) override;
virtual float GetDPI() override;
virtual double GetDefaultScaleInternal() override;
virtual void Show(bool aState) override;
virtual bool IsVisible() const override;
virtual void ConstrainPosition(bool aAllowSlop,
int32_t *aX,
int32_t *aY) override;
- virtual void std::move(double aX,
- double aY) override;
+ virtual void Move(double aX, double aY) override;
virtual void Resize(double aWidth,
double aHeight,
bool aRepaint) override;
virtual void Resize(double aX,
double aY,
double aWidth,
double aHeight,
bool aRepaint) override;
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -318,17 +318,17 @@ public:
virtual void Show(bool aState) override;
virtual bool IsVisible() const override;
virtual void SetParent(nsIWidget* aNewParent) override;
virtual nsIWidget* GetParent(void) override;
virtual float GetDPI() override;
- virtual void std::move(double aX, double aY) override;
+ virtual void Move(double aX, double aY) override;
virtual void Resize(double aWidth, double aHeight, bool aRepaint) override;
virtual void Resize(double aX, double aY,
double aWidth, double aHeight, bool aRepaint) override;
virtual void Enable(bool aState) override;
virtual bool IsEnabled() const override;
virtual nsresult SetFocus(bool aRaise) override;
virtual LayoutDeviceIntRect GetBounds() override;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -3996,17 +3996,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
if (parent) {
nsTArray<nsCOMPtr<nsIWidget>> widgetArray;
while (parent) {
widgetArray.AppendElement(parent);
parent = parent->GetParent();
}
widgetArray.AppendElement(mGeckoChild);
nsCOMPtr<nsIRunnable> releaserRunnable =
- new WidgetsReleaserRunnable(Move(widgetArray));
+ new WidgetsReleaserRunnable(std::move(widgetArray));
NS_DispatchToMainThread(releaserRunnable);
}
if ([self isUsingOpenGL]) {
if (ShadowLayerForwarder* slf = mGeckoChild->GetLayerManager()->AsShadowForwarder()) {
slf->WindowOverlayChanged();
} else if (WebRenderLayerManager* wrlm = mGeckoChild->GetLayerManager()->AsWebRenderLayerManager()) {
wrlm->WindowOverlayChanged();
--- a/widget/cocoa/nsCocoaWindow.h
+++ b/widget/cocoa/nsCocoaWindow.h
@@ -231,17 +231,17 @@ public:
virtual LayoutDeviceIntSize
ClientToWindowSize(const LayoutDeviceIntSize& aClientSize) override;
virtual void* GetNativeData(uint32_t aDataType) override;
virtual void ConstrainPosition(bool aAllowSlop,
int32_t *aX, int32_t *aY) override;
virtual void SetSizeConstraints(const SizeConstraints& aConstraints) override;
- virtual void std::move(double aX, double aY) override;
+ virtual void Move(double aX, double aY) override;
virtual void SetSizeMode(nsSizeMode aMode) override;
virtual void SuppressAnimation(bool aSuppress) override;
virtual void HideWindowChrome(bool aShouldHide) override;
void WillEnterFullScreen(bool aFullScreen);
void EnteredFullScreen(bool aFullScreen, bool aNativeMode = true);
virtual bool PrepareForFullscreenTransition(nsISupports** aData) override;
virtual void PerformFullscreenTransition(FullscreenTransitionStage aStage,
--- a/widget/gtk/nsWindow.h
+++ b/widget/gtk/nsWindow.h
@@ -126,18 +126,17 @@ public:
mozilla::DesktopToLayoutDeviceScale GetDesktopToDeviceScale() override;
virtual void SetParent(nsIWidget* aNewParent) override;
virtual void SetModal(bool aModal) override;
virtual bool IsVisible() const override;
virtual void ConstrainPosition(bool aAllowSlop,
int32_t *aX,
int32_t *aY) override;
virtual void SetSizeConstraints(const SizeConstraints& aConstraints) override;
- virtual void std::move(double aX,
- double aY) override;
+ virtual void Move(double aX, double aY) override;
virtual void Show (bool aState) override;
virtual void Resize (double aWidth,
double aHeight,
bool aRepaint) override;
virtual void Resize (double aX,
double aY,
double aWidth,
double aHeight,
--- a/widget/headless/HeadlessWidget.h
+++ b/widget/headless/HeadlessWidget.h
@@ -73,17 +73,17 @@ public:
virtual nsIWidget* GetTopLevelWidget() override;
virtual void GetCompositorWidgetInitData(mozilla::widget::CompositorWidgetInitData* aInitData) override;
virtual void Destroy() override;
virtual void Show(bool aState) override;
virtual bool IsVisible() const override;
- virtual void std::move(double aX, double aY) override;
+ virtual void Move(double aX, double aY) override;
virtual void Resize(double aWidth,
double aHeight,
bool aRepaint) override;
virtual void Resize(double aX,
double aY,
double aWidth,
double aHeight,
bool aRepaint) override;
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1558,19 +1558,19 @@ void
nsBaseWidget::MoveClient(double aX, double aY)
{
LayoutDeviceIntPoint clientOffset(GetClientOffset());
// GetClientOffset returns device pixels; scale back to desktop pixels
// if that's what this widget uses for the Move/Resize APIs
if (BoundsUseDesktopPixels()) {
DesktopPoint desktopOffset = clientOffset / GetDesktopToDeviceScale();
- std::move(aX - desktopOffset.x, aY - desktopOffset.y);
+ Move(aX - desktopOffset.x, aY - desktopOffset.y);
} else {
- std::move(aX - clientOffset.x, aY - clientOffset.y);
+ Move(aX - clientOffset.x, aY - clientOffset.y);
}
}
void
nsBaseWidget::ResizeClient(double aWidth, double aHeight, bool aRepaint)
{
NS_ASSERTION((aWidth >=0) , "Negative width passed to ResizeClient");
NS_ASSERTION((aHeight >=0), "Negative height passed to ResizeClient");
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -728,17 +728,17 @@ class nsIWidget : public nsISupports
*
* Coordinates refer to the top-left of the widget. For toplevel windows
* with decorations, this is the top-left of the titlebar and frame .
*
* @param aX the new x position expressed in the parent's coordinate system
* @param aY the new y position expressed in the parent's coordinate system
*
**/
- virtual void std::move(double aX, double aY) = 0;
+ virtual void Move(double aX, double aY) = 0;
/**
* Reposition this widget so that the client area has the given offset.
*
* @param aX the new x offset of the client area expressed as an
* offset from the origin of the client area of the parent
* widget (for root widgets and popup widgets it is in
* screen coordinates)
--- a/widget/uikit/nsWindow.h
+++ b/widget/uikit/nsWindow.h
@@ -44,17 +44,17 @@ public:
return mVisible;
}
virtual nsresult SetFocus(bool aState=false) override;
virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
virtual void SetBackgroundColor(const nscolor &aColor) override;
virtual void* GetNativeData(uint32_t aDataType) override;
- virtual void std::move(double aX, double aY) override;
+ virtual void Move(double aX, double aY) override;
virtual void SetSizeMode(nsSizeMode aMode) override;
void EnteredFullScreen(bool aFullScreen);
virtual void Resize(double aWidth, double aHeight, bool aRepaint) override;
virtual void Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
virtual LayoutDeviceIntRect GetScreenBounds() override;
void ReportMoveEvent();
void ReportSizeEvent();
void ReportSizeModeEvent(nsSizeMode aMode);
--- a/widget/windows/nsWindow.h
+++ b/widget/windows/nsWindow.h
@@ -123,17 +123,17 @@ public:
}
}
virtual void Show(bool aState) override;
virtual bool IsVisible() const override;
virtual void ConstrainPosition(bool aAllowSlop, int32_t *aX, int32_t *aY) override;
virtual void SetSizeConstraints(const SizeConstraints& aConstraints) override;
virtual const SizeConstraints GetSizeConstraints() override;
- virtual void std::move(double aX, double aY) override;
+ virtual void Move(double aX, double aY) override;
virtual void Resize(double aWidth, double aHeight, bool aRepaint) override;
virtual void Resize(double aX, double aY, double aWidth, double aHeight, bool aRepaint) override;
virtual MOZ_MUST_USE nsresult
BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent,
int32_t aHorizontal,
int32_t aVertical) override;
virtual void PlaceBehind(nsTopLevelWidgetZPlacement aPlacement, nsIWidget *aWidget, bool aActivate) override;
virtual void SetSizeMode(nsSizeMode aMode) override;