[go: nahoru, domu]

blob: fa09a5782eb9004ff6ba8461ef1b350e0f0420e8 [file] [log] [blame]
Avi Drissmane4622aa2022-09-08 20:36:061// Copyright 2012 The Chromium Authors
michaelbai@google.comf7d69972011-06-21 22:34:502// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
brettw@chromium.orge3177dd52014-08-13 20:22:145#include "base/files/file_util.h"
michaelbai@google.comf7d69972011-06-21 22:34:506
Min Qin981017b2022-01-27 21:49:357#include "base/android/jni_android.h"
8#include "base/android/jni_string.h"
Andrew Grieve1c7dbda2023-05-26 15:34:559#include "base/base_jni/FileUtils_jni.h"
brettw@chromium.org57999812013-02-24 05:40:5210#include "base/files/file_path.h"
nileshagrawal@chromium.org0eae7eb2012-05-17 20:09:0611#include "base/path_service.h"
michaelbai@google.comf7d69972011-06-21 22:34:5012
Min Qin981017b2022-01-27 21:49:3513using base::android::JavaParamRef;
14using base::android::JavaRef;
15using base::android::ScopedJavaLocalRef;
16
brettw@chromium.orgfb4bcfa32013-12-02 18:55:4917namespace base {
Min Qin981017b2022-01-27 21:49:3518namespace android {
19
20static ScopedJavaLocalRef<jstring> JNI_FileUtils_GetAbsoluteFilePath(
21 JNIEnv* env,
22 const JavaParamRef<jstring>& j_file_path) {
23 base::FilePath file_path(
24 base::android::ConvertJavaStringToUTF8(env, j_file_path));
25 base::FilePath absolute_file_path = MakeAbsoluteFilePath(file_path);
26 return base::android::ConvertUTF8ToJavaString(env,
27 absolute_file_path.value());
28}
29
30} // namespace android
michaelbai@google.comf7d69972011-06-21 22:34:5031
brettw@chromium.orgfb4bcfa32013-12-02 18:55:4932bool GetShmemTempDir(bool executable, base::FilePath* path) {
nileshagrawal@chromium.org0eae7eb2012-05-17 20:09:0633 return PathService::Get(base::DIR_CACHE, path);
michaelbai@google.comf7d69972011-06-21 22:34:5034}
35
brettw@chromium.orgfb4bcfa32013-12-02 18:55:4936} // namespace base