Chromium Code Reviews| Index: mojo/shell/run.cc |
| diff --git a/mojo/shell/run.cc b/mojo/shell/run.cc |
| index a7c3f337f25ef5c028c00f63317c743e73a1a0fc..299a2489032e2d88dd4f9e64677ecb6b0ab45dae 100644 |
| --- a/mojo/shell/run.cc |
| +++ b/mojo/shell/run.cc |
| @@ -7,7 +7,7 @@ |
| #include "base/command_line.h" |
| #include "base/logging.h" |
| #include "base/message_loop/message_loop.h" |
| -#include "mojo/shell/app_container.h" |
| +#include "mojo/shell/service_manager.h" |
| #include "mojo/shell/switches.h" |
| #include "url/gurl.h" |
| @@ -16,16 +16,28 @@ namespace shell { |
| void Run(Context* context) { |
| const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| - if (!command_line.HasSwitch(switches::kApp)) { |
| + CommandLine::StringVector args = command_line.GetArgs(); |
| + |
| + if (args.size() == 0) { |
|
darin (slow to review)
2013/12/10 06:12:36
nit: "!args.empty()"
DaveMoore
2013/12/11 18:56:44
Done.
|
| LOG(ERROR) << "No app path specified."; |
| base::MessageLoop::current()->Quit(); |
| return; |
| } |
| - AppContainer* container = new AppContainer(context); |
| - container->Load(GURL(command_line.GetSwitchValueASCII(switches::kApp))); |
| - // TODO(abarth): Currently we leak |container|. |
| + if (!command_line.HasSwitch(switches::kOrigin)) { |
| + LOG(ERROR) << "--origin not specified."; |
| + base::MessageLoop::current()->Quit(); |
| + return; |
| + } |
| + |
| + ServiceManager* service_manager = new ServiceManager(context); |
| + for (CommandLine::StringVector::const_iterator it = args.begin(); |
| + it != args.end(); ++it) { |
| + ScopedMessagePipeHandle handle; |
|
darin (slow to review)
2013/12/10 06:12:36
nit: for readability, "handle" -> "no_handle" or "
|
| + service_manager->Connect(GURL(*it), handle.Pass()); |
| + } |
| + // TODO(davemoore): Currently we leak |service_manager|. |
| } |
| } // namespace shell |
| -} // namespace mojo |
| +} // namespace mojo |