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

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

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

Powered by Google App Engine
This is Rietveld 408576698