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

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

Issue 823853003: Enable logging in mojo:media app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 12 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
« no previous file with comments | « no previous file | mojo/services/html_viewer/html_viewer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h"
6 #include "base/logging.h"
5 #include "media/mojo/services/mojo_renderer_service.h" 7 #include "media/mojo/services/mojo_renderer_service.h"
6 #include "mojo/application/application_runner_chromium.h" 8 #include "mojo/application/application_runner_chromium.h"
7 #include "mojo/public/c/system/main.h" 9 #include "mojo/public/c/system/main.h"
8 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
9 #include "mojo/public/cpp/application/application_delegate.h" 11 #include "mojo/public/cpp/application/application_delegate.h"
12 #include "mojo/public/cpp/application/application_impl.h"
10 #include "mojo/public/cpp/application/interface_factory_impl.h" 13 #include "mojo/public/cpp/application/interface_factory_impl.h"
11 14
12 namespace media { 15 namespace media {
13 16
14 class MojoMediaApplication 17 class MojoMediaApplication
15 : public mojo::ApplicationDelegate, 18 : public mojo::ApplicationDelegate,
16 public mojo::InterfaceFactory<mojo::MediaRenderer> { 19 public mojo::InterfaceFactory<mojo::MediaRenderer> {
17 public: 20 public:
18 // mojo::ApplicationDelegate implementation. 21 // mojo::ApplicationDelegate implementation.
22 void Initialize(mojo::ApplicationImpl* app) override {
23 base::CommandLine::StringVector command_line_args;
24 #if defined(OS_WIN)
25 for (const auto& arg : app->args())
26 command_line_args.push_back(base::UTF8ToUTF16(arg));
27 #elif defined(OS_POSIX)
28 command_line_args = app->args();
29 #endif
30
31 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
32 command_line->InitFromArgv(command_line_args);
33
34 logging::LoggingSettings settings;
35 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
36 logging::InitLogging(settings);
37 // Display process ID, thread ID and timestamp in logs.
38 logging::SetLogItems(true, true, true, false);
39 }
40
19 bool ConfigureIncomingConnection( 41 bool ConfigureIncomingConnection(
20 mojo::ApplicationConnection* connection) override { 42 mojo::ApplicationConnection* connection) override {
21 connection->AddService(this); 43 connection->AddService(this);
22 return true; 44 return true;
23 } 45 }
24 46
25 // mojo::InterfaceFactory<mojo::MediaRenderer> implementation. 47 // mojo::InterfaceFactory<mojo::MediaRenderer> implementation.
26 void Create(mojo::ApplicationConnection* connection, 48 void Create(mojo::ApplicationConnection* connection,
27 mojo::InterfaceRequest<mojo::MediaRenderer> request) override { 49 mojo::InterfaceRequest<mojo::MediaRenderer> request) override {
28 mojo::BindToRequest(new MojoRendererService(), &request); 50 mojo::BindToRequest(new MojoRendererService(), &request);
29 } 51 }
30 }; 52 };
31 53
32 } // namespace media 54 } // namespace media
33 55
34 MojoResult MojoMain(MojoHandle mojo_handle) { 56 MojoResult MojoMain(MojoHandle mojo_handle) {
35 mojo::ApplicationRunnerChromium runner(new media::MojoMediaApplication); 57 mojo::ApplicationRunnerChromium runner(new media::MojoMediaApplication);
36 return runner.Run(mojo_handle); 58 return runner.Run(mojo_handle);
37 } 59 }
OLDNEW
« no previous file with comments | « no previous file | mojo/services/html_viewer/html_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698