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

Side by Side Diff: base/android/java_system.cc

Issue 1294883002: Revert of [Android] Add a java.lang.System wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « base/android/java_system.h ('k') | base/base.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/android/java_system.h"
6
7 #include "base/android/jni_string.h"
8 #include "jni/System_jni.h"
9
10 namespace base {
11 namespace android {
12
13 bool JavaSystem::Register(JNIEnv* env) {
14 return JNI_System::RegisterNativesImpl(env);
15 }
16
17 // static
18 std::string JavaSystem::GetProperty(const base::StringPiece& property_name) {
19 DCHECK(!property_name.empty());
20 JNIEnv* env = AttachCurrentThread();
21 ScopedJavaLocalRef<jstring> jproperty_name =
22 ConvertUTF8ToJavaString(env, property_name);
23 ScopedJavaLocalRef<jstring> jproperty =
24 JNI_System::Java_System_getPropertyJLS_JLS(env, jproperty_name.obj());
25 return jproperty.is_null() ? std::string()
26 : ConvertJavaStringToUTF8(env, jproperty.obj());
27 }
28
29 } // namespace android
30 } // namespace base
OLDNEW
« no previous file with comments | « base/android/java_system.h ('k') | base/base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698