Chromium Code Reviews| Index: mojo/shell/desktop/mojo_main.cc |
| diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc |
| index 938b95e85a28de08c766f048090989c5392cf3f4..f24a48153ec10a0251408de0d7e99fc1a331f73c 100644 |
| --- a/mojo/shell/desktop/mojo_main.cc |
| +++ b/mojo/shell/desktop/mojo_main.cc |
| @@ -27,30 +27,31 @@ int main(int argc, char** argv) { |
| } else { |
| gfx::GLSurface::InitializeOneOff(); |
| - base::MessageLoop message_loop; |
| mojo::shell::Context shell_context; |
|
darin (slow to review)
2014/07/28 23:02:13
nit: add a comment here?
tim (not reviewing)
2014/07/29 00:54:57
Done.
|
| - |
| - const base::CommandLine& command_line = |
| - *base::CommandLine::ForCurrentProcess(); |
| - if (command_line.HasSwitch(switches::kOrigin)) { |
| - shell_context.mojo_url_resolver()->SetBaseURL( |
| - GURL(command_line.GetSwitchValueASCII(switches::kOrigin))); |
| + { |
| + base::MessageLoop message_loop; |
| + shell_context.Init(); |
| + |
| + const base::CommandLine& command_line = |
| + *base::CommandLine::ForCurrentProcess(); |
| + if (command_line.HasSwitch(switches::kOrigin)) { |
| + shell_context.mojo_url_resolver()->SetBaseURL( |
| + GURL(command_line.GetSwitchValueASCII(switches::kOrigin))); |
| + } |
| + |
| + std::vector<GURL> app_urls; |
| + base::CommandLine::StringVector args = command_line.GetArgs(); |
| + for (base::CommandLine::StringVector::const_iterator it = args.begin(); |
| + it != args.end(); |
| + ++it) |
| + app_urls.push_back(GURL(*it)); |
| + |
| + message_loop.PostTask(FROM_HERE, |
| + base::Bind(mojo::shell::Run, |
| + &shell_context, |
| + app_urls)); |
| + message_loop.Run(); |
| } |
| - |
| - std::vector<GURL> app_urls; |
| - base::CommandLine::StringVector args = command_line.GetArgs(); |
| - for (base::CommandLine::StringVector::const_iterator it = args.begin(); |
| - it != args.end(); |
| - ++it) |
| - app_urls.push_back(GURL(*it)); |
| - |
| - message_loop.PostTask(FROM_HERE, |
| - base::Bind(mojo::shell::Run, |
| - &shell_context, |
| - app_urls)); |
| - |
| - message_loop.Run(); |
| } |
| - |
| return 0; |
| } |