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

Unified Diff: mojo/public/cpp/bindings/lib/bindings_serialization.h

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebase ontop of master, address trung's comments Created 4 years, 10 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/lib/bindings_internal.h ('k') | mojo/public/cpp/bindings/strong_binding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/lib/bindings_serialization.h
diff --git a/mojo/public/cpp/bindings/lib/bindings_serialization.h b/mojo/public/cpp/bindings/lib/bindings_serialization.h
index 9b0f70b240ad9b083a902aacb6741944f0d7e3b1..94f17bf920654bcbb1234577fb051a9fb9ace02f 100644
--- a/mojo/public/cpp/bindings/lib/bindings_serialization.h
+++ b/mojo/public/cpp/bindings/lib/bindings_serialization.h
@@ -13,9 +13,6 @@
namespace mojo {
template <typename I>
-class InterfacePtr;
-
-template <typename I>
class InterfaceHandle;
namespace internal {
@@ -77,18 +74,17 @@ inline void Decode(T* obj, std::vector<Handle>* handles) {
}
template <typename T>
-inline void InterfacePointerToData(InterfacePtr<T> input,
- Interface_Data* output) {
- InterfaceHandle<T> info = input.PassInterfaceHandle();
- output->handle = info.PassHandle().release();
- output->version = info.version();
+inline void InterfaceHandleToData(InterfaceHandle<T> input,
+ Interface_Data* output) {
+ output->handle = input.PassHandle().release();
+ output->version = input.version();
}
template <typename T>
-inline void InterfaceDataToPointer(Interface_Data* input,
- InterfacePtr<T>* output) {
- output->Bind(InterfaceHandle<T>(
- MakeScopedHandle(FetchAndReset(&input->handle)), input->version));
+inline void InterfaceDataToHandle(Interface_Data* input,
+ InterfaceHandle<T>* output) {
+ *output = InterfaceHandle<T>(MakeScopedHandle(FetchAndReset(&input->handle)),
+ input->version);
}
} // namespace internal
« no previous file with comments | « mojo/public/cpp/bindings/lib/bindings_internal.h ('k') | mojo/public/cpp/bindings/strong_binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698