Chromium Code Reviews| Index: mojo/edk/embedder/scoped_platform_handle.h |
| diff --git a/mojo/edk/embedder/scoped_platform_handle.h b/mojo/edk/embedder/scoped_platform_handle.h |
| index 2919b04622977c69c76d53d72dc431a54074f6b1..a6f252f0f721c7d27998ca58db85ad523f982ed0 100644 |
| --- a/mojo/edk/embedder/scoped_platform_handle.h |
| +++ b/mojo/edk/embedder/scoped_platform_handle.h |
| @@ -14,7 +14,7 @@ namespace mojo { |
| 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,13 @@ class MOJO_SYSTEM_IMPL_EXPORT ScopedPlatformHandle { |
| ~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) { |
|
viettrungluu
2015/04/03 19:36:51
nit: for consistency with surrounding code, please
mgraczyk
2015/04/03 19:44:27
Done.
|
| + handle_ = other.release(); |
| + } |
| return *this; |
| } |