зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #20177 - removed default_data_dir() and default_cache_dir() (from petre2dor:removeUnusedCode); r=jdm
<!-- Please describe your changes on the following line: --> I removed `default_data_dir()` and `default_cache_dir()` from `components/config/basedir.rs` because they were never called. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because they only remove untested code <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 0eb8b1f4c0736ec25dc391d119c03d1b49644d81 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 79de14ce6be480d377015a59a2d45dd99e7a5ef3
This commit is contained in:
Родитель
68615f1636
Коммит
c7fc85c6bd
|
@ -31,40 +31,6 @@ pub fn default_config_dir() -> PathBuf {
|
|||
PathBuf::from(dir.to_str().unwrap())
|
||||
}
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
|
||||
pub fn default_data_dir() -> Option<PathBuf> {
|
||||
let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap();
|
||||
let data_dir = xdg_dirs.get_data_home();
|
||||
Some(data_dir)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
#[allow(unsafe_code)]
|
||||
pub fn default_data_dir() -> Option<PathBuf> {
|
||||
let dir = unsafe {
|
||||
CStr::from_ptr((*android_injected_glue::get_app().activity).internalDataPath)
|
||||
};
|
||||
Some(PathBuf::from(dir.to_str().unwrap()))
|
||||
}
|
||||
|
||||
#[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
|
||||
pub fn default_cache_dir() -> Option<PathBuf> {
|
||||
let xdg_dirs = xdg::BaseDirectories::with_profile("servo", "default").unwrap();
|
||||
let cache_dir = xdg_dirs.get_cache_home();
|
||||
Some(cache_dir)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
#[allow(unsafe_code)]
|
||||
pub fn default_cache_dir() -> Option<PathBuf> {
|
||||
// TODO: Use JNI to call context.getCacheDir().
|
||||
// There is no equivalent function in NDK/NativeActivity.
|
||||
let dir = unsafe {
|
||||
CStr::from_ptr((*android_injected_glue::get_app().activity).externalDataPath)
|
||||
};
|
||||
Some(PathBuf::from(dir.to_str().unwrap()))
|
||||
}
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
pub fn default_config_dir() -> PathBuf {
|
||||
let mut config_dir = env::home_dir().unwrap();
|
||||
|
|
Загрузка…
Ссылка в новой задаче