Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: mojo/runner/android/main.cc

Issue 1326763009: jni: Forbid inappropriate JNI parameter conversions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix GN-only mojo, and chromecast Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/android/javatests/mojo_test_case.cc ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 &parameters); 123 &parameters);
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
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 }
OLDNEW
« no previous file with comments | « mojo/android/javatests/mojo_test_case.cc ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698