| 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 "mojo/shell/run.h" | 5 #include "mojo/shell/run.h" |
| 6 | 6 |
| 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 "mojo/shell/app_container.h" | 10 #include "mojo/shell/app_container.h" |
| 10 #include "mojo/shell/switches.h" | 11 #include "mojo/shell/switches.h" |
| 11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 namespace mojo { | 14 namespace mojo { |
| 14 namespace shell { | 15 namespace shell { |
| 15 | 16 |
| 16 void Run(Context* context) { | 17 void Run(Context* context) { |
| 17 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 18 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 18 if (!command_line.HasSwitch(switches::kApp)) { | 19 if (!command_line.HasSwitch(switches::kApp)) { |
| 19 LOG(ERROR) << "No app path specified."; | 20 LOG(ERROR) << "No app path specified."; |
| 21 base::MessageLoop::current()->Quit(); |
| 20 return; | 22 return; |
| 21 } | 23 } |
| 22 | 24 |
| 23 AppContainer* container = new AppContainer(context); | 25 AppContainer* container = new AppContainer(context); |
| 24 container->Load(GURL(command_line.GetSwitchValueASCII(switches::kApp))); | 26 container->Load(GURL(command_line.GetSwitchValueASCII(switches::kApp))); |
| 25 // TODO(abarth): Currently we leak |container|. | 27 // TODO(abarth): Currently we leak |container|. |
| 26 } | 28 } |
| 27 | 29 |
| 28 } // namespace shell | 30 } // namespace shell |
| 29 } // namespace mojo | 31 } // namespace mojo |
| OLD | NEW |