| 6 |
| 7 | #include <stdlib.h> |
| 8 |
| 9 | #include "base/base_paths_fuchsia.h" |
| 10 | #include "base/command_line.h" |
| 11 | #include "base/files/file_util.h" |
| 12 | #include "base/fuchsia/file_utils.h" |
| 13 | #include "base/path_service.h" |
| 14 | #include "base/process/process.h" |
| 15 |
| 16 | namespace base { |
| 17 |
| 18 | bool PathProviderFuchsia(int key, FilePath* result) { |
| 19 | switch (key) { |
| 20 | case FILE_MODULE: |
| 21 | NOTIMPLEMENTED_LOG_ONCE() << " for FILE_MODULE."; |
| 22 | return false; |
| 23 | case FILE_EXE: |
| 24 | *result = CommandLine::ForCurrentProcess()->GetProgram(); |
| 25 | return true; |
| 26 | case DIR_APP_DATA: |
| 27 | case DIR_CACHE: |
| 28 | *result = base::FilePath(base::fuchsia::kPersistedDataDirectoryPath); |
| 29 | return true; |
| 30 | case DIR_ASSETS: |
| 31 | case DIR_SOURCE_ROOT: |
| 32 | *result = base::FilePath(base::fuchsia::kPackageRootDirectoryPath); |
| 33 | return true; |
| 34 | } |
| 35 | return false; |
| 36 | } |
| 37 |
| 38 | } // namespace base |
| 39 |