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

Side by Side Diff: mojo/services/dbus_echo/dbus_echo_service.cc

Issue 380413003: Mojo: Use InterfaceFactory<Interface> for service registration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix network_service_loader Created 6 years, 5 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 | Annotate | Revision Log
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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "base/run_loop.h" 11 #include "base/run_loop.h"
12 #include "mojo/dbus/dbus_external_service.h" 12 #include "mojo/dbus/dbus_external_service.h"
13 #include "mojo/embedder/channel_init.h" 13 #include "mojo/embedder/channel_init.h"
14 #include "mojo/embedder/embedder.h" 14 #include "mojo/embedder/embedder.h"
15 #include "mojo/public/cpp/environment/environment.h" 15 #include "mojo/public/cpp/environment/environment.h"
16 #include "mojo/services/dbus_echo/echo.mojom.h" 16 #include "mojo/services/dbus_echo/echo.mojom.h"
17 17
18 namespace { 18 namespace {
19 class EchoServiceImpl : public mojo::InterfaceImpl<mojo::EchoService> { 19 class EchoServiceImpl : public mojo::InterfaceImpl<mojo::EchoService> {
20 public: 20 public:
21 explicit EchoServiceImpl(mojo::ApplicationConnection* connection) {} 21 EchoServiceImpl() {}
22 virtual ~EchoServiceImpl() {} 22 virtual ~EchoServiceImpl() {}
23 23
24 protected: 24 protected:
25 virtual void Echo( 25 virtual void Echo(
26 const mojo::String& in_to_echo, 26 const mojo::String& in_to_echo,
27 const mojo::Callback<void(mojo::String)>& callback) OVERRIDE { 27 const mojo::Callback<void(mojo::String)>& callback) OVERRIDE {
28 DVLOG(1) << "Asked to echo " << in_to_echo; 28 DVLOG(1) << "Asked to echo " << in_to_echo;
29 callback.Run(in_to_echo); 29 callback.Run(in_to_echo);
30 } 30 }
31 }; 31 };
(...skipping 17 matching lines...) Expand all
49 49
50 base::MessageLoopForIO message_loop; 50 base::MessageLoopForIO message_loop;
51 base::RunLoop run_loop; 51 base::RunLoop run_loop;
52 52
53 mojo::DBusExternalService<EchoServiceImpl> echo_service(kServiceName); 53 mojo::DBusExternalService<EchoServiceImpl> echo_service(kServiceName);
54 echo_service.Start(); 54 echo_service.Start();
55 55
56 run_loop.Run(); 56 run_loop.Run();
57 return 0; 57 return 0;
58 } 58 }
OLDNEW
« no previous file with comments | « mojo/service_manager/service_manager_unittest.cc ('k') | mojo/services/gles2/command_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698