blob: fe12f3617a3edf225544ff819753f8d29fc9dfc4 [file] [log] [blame]
scottmg1ab7aa82017-05-25 05:22:491// 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 Marshallfe2f08c2017-08-25 21:45:297#include <stdlib.h>
8
Kevin Marshallf35fa5f2018-01-29 19:24:429#include "base/base_paths_fuchsia.h"
Kevin Marshallfe2f08c2017-08-25 21:45:2910#include "base/command_line.h"
Kevin Marshallf35fa5f2018-01-29 19:24:4211#include "base/files/file_util.h"
Sergey Ulanov278b19f2019-03-12 00:19:5912#include "base/fuchsia/file_utils.h"
Kevin Marshallf35fa5f2018-01-29 19:24:4213#include "base/path_service.h"
14#include "base/process/process.h"
scottmg1ab7aa82017-05-25 05:22:4915
16namespace base {
Kevin Marshallf35fa5f2018-01-29 19:24:4217
scottmg1ab7aa82017-05-25 05:22:4918bool PathProviderFuchsia(int key, FilePath* result) {
19 switch (key) {
Scott Graham4bd2b07f2017-06-01 04:17:0420 case FILE_MODULE:
Scott Graham5f99da02019-03-22 17:46:3321 NOTIMPLEMENTED_LOG_ONCE() << " for FILE_MODULE.";
Kevin Marshallf35fa5f2018-01-29 19:24:4222 return false;
Sergey Ulanov5d0a54c2018-05-11 18:07:4423 case FILE_EXE:
24 *result = CommandLine::ForCurrentProcess()->GetProgram();
Scott Graham4bd2b07f2017-06-01 04:17:0425 return true;
Kevin Marshallec64321f2018-05-22 03:17:4126 case DIR_APP_DATA:
Scott Graham4bd2b07f2017-06-01 04:17:0427 case DIR_CACHE:
Sergey Ulanov278b19f2019-03-12 00:19:5928 *result = base::FilePath(base::fuchsia::kPersistedDataDirectoryPath);
Scott Graham4bd2b07f2017-06-01 04:17:0429 return true;
Sergey Ulanovd5ae68e2018-02-07 20:14:2130 case DIR_ASSETS:
Sergey Ulanov4f9d9e772018-07-12 19:48:2431 case DIR_SOURCE_ROOT:
Sergey Ulanov278b19f2019-03-12 00:19:5932 *result = base::FilePath(base::fuchsia::kPackageRootDirectoryPath);
Kevin Marshallf35fa5f2018-01-29 19:24:4233 return true;
scottmg1ab7aa82017-05-25 05:22:4934 }
scottmg1ab7aa82017-05-25 05:22:4935 return false;
36}
37
38} // namespace base