Index: mojo/shell/desktop/mojo_main.cc |
diff --git a/mojo/shell/desktop/mojo_main.cc b/mojo/shell/desktop/mojo_main.cc |
index 185fb5dee0534302c5290736345d3a0072fb10d6..7d57e89d98b1ec0207119863d94824a7fa0f352d 100644 |
--- a/mojo/shell/desktop/mojo_main.cc |
+++ b/mojo/shell/desktop/mojo_main.cc |
@@ -16,14 +16,10 @@ |
namespace { |
-void RunApps(mojo::shell::Context* context) { |
- const base::CommandLine& command_line = |
- *base::CommandLine::ForCurrentProcess(); |
- base::CommandLine::StringVector args = command_line.GetArgs(); |
- for (base::CommandLine::StringVector::const_iterator it = args.begin(); |
- it != args.end(); |
- ++it) { |
- context->Run(GURL(*it)); |
+void RunApps(mojo::shell::Context* context, std::vector<GURL> app_urls) { |
+ for (std::vector<GURL>::const_iterator it = app_urls.begin(); |
+ it != app_urls.end(); ++it) { |
+ context->Run(*it); |
} |
} |
@@ -47,9 +43,8 @@ |
*base::CommandLine::ForCurrentProcess())) { |
child_process->Main(); |
} else { |
-#if defined(COMPONENT_BUILD) |
gfx::GLSurface::InitializeOneOff(); |
-#endif |
+ |
// We want the shell::Context to outlive the MessageLoop so that pipes are |
// all gracefully closed / error-out before we try to shut the Context down. |
mojo::shell::Context shell_context; |
@@ -64,7 +59,17 @@ |
GURL(command_line.GetSwitchValueASCII(switches::kOrigin))); |
} |
- message_loop.PostTask(FROM_HERE, base::Bind(RunApps, &shell_context)); |
+ 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(RunApps, |
+ &shell_context, |
+ app_urls)); |
message_loop.Run(); |
} |
} |