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

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

Issue 23964011: Reuse webview classic cookies file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fix Created 7 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 | « base/android/path_utils.h ('k') | chrome/browser/profiles/profile_impl_io_data.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/android/path_utils.h" 5 #include "base/android/path_utils.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
11 11
12 #include "jni/PathUtils_jni.h" 12 #include "jni/PathUtils_jni.h"
13 13
14 namespace base { 14 namespace base {
15 namespace android { 15 namespace android {
16 16
17 bool GetDataDirectory(FilePath* result) { 17 bool GetDataDirectory(FilePath* result) {
18 JNIEnv* env = AttachCurrentThread(); 18 JNIEnv* env = AttachCurrentThread();
19 ScopedJavaLocalRef<jstring> path = 19 ScopedJavaLocalRef<jstring> path =
20 Java_PathUtils_getDataDirectory(env, GetApplicationContext()); 20 Java_PathUtils_getDataDirectory(env, GetApplicationContext());
21 FilePath data_path(ConvertJavaStringToUTF8(path)); 21 FilePath data_path(ConvertJavaStringToUTF8(path));
22 *result = data_path; 22 *result = data_path;
23 return true; 23 return true;
24 } 24 }
25 25
26 bool GetDatabaseDirectory(FilePath* result) {
27 JNIEnv* env = AttachCurrentThread();
28 ScopedJavaLocalRef<jstring> path =
29 Java_PathUtils_getDatabaseDirectory(env, GetApplicationContext());
30 FilePath data_path(ConvertJavaStringToUTF8(path));
31 *result = data_path;
32 return true;
33 }
34
26 bool GetCacheDirectory(FilePath* result) { 35 bool GetCacheDirectory(FilePath* result) {
27 JNIEnv* env = AttachCurrentThread(); 36 JNIEnv* env = AttachCurrentThread();
28 ScopedJavaLocalRef<jstring> path = 37 ScopedJavaLocalRef<jstring> path =
29 Java_PathUtils_getCacheDirectory(env, GetApplicationContext()); 38 Java_PathUtils_getCacheDirectory(env, GetApplicationContext());
30 FilePath cache_path(ConvertJavaStringToUTF8(path)); 39 FilePath cache_path(ConvertJavaStringToUTF8(path));
31 *result = cache_path; 40 *result = cache_path;
32 return true; 41 return true;
33 } 42 }
34 43
35 bool GetDownloadsDirectory(FilePath* result) { 44 bool GetDownloadsDirectory(FilePath* result) {
(...skipping 22 matching lines...) Expand all
58 *result = storage_path; 67 *result = storage_path;
59 return true; 68 return true;
60 } 69 }
61 70
62 bool RegisterPathUtils(JNIEnv* env) { 71 bool RegisterPathUtils(JNIEnv* env) {
63 return RegisterNativesImpl(env); 72 return RegisterNativesImpl(env);
64 } 73 }
65 74
66 } // namespace android 75 } // namespace android
67 } // namespace base 76 } // namespace base
OLDNEW
« no previous file with comments | « base/android/path_utils.h ('k') | chrome/browser/profiles/profile_impl_io_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698