| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "mojo/public/cpp/environment/environment.h" | |
| 11 #include "mojo/shell/child_process.h" | 10 #include "mojo/shell/child_process.h" |
| 12 #include "mojo/shell/context.h" | 11 #include "mojo/shell/context.h" |
| 13 #include "mojo/shell/init.h" | 12 #include "mojo/shell/init.h" |
| 14 #include "mojo/shell/run.h" | 13 #include "mojo/shell/run.h" |
| 15 #include "mojo/shell/switches.h" | 14 #include "mojo/shell/switches.h" |
| 16 #include "ui/gl/gl_surface.h" | 15 #include "ui/gl/gl_surface.h" |
| 17 | 16 |
| 18 int main(int argc, char** argv) { | 17 int main(int argc, char** argv) { |
| 19 base::AtExitManager at_exit; | 18 base::AtExitManager at_exit; |
| 20 mojo::Environment env; | |
| 21 base::CommandLine::Init(argc, argv); | 19 base::CommandLine::Init(argc, argv); |
| 22 mojo::shell::InitializeLogging(); | 20 mojo::shell::InitializeLogging(); |
| 23 | 21 |
| 24 // TODO(vtl): Unify parent and child process cases to the extent possible. | 22 // TODO(vtl): Unify parent and child process cases to the extent possible. |
| 25 if (scoped_ptr<mojo::shell::ChildProcess> child_process = | 23 if (scoped_ptr<mojo::shell::ChildProcess> child_process = |
| 26 mojo::shell::ChildProcess::Create( | 24 mojo::shell::ChildProcess::Create( |
| 27 *base::CommandLine::ForCurrentProcess())) { | 25 *base::CommandLine::ForCurrentProcess())) { |
| 28 child_process->Main(); | 26 child_process->Main(); |
| 29 } else { | 27 } else { |
| 30 gfx::GLSurface::InitializeOneOff(); | 28 gfx::GLSurface::InitializeOneOff(); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 message_loop.PostTask(FROM_HERE, | 47 message_loop.PostTask(FROM_HERE, |
| 50 base::Bind(mojo::shell::Run, | 48 base::Bind(mojo::shell::Run, |
| 51 &shell_context, | 49 &shell_context, |
| 52 app_urls)); | 50 app_urls)); |
| 53 | 51 |
| 54 message_loop.Run(); | 52 message_loop.Run(); |
| 55 } | 53 } |
| 56 | 54 |
| 57 return 0; | 55 return 0; |
| 58 } | 56 } |
| OLD | NEW |