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

Unified Diff: base/android/path_utils.cc

Issue 9443018: Upstream Android's PathUtils implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Patch Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: base/android/path_utils.cc
diff --git a/base/android/path_utils.cc b/base/android/path_utils.cc
index dc45c28da622dfbab06c0f3b49b35fff02dd6f71..b5888604b1464f45e9e0095dc3603a73c9ea1855 100644
--- a/base/android/path_utils.cc
+++ b/base/android/path_utils.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -15,16 +15,23 @@ namespace android {
std::string GetDataDirectory() {
JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jstring> path(env, Java_PathUtils_getDataDirectory(
- env, base::android::GetApplicationContext()));
- return base::android::ConvertJavaStringToUTF8(env, path.obj());
+ ScopedJavaLocalRef<jstring> path =
+ Java_PathUtils_getDataDirectory(env, GetApplicationContext());
+ return ConvertJavaStringToUTF8(path);
}
std::string GetCacheDirectory() {
JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jstring> path(env, Java_PathUtils_getCacheDirectory(
- env, base::android::GetApplicationContext()));
- return base::android::ConvertJavaStringToUTF8(env, path.obj());
+ ScopedJavaLocalRef<jstring> path =
+ Java_PathUtils_getCacheDirectory(env, GetApplicationContext());
+ return ConvertJavaStringToUTF8(path);
+}
+
+std::string GetDownloadsDirectory() {
+ JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jstring> path =
+ Java_PathUtils_getDownloadsDirectory(env, GetApplicationContext());
+ return ConvertJavaStringToUTF8(path);
}
bool RegisterPathUtils(JNIEnv* env) {
@@ -33,3 +40,4 @@ bool RegisterPathUtils(JNIEnv* env) {
} // namespace android
} // namespace base
+

Powered by Google App Engine
This is Rietveld 408576698