| 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/runner/android/main.h" | 5 #include "mojo/runner/android/main.h" |
| 6 | 6 |
| 7 #include "base/android/fifo_utils.h" | 7 #include "base/android/fifo_utils.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/android/jni_array.h" | 9 #include "base/android/jni_array.h" |
| 10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 const JavaParamRef<jstring>& j_tmp_dir) { | 107 const JavaParamRef<jstring>& j_tmp_dir) { |
| 108 g_main_activiy.Get().Reset(env, activity); | 108 g_main_activiy.Get().Reset(env, activity); |
| 109 | 109 |
| 110 // Setting the TMPDIR environment variable so that applications can use it. | 110 // Setting the TMPDIR environment variable so that applications can use it. |
| 111 // TODO(qsr) We will need our subprocesses to inherit this. | 111 // TODO(qsr) We will need our subprocesses to inherit this. |
| 112 int return_value = | 112 int return_value = |
| 113 setenv("TMPDIR", | 113 setenv("TMPDIR", |
| 114 base::android::ConvertJavaStringToUTF8(env, j_tmp_dir).c_str(), 1); | 114 base::android::ConvertJavaStringToUTF8(env, j_tmp_dir).c_str(), 1); |
| 115 DCHECK_EQ(return_value, 0); | 115 DCHECK_EQ(return_value, 0); |
| 116 | 116 |
| 117 base::android::ScopedJavaLocalRef<jobject> scoped_activity(env, activity); | 117 base::android::InitApplicationContext(env, activity); |
| 118 base::android::InitApplicationContext(env, scoped_activity); | |
| 119 | 118 |
| 120 std::vector<std::string> parameters; | 119 std::vector<std::string> parameters; |
| 121 parameters.push_back( | 120 parameters.push_back( |
| 122 base::android::ConvertJavaStringToUTF8(env, mojo_shell_path)); | 121 base::android::ConvertJavaStringToUTF8(env, mojo_shell_path)); |
| 123 base::android::AppendJavaStringArrayToStringVector(env, jparameters, | 122 base::android::AppendJavaStringArrayToStringVector(env, jparameters, |
| 124 ¶meters); | 123 ¶meters); |
| 125 base::CommandLine::Init(0, nullptr); | 124 base::CommandLine::Init(0, nullptr); |
| 126 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); | 125 base::CommandLine::ForCurrentProcess()->InitFromArgv(parameters); |
| 127 | 126 |
| 128 InitializeLogging(); | 127 InitializeLogging(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 base::AtExitManager at_exit; | 187 base::AtExitManager at_exit; |
| 189 base::CommandLine::Init(argc, argv); | 188 base::CommandLine::Init(argc, argv); |
| 190 | 189 |
| 191 #if !defined(OFFICIAL_BUILD) | 190 #if !defined(OFFICIAL_BUILD) |
| 192 base::debug::EnableInProcessStackDumping(); | 191 base::debug::EnableInProcessStackDumping(); |
| 193 #endif | 192 #endif |
| 194 | 193 |
| 195 mojo::runner::InitializeLogging(); | 194 mojo::runner::InitializeLogging(); |
| 196 return mojo::runner::ChildProcessMain(); | 195 return mojo::runner::ChildProcessMain(); |
| 197 } | 196 } |
| OLD | NEW |