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..5ab6d47f6ec886db72fde53bb04eabbdb1de9181 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,10 @@ 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) { |
| + handle_ = other.release(); |
|
jamesr
2015/04/03 17:02:45
this operator is incorrect, it doesn't handle self
mgraczyk
2015/04/03 18:30:00
Care to elaborate?
Here's how I see it. The requi
jamesr
2015/04/03 19:18:23
Hmm, good point but I think having an idiomaticall
mgraczyk
2015/04/03 19:33:39
I agree and added the check.
Although, too many "
|
| return *this; |
| } |