Use newer Chromium helper macro for defining move-only type.
R=jamesr@chromium.org, viettrungluu@chromium.org
Review URL: https://codereview.chromium.org/1059663002
diff --git a/mojo/edk/embedder/scoped_platform_handle.h b/mojo/edk/embedder/scoped_platform_handle.h
index 2919b04..0ec99b8 100644
--- a/mojo/edk/embedder/scoped_platform_handle.h
+++ b/mojo/edk/embedder/scoped_platform_handle.h
@@ -14,7 +14,7 @@
namespace embedder {
class MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle {
- MOVE_ONLY_TYPE_FOR_CPP_03(ScopedPlatformHandle, RValue)
+ MOVE_ONLY_TYPE_WITH_MOVE_CONSTRUCTOR_FOR_CPP_03(ScopedPlatformHandle)
public:
ScopedPlatformHandle() {}
@@ -22,9 +22,12 @@
~ScopedPlatformHandle() { handle_.CloseIfNecessary(); }
// Move-only constructor and operator=.
- ScopedPlatformHandle(RValue other) : handle_(other.object->release()) {}
- ScopedPlatformHandle& operator=(RValue other) {
- handle_ = other.object->release();
+ ScopedPlatformHandle(ScopedPlatformHandle&& other)
+ : handle_(other.release()) {}
+
+ ScopedPlatformHandle& operator=(ScopedPlatformHandle&& other) {
+ if (this != &other)
+ handle_ = other.release();
return *this;
}