[go: nahoru, domu]

blob: ca068ca9ed85dca0d9e5b6fe575c4aa8fe9f7f5f [file] [log] [blame]
nileshagrawal@chromium.org0eae7eb2012-05-17 20:09:061// Copyright (c) 2012 The Chromium Authors. All rights reserved.
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"
9#include "base/base_jni_headers/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