Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Unified Diff: mojo/edk/embedder/scoped_platform_handle.h

Issue 1059663002: Use newer Chromium helper macro for defining move-only type. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698