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

Unified Diff: examples/native_run_app/native_run_app.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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: examples/native_run_app/native_run_app.cc
diff --git a/examples/native_run_app/native_run_app.cc b/examples/native_run_app/native_run_app.cc
index 262d357f6c3311a95bc478934d2d8b3283b0b3ca..490e235a52f6ffbc9de7a3b451af620780f3e7a6 100644
--- a/examples/native_run_app/native_run_app.cc
+++ b/examples/native_run_app/native_run_app.cc
@@ -156,8 +156,9 @@ class TerminalConnection {
// TODO(vtl): If the |InterfacePtr| underlying |native_support_process_|
// encounters an error, then we're sort of dead in the water.
native_support_process_->SpawnWithTerminal(
- ToByteArray(command_line_[0]), argv.Pass(), nullptr, terminal_.Pass(),
- GetProxy(&process_controller_), [this](mojo::files::Error error) {
+ ToByteArray(command_line_[0]), argv.Pass(), nullptr,
+ terminal_.PassInterfaceHandle(), GetProxy(&process_controller_),
+ [this](mojo::files::Error error) {
this->DidSpawnWithTerminal(error);
});
process_controller_.set_connection_error_handler([this]() { delete this; });
@@ -201,10 +202,12 @@ class TerminalClientImpl : public TerminalClient {
~TerminalClientImpl() override {}
// |TerminalClient| implementation:
- void ConnectToTerminal(mojo::files::FilePtr terminal) override {
+ void ConnectToTerminal(
+ mojo::InterfaceHandle<mojo::files::File> terminal) override {
if (terminal) {
// Owns itself.
- new TerminalConnection(terminal.Pass(), native_support_process_);
+ new TerminalConnection(mojo::files::FilePtr::Create(std::move(terminal)),
+ native_support_process_);
} else {
LOG(ERROR) << "No terminal";
}

Powered by Google App Engine
This is Rietveld 408576698