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

Unified Diff: mojo/public/cpp/bindings/tests/handle_passing_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/handle_passing_unittest.cc
diff --git a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
index 5345ccaee5108c7f8191c01899ae65abbdc2059a..3af49e424fe86f0a355e6c76898f874f37b9b309 100644
--- a/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
+++ b/mojo/public/cpp/bindings/tests/handle_passing_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <utility>
+
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "mojo/public/cpp/environment/environment.h"
@@ -89,7 +91,8 @@ class SampleFactoryImpl : public sample::Factory {
callback.Run(response.Pass(), text1);
if (request->obj)
- request->obj->DoSomething();
+ imported::ImportedInterfacePtr::Create(std::move(request->obj))
+ ->DoSomething();
}
void DoStuff2(ScopedDataPipeConsumerHandle pipe,
@@ -126,9 +129,9 @@ class SampleFactoryImpl : public sample::Factory {
const mojo::Callback<void(InterfaceRequest<imported::ImportedInterface>)>&
callback) override {}
void TakeImportedInterface(
- imported::ImportedInterfacePtr imported,
- const mojo::Callback<void(imported::ImportedInterfacePtr)>& callback)
- override {}
+ InterfaceHandle<imported::ImportedInterface> imported,
+ const mojo::Callback<void(InterfaceHandle<imported::ImportedInterface>)>&
+ callback) override {}
private:
ScopedMessagePipeHandle pipe1_;
« no previous file with comments | « mojo/public/cpp/bindings/tests/binding_unittest.cc ('k') | mojo/public/cpp/bindings/tests/interface_ptr_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698