OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/logging.h" | 5 #include "base/logging.h" |
6 #include "mojo/application/application_runner_chromium.h" | 6 #include "mojo/application/application_runner_chromium.h" |
7 #include "mojo/public/c/system/main.h" | 7 #include "mojo/public/c/system/main.h" |
8 #include "mojo/public/cpp/application/application_delegate.h" | 8 #include "mojo/public/cpp/application/application_delegate.h" |
9 #include "mojo/public/cpp/application/application_impl.h" | 9 #include "mojo/public/cpp/application/application_impl.h" |
10 #include "services/media/audio/audio_server_app.h" | 10 #include "services/media/audio/audio_server_app.h" |
11 | 11 |
12 namespace mojo { | 12 namespace mojo { |
13 namespace media { | 13 namespace media { |
14 namespace audio { | 14 namespace audio { |
15 | 15 |
16 AudioServerApp::AudioServerApp() {} | 16 AudioServerApp::AudioServerApp() {} |
17 AudioServerApp::~AudioServerApp() {} | 17 AudioServerApp::~AudioServerApp() {} |
18 | 18 |
19 void AudioServerApp::Initialize(ApplicationImpl* app) { | 19 void AudioServerApp::Initialize(ApplicationImpl* app) { |
20 server_impl_.Initialize(); | 20 server_impl_.Initialize(); |
21 } | 21 } |
22 | 22 |
23 bool AudioServerApp::ConfigureIncomingConnection( | 23 bool AudioServerApp::ConfigureIncomingConnection( |
24 ApplicationConnection* connection) { | 24 ServiceProviderImpl* service_provider_impl) { |
25 connection->GetServiceProviderImpl().AddService<AudioServer>( | 25 service_provider_impl->AddService<AudioServer>( |
26 [this](const ConnectionContext& connection_context, | 26 [this](const ConnectionContext& connection_context, |
27 InterfaceRequest<AudioServer> audio_server_request) { | 27 InterfaceRequest<AudioServer> audio_server_request) { |
28 bindings_.AddBinding(&server_impl_, audio_server_request.Pass()); | 28 bindings_.AddBinding(&server_impl_, audio_server_request.Pass()); |
29 }); | 29 }); |
30 return true; | 30 return true; |
31 } | 31 } |
32 | 32 |
33 void AudioServerApp::Quit() { | 33 void AudioServerApp::Quit() { |
34 } | 34 } |
35 | 35 |
36 } // namespace audio | 36 } // namespace audio |
37 } // namespace media | 37 } // namespace media |
38 } // namespace mojo | 38 } // namespace mojo |
39 | 39 |
40 MojoResult MojoMain(MojoHandle app_request) { | 40 MojoResult MojoMain(MojoHandle app_request) { |
41 mojo::ApplicationRunnerChromium runner( | 41 mojo::ApplicationRunnerChromium runner( |
42 new mojo::media::audio::AudioServerApp); | 42 new mojo::media::audio::AudioServerApp); |
43 return runner.Run(app_request); | 43 return runner.Run(app_request); |
44 } | 44 } |
OLD | NEW |