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

Unified Diff: base/android/path_utils.cc

Issue 11031008: Upstreaming chrome/common/chrome_* diff. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing Nishel's nits Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/path_utils.h ('k') | base/android/path_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/path_utils.cc
diff --git a/base/android/path_utils.cc b/base/android/path_utils.cc
index 1e8d1e8308828c74dffb1592a019da5313c2691d..3d86177bfa072b16dfcb62489b51c4a0a0787100 100644
--- a/base/android/path_utils.cc
+++ b/base/android/path_utils.cc
@@ -7,45 +7,56 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/android/scoped_java_ref.h"
+#include "base/file_path.h"
#include "jni/PathUtils_jni.h"
namespace base {
namespace android {
-std::string GetDataDirectory() {
+bool GetDataDirectory(FilePath* result) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> path =
Java_PathUtils_getDataDirectory(env, GetApplicationContext());
- return ConvertJavaStringToUTF8(path);
+ FilePath data_path(ConvertJavaStringToUTF8(path));
+ *result = data_path;
+ return true;
}
-std::string GetCacheDirectory() {
+bool GetCacheDirectory(FilePath* result) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> path =
Java_PathUtils_getCacheDirectory(env, GetApplicationContext());
- return ConvertJavaStringToUTF8(path);
+ FilePath cache_path(ConvertJavaStringToUTF8(path));
+ *result = cache_path;
+ return true;
}
-std::string GetDownloadsDirectory() {
+bool GetDownloadsDirectory(FilePath* result) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> path =
Java_PathUtils_getDownloadsDirectory(env, GetApplicationContext());
- return ConvertJavaStringToUTF8(path);
+ FilePath downloads_path(ConvertJavaStringToUTF8(path));
+ *result = downloads_path;
+ return true;
}
-std::string GetNativeLibraryDirectory() {
+bool GetNativeLibraryDirectory(FilePath* result) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> path =
Java_PathUtils_getNativeLibraryDirectory(env, GetApplicationContext());
- return ConvertJavaStringToUTF8(path);
+ FilePath library_path(ConvertJavaStringToUTF8(path));
+ *result = library_path;
+ return true;
}
-std::string GetExternalStorageDirectory() {
+bool GetExternalStorageDirectory(FilePath* result) {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jstring> path =
Java_PathUtils_getExternalStorageDirectory(env);
- return ConvertJavaStringToUTF8(path);
+ FilePath storage_path(ConvertJavaStringToUTF8(path));
+ *result = storage_path;
+ return true;
}
bool RegisterPathUtils(JNIEnv* env) {
« no previous file with comments | « base/android/path_utils.h ('k') | base/android/path_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698