scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors. All rights reserved. |
2 | // Use of this source code is governed by a BSD-style license that can be | ||||
3 | // found in the LICENSE file. | ||||
4 | |||||
5 | #include "base/base_paths.h" | ||||
6 | |||||
Kevin Marshall | fe2f08c | 2017-08-25 21:45:29 | [diff] [blame] | 7 | #include <stdlib.h> |
8 | |||||
Kevin Marshall | f35fa5f | 2018-01-29 19:24:42 | [diff] [blame] | 9 | #include "base/base_paths_fuchsia.h" |
Kevin Marshall | fe2f08c | 2017-08-25 21:45:29 | [diff] [blame] | 10 | #include "base/command_line.h" |
Kevin Marshall | f35fa5f | 2018-01-29 19:24:42 | [diff] [blame] | 11 | #include "base/files/file_util.h" |
Sergey Ulanov | 278b19f | 2019-03-12 00:19:59 | [diff] [blame] | 12 | #include "base/fuchsia/file_utils.h" |
Kevin Marshall | f35fa5f | 2018-01-29 19:24:42 | [diff] [blame] | 13 | #include "base/path_service.h" |
14 | #include "base/process/process.h" | ||||
scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 15 | |
16 | namespace base { | ||||
Kevin Marshall | f35fa5f | 2018-01-29 19:24:42 | [diff] [blame] | 17 | |
scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 18 | bool PathProviderFuchsia(int key, FilePath* result) { |
19 | switch (key) { | ||||
Scott Graham | 4bd2b07f | 2017-06-01 04:17:04 | [diff] [blame] | 20 | case FILE_MODULE: |
Scott Graham | 5f99da0 | 2019-03-22 17:46:33 | [diff] [blame] | 21 | NOTIMPLEMENTED_LOG_ONCE() << " for FILE_MODULE."; |
Kevin Marshall | f35fa5f | 2018-01-29 19:24:42 | [diff] [blame] | 22 | return false; |
Sergey Ulanov | 5d0a54c | 2018-05-11 18:07:44 | [diff] [blame] | 23 | case FILE_EXE: |
24 | *result = CommandLine::ForCurrentProcess()->GetProgram(); | ||||
Scott Graham | 4bd2b07f | 2017-06-01 04:17:04 | [diff] [blame] | 25 | return true; |
Kevin Marshall | ec64321f | 2018-05-22 03:17:41 | [diff] [blame] | 26 | case DIR_APP_DATA: |
Scott Graham | 4bd2b07f | 2017-06-01 04:17:04 | [diff] [blame] | 27 | case DIR_CACHE: |
Sergey Ulanov | 278b19f | 2019-03-12 00:19:59 | [diff] [blame] | 28 | *result = base::FilePath(base::fuchsia::kPersistedDataDirectoryPath); |
Scott Graham | 4bd2b07f | 2017-06-01 04:17:04 | [diff] [blame] | 29 | return true; |
Sergey Ulanov | d5ae68e | 2018-02-07 20:14:21 | [diff] [blame] | 30 | case DIR_ASSETS: |
Sergey Ulanov | 4f9d9e77 | 2018-07-12 19:48:24 | [diff] [blame] | 31 | case DIR_SOURCE_ROOT: |
Sergey Ulanov | 278b19f | 2019-03-12 00:19:59 | [diff] [blame] | 32 | *result = base::FilePath(base::fuchsia::kPackageRootDirectoryPath); |
Kevin Marshall | f35fa5f | 2018-01-29 19:24:42 | [diff] [blame] | 33 | return true; |
scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 34 | } |
scottmg | 1ab7aa8 | 2017-05-25 05:22:49 | [diff] [blame] | 35 | return false; |
36 | } | ||||
37 | |||||
38 | } // namespace base |