Index: mojo/application/application_runner_chromium.cc |
diff --git a/mojo/application/application_runner_chromium.cc b/mojo/application/application_runner_chromium.cc |
index 069ff90e346b73affdf6a940c690ce63cb747a9e..e5f21caa20b9a19c5e604fdbca48496555e95b5a 100644 |
--- a/mojo/application/application_runner_chromium.cc |
+++ b/mojo/application/application_runner_chromium.cc |
@@ -13,6 +13,18 @@ |
#include "mojo/public/cpp/application/application_delegate.h" |
#include "mojo/public/cpp/application/application_impl.h" |
+int g_argc; |
+const char* const* g_argv; |
+#if !defined(OS_WIN) |
+extern "C" { |
+__attribute__((visibility("default"))) void InitCommandLineArgs( |
+ int argc, const char* const* argv) { |
+ g_argc = argc; |
+ g_argv = argv; |
+} |
+} |
+#endif |
+ |
namespace mojo { |
// static |
@@ -29,6 +41,10 @@ ApplicationRunnerChromium::ApplicationRunnerChromium( |
ApplicationRunnerChromium::~ApplicationRunnerChromium() {} |
+void ApplicationRunnerChromium::InitBaseCommandLine() { |
+ base::CommandLine::Init(g_argc, g_argv); |
+} |
+ |
void ApplicationRunnerChromium::set_message_loop_type( |
base::MessageLoop::Type type) { |
DCHECK_NE(base::MessageLoop::TYPE_CUSTOM, type); |
@@ -42,7 +58,7 @@ MojoResult ApplicationRunnerChromium::Run( |
DCHECK(!has_run_); |
has_run_ = true; |
- base::CommandLine::Init(0, NULL); |
+ InitBaseCommandLine(); |
base::AtExitManager at_exit; |
#ifndef NDEBUG |