servo: Merge #20177 - removed default_data_dir() and default_cache_dir() (from petre2dor:removeUnusedCode); r=jdm
authorPetre Tudor <petre.tudor@protonmail.com>
Fri, 02 Mar 2018 15:58:04 -0500
changeset 461426 5da62e6df5f36c7b3669f7f751d9af63c4697224
parent 461425 2d3065417d04bec4d600f506d3e8169485314586
child 461439 20d25c640db36e64dfd70eb7db293870e7f3087a
push id1683
push usersfraser@mozilla.com
push dateThu, 26 Apr 2018 16:43:40 +0000
treeherdermozilla-release@5af6cb21869d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs20177
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
servo/components/config/basedir.rs
--- a/servo/components/config/basedir.rs
+++ b/servo/components/config/basedir.rs
@@ -26,50 +26,16 @@ pub fn default_config_dir() -> PathBuf {
 #[allow(unsafe_code)]
 pub fn default_config_dir() -> PathBuf {
     let dir = unsafe {
         CStr::from_ptr((*android_injected_glue::get_app().activity).externalDataPath)
     };
     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();
     config_dir.push("Library");
     config_dir.push("Application Support");
     config_dir.push("Servo");
     config_dir
 }