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

Unified Diff: mojo/public/cpp/bindings/struct_ptr.h

Issue 2047633002: Revert of Remove base/move.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/public/cpp/bindings/tests/container_test_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/struct_ptr.h
diff --git a/mojo/public/cpp/bindings/struct_ptr.h b/mojo/public/cpp/bindings/struct_ptr.h
index ab5d57034559c65dc7de1c6fbac630f88f6d1e46..e3b072deaad2e75fb9306c351536cf145c080375 100644
--- a/mojo/public/cpp/bindings/struct_ptr.h
+++ b/mojo/public/cpp/bindings/struct_ptr.h
@@ -8,7 +8,7 @@
#include <new>
#include "base/logging.h"
-#include "base/macros.h"
+#include "base/move.h"
#include "mojo/public/cpp/bindings/type_converter.h"
namespace mojo {
@@ -28,6 +28,8 @@
// Smart pointer wrapping a mojom structure with move-only semantics.
template <typename Struct>
class StructPtr {
+ MOVE_ONLY_TYPE_FOR_CPP_03(StructPtr);
+
public:
StructPtr() : ptr_(nullptr) {}
@@ -84,7 +86,6 @@
}
private:
- // TODO(dcheng): Use an explicit conversion operator.
typedef Struct* StructPtr::*Testable;
public:
@@ -111,13 +112,13 @@
}
Struct* ptr_;
-
- DISALLOW_COPY_AND_ASSIGN(StructPtr);
};
// Designed to be used when Struct is small and copyable.
template <typename Struct>
class InlinedStructPtr {
+ MOVE_ONLY_TYPE_FOR_CPP_03(InlinedStructPtr);
+
public:
InlinedStructPtr() : is_null_(true) {}
@@ -174,7 +175,6 @@
}
private:
- // TODO(dcheng): Use an explicit conversion operator.
typedef Struct InlinedStructPtr::*Testable;
public:
@@ -199,8 +199,6 @@
mutable Struct value_;
bool is_null_;
-
- DISALLOW_COPY_AND_ASSIGN(InlinedStructPtr);
};
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/strong_binding.h ('k') | mojo/public/cpp/bindings/tests/container_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698