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

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

Issue 7518032: Android's paths and message loop implementation with JNI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix dependence again. Created 9 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 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/path_utils.h"
6
7 #include "base/android/auto_jobject.h"
8 #include "base/android/jni_android.h"
9 #include "base/android/jni_string.h"
10
11 #include "jni/path_utils_jni.h"
12
13 namespace base {
14 namespace android {
15
16 std::string GetDataDirectory() {
17 JNIEnv* env = AttachCurrentThread();
18 AutoJObject path = AutoJObject::FromLocalRef(
19 env, Java_PathUtils_getDataDirectory(
20 env, base::android::GetApplicationContext()));
M-A Ruel 2011/11/11 13:09:07 Why specify base::android:: when you are already i
21 return base::android::ConvertJavaStringToUTF8(
22 env, static_cast<jstring>(path.obj()));
23 }
24
25 std::string GetCacheDirectory() {
26 JNIEnv* env = AttachCurrentThread();
27 AutoJObject path = AutoJObject::FromLocalRef(
28 env, Java_PathUtils_getCacheDirectory(
29 env, base::android::GetApplicationContext()));
30 return base::android::ConvertJavaStringToUTF8(
31 env, static_cast<jstring>(path.obj()));
32 }
33
34 bool RegisterPathUtils(JNIEnv* env) {
35 return RegisterNativesImpl(env);
36 }
37
38 } // namespace android
39 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698