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

Side by Side Diff: media/mojo/services/main.cc

Issue 2299703005: Rename TestMojoMediaClient -> DefaultMojoMediaClient. (Closed)
Patch Set: Created 4 years, 3 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 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/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "media/mojo/services/mojo_media_application.h" 9 #include "media/mojo/services/mojo_media_application_factory.h"
10 #include "media/mojo/services/test_mojo_media_client.h"
11 #include "services/shell/public/c/main.h" 10 #include "services/shell/public/c/main.h"
12 #include "services/shell/public/cpp/service_runner.h" 11 #include "services/shell/public/cpp/service_runner.h"
13 12
14 namespace { 13 namespace {
15 14
16 shell::ServiceRunner* g_runner = nullptr; 15 shell::ServiceRunner* g_runner = nullptr;
17 16
18 void QuitApplication() { 17 void QuitApplication() {
19 DCHECK(g_runner); 18 DCHECK(g_runner);
20 g_runner->Quit(); 19 g_runner->Quit();
21 } 20 }
22 21
23 } // namespace 22 } // namespace
24 23
25 MojoResult ServiceMain(MojoHandle mojo_handle) { 24 MojoResult ServiceMain(MojoHandle mojo_handle) {
26 // Enable logging. 25 // Enable logging.
27 base::AtExitManager at_exit; 26 base::AtExitManager at_exit;
28 shell::ServiceRunner::InitBaseCommandLine(); 27 shell::ServiceRunner::InitBaseCommandLine();
29 28
30 logging::LoggingSettings settings; 29 logging::LoggingSettings settings;
31 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 30 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
32 logging::InitLogging(settings); 31 logging::InitLogging(settings);
33 32
34 shell::ServiceRunner runner(new media::MojoMediaApplication( 33 std::unique_ptr<shell::Service> service =
35 base::MakeUnique<media::TestMojoMediaClient>(), 34 media::CreateMojoMediaApplication(base::Bind(&QuitApplication));
36 base::Bind(&QuitApplication))); 35 shell::ServiceRunner runner(service.release());
37 g_runner = &runner; 36 g_runner = &runner;
38 return runner.Run(mojo_handle, false /* init_base */); 37 return runner.Run(mojo_handle, false /* init_base */);
39 } 38 }
OLDNEW
« no previous file with comments | « media/mojo/services/default_mojo_media_client.cc ('k') | media/mojo/services/mojo_media_application_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698