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

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

Issue 2205193002: WIP: Reduce code size of InterfacePtrState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@before-sharing
Patch Set: Add missing, new .cc file Created 4 years, 4 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/BUILD.gn ('k') | mojo/public/cpp/bindings/interface_ptr_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/interface_ptr_info.h
diff --git a/mojo/public/cpp/bindings/interface_ptr_info.h b/mojo/public/cpp/bindings/interface_ptr_info.h
index 0b2d8089c4327f7bf608c152980d882dc0626a6b..d1b42df56ce105451e757d9a5ad0905919e41319 100644
--- a/mojo/public/cpp/bindings/interface_ptr_info.h
+++ b/mojo/public/cpp/bindings/interface_ptr_info.h
@@ -15,30 +15,17 @@ namespace mojo {
// InterfacePtrInfo stores necessary information to communicate with a remote
// interface implementation, which could be used to construct an InterfacePtr.
-template <typename Interface>
-class InterfacePtrInfo {
+class InterfacePtrInfoBase {
public:
- InterfacePtrInfo() : version_(0u) {}
-
- InterfacePtrInfo(ScopedMessagePipeHandle handle, uint32_t version)
- : handle_(std::move(handle)), version_(version) {}
+ InterfacePtrInfoBase();
- InterfacePtrInfo(InterfacePtrInfo&& other)
- : handle_(std::move(other.handle_)), version_(other.version_) {
- other.version_ = 0u;
- }
+ InterfacePtrInfoBase(ScopedMessagePipeHandle handle, uint32_t version);
- ~InterfacePtrInfo() {}
+ InterfacePtrInfoBase(InterfacePtrInfoBase&& other);
- InterfacePtrInfo& operator=(InterfacePtrInfo&& other) {
- if (this != &other) {
- handle_ = std::move(other.handle_);
- version_ = other.version_;
- other.version_ = 0u;
- }
+ ~InterfacePtrInfoBase();
- return *this;
- }
+ InterfacePtrInfoBase& operator=(InterfacePtrInfoBase&& other);
bool is_valid() const { return handle_.is_valid(); }
@@ -55,7 +42,12 @@ class InterfacePtrInfo {
ScopedMessagePipeHandle handle_;
uint32_t version_;
- DISALLOW_COPY_AND_ASSIGN(InterfacePtrInfo);
+ DISALLOW_COPY_AND_ASSIGN(InterfacePtrInfoBase);
+};
+
+template <typename Interface>
+class InterfacePtrInfo : public InterfacePtrInfoBase {
+ using InterfacePtrInfoBase::InterfacePtrInfoBase;
};
} // namespace mojo
« no previous file with comments | « mojo/public/cpp/bindings/BUILD.gn ('k') | mojo/public/cpp/bindings/interface_ptr_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698