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

Side by Side Diff: mojo/examples/dbus_echo/dbus_echo_app.cc

Issue 617503003: Mojo: MOJO_OVERRIDE -> override in mojo/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/examples/echo/echo_service.mojom.h" 10 #include "mojo/examples/echo/echo_service.mojom.h"
11 #include "mojo/public/c/system/main.h" 11 #include "mojo/public/c/system/main.h"
12 #include "mojo/public/cpp/application/application_delegate.h" 12 #include "mojo/public/cpp/application/application_delegate.h"
13 #include "mojo/public/cpp/application/application_impl.h" 13 #include "mojo/public/cpp/application/application_impl.h"
14 #include "mojo/public/cpp/application/application_runner.h" 14 #include "mojo/public/cpp/application/application_runner.h"
15 #include "mojo/public/cpp/environment/environment.h" 15 #include "mojo/public/cpp/environment/environment.h"
16 #include "mojo/public/cpp/system/core.h" 16 #include "mojo/public/cpp/system/core.h"
17 #include "mojo/public/cpp/system/macros.h" 17 #include "mojo/public/cpp/system/macros.h"
18 18
19 namespace mojo { 19 namespace mojo {
20 namespace examples { 20 namespace examples {
21 21
22 class DBusEchoApp : public ApplicationDelegate { 22 class DBusEchoApp : public ApplicationDelegate {
23 public: 23 public:
24 DBusEchoApp() {} 24 DBusEchoApp() {}
25 virtual ~DBusEchoApp() {} 25 virtual ~DBusEchoApp() {}
26 26
27 virtual void Initialize(ApplicationImpl* app) MOJO_OVERRIDE { 27 virtual void Initialize(ApplicationImpl* app) override {
28 app->ConnectToService( 28 app->ConnectToService(
29 "dbus:org.chromium.EchoService/org/chromium/MojoImpl", &echo_service_); 29 "dbus:org.chromium.EchoService/org/chromium/MojoImpl", &echo_service_);
30 30
31 echo_service_->EchoString( 31 echo_service_->EchoString(
32 String::From("who"), 32 String::From("who"),
33 base::Bind(&DBusEchoApp::OnEcho, base::Unretained(this))); 33 base::Bind(&DBusEchoApp::OnEcho, base::Unretained(this)));
34 } 34 }
35 35
36 private: 36 private:
37 void OnEcho(String echoed) { 37 void OnEcho(String echoed) {
38 LOG(INFO) << "echo'd " << echoed; 38 LOG(INFO) << "echo'd " << echoed;
39 } 39 }
40 40
41 EchoServicePtr echo_service_; 41 EchoServicePtr echo_service_;
42 42
43 DISALLOW_COPY_AND_ASSIGN(DBusEchoApp); 43 DISALLOW_COPY_AND_ASSIGN(DBusEchoApp);
44 }; 44 };
45 45
46 } // namespace examples 46 } // namespace examples
47 } // namespace mojo 47 } // namespace mojo
48 48
49 MojoResult MojoMain(MojoHandle shell_handle) { 49 MojoResult MojoMain(MojoHandle shell_handle) {
50 mojo::ApplicationRunner runner(new mojo::examples::DBusEchoApp); 50 mojo::ApplicationRunner runner(new mojo::examples::DBusEchoApp);
51 return runner.Run(shell_handle); 51 return runner.Run(shell_handle);
52 } 52 }
OLDNEW
« no previous file with comments | « mojo/examples/content_handler_demo/content_handler_demo.cc ('k') | mojo/examples/demo_launcher/demo_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698