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

Unified Diff: examples/notification_generator/notification_generator.cc

Issue 1682113003: Mojo C++ bindings: Generate InterfaceHandle<> instead of InterfacePtr<>. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: delay InterfacePtr::Create() until you actually need an InterfacePtr. GetProxy() and ConnectToAppl… 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/notification_generator/notification_generator.cc
diff --git a/examples/notification_generator/notification_generator.cc b/examples/notification_generator/notification_generator.cc
index 0d7f755879b3fb345751c92e8f468dc0d2f319ba..9d182b427b51b01b50a42c9c3de65204fcde7ce3 100644
--- a/examples/notification_generator/notification_generator.cc
+++ b/examples/notification_generator/notification_generator.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 "base/bind.h"
#include "base/macros.h"
#include "mojo/application/application_runner_chromium.h"
@@ -59,11 +61,12 @@ class NotificationGeneratorDelegate : public mojo::ApplicationDelegate,
void PostNotification(const char* title,
const char* text,
notifications::NotificationPtr* notification) {
- notifications::NotificationClientPtr notification_client;
+ mojo::InterfaceHandle<notifications::NotificationClient>
+ notification_client;
auto request = mojo::GetProxy(&notification_client);
client_bindings_.AddBinding(this, request.Pass());
notification_service_->Post(CreateNotificationData(title, text).Pass(),
- notification_client.Pass(),
+ std::move(notification_client),
GetProxy(notification));
}

Powered by Google App Engine
This is Rietveld 408576698