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

Unified Diff: mojo/public/cpp/bindings/tests/sample_service_unittest.cc

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
Index: mojo/public/cpp/bindings/tests/sample_service_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
index c291b1ca7d4e7531ff50cc9b4321b20ce1d45943..2ef710b2edfe268c9e8fa93a2352fb315fd5f2d4 100644
--- a/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/sample_service_unittest.cc
@@ -5,6 +5,7 @@
#include <algorithm>
#include <ostream>
#include <string>
+#include <utility>
#include "mojo/public/cpp/environment/environment.h"
#include "mojo/public/cpp/system/macros.h"
@@ -258,7 +259,7 @@ class ServiceImpl : public Service {
public:
void Frobinate(FooPtr foo,
BazOptions baz,
- PortPtr port,
+ mojo::InterfaceHandle<Port> port,
const Service::FrobinateCallback& callback) override {
// Users code goes here to handle the incoming Frobinate message.
@@ -274,7 +275,8 @@ class ServiceImpl : public Service {
int depth = 1;
Print(depth, "foo", foo);
Print(depth, "baz", static_cast<int32_t>(baz));
- Print(depth, "port", port.get());
+ auto portptr = PortPtr::Create(std::move(port));
+ Print(depth, "port", portptr.get());
}
callback.Run(5);
}
@@ -340,7 +342,7 @@ TEST_F(BindingsSampleTest, Basic) {
CheckFoo(*foo);
PortPtr port;
- service->Frobinate(foo.Pass(), Service::BazOptions::EXTRA, port.Pass(),
+ service->Frobinate(foo.Pass(), Service::BazOptions::EXTRA, std::move(port),
Service::FrobinateCallback());
delete service;
« no previous file with comments | « mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc ('k') | mojo/public/cpp/bindings/tests/union_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698