Upload upstream chromium 94.0.4606.31
[platform/framework/web/chromium-efl.git] / base / base_paths_fuchsia.cc
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
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/notreached.h"
14 #include "base/path_service.h"
15 #include "base/process/process.h"
16
17 namespace base {
18
19 bool PathProviderFuchsia(int key, FilePath* result) {
20   switch (key) {
21     case FILE_MODULE:
22       NOTIMPLEMENTED_LOG_ONCE() << " for FILE_MODULE.";
23       return false;
24     case FILE_EXE:
25       *result = CommandLine::ForCurrentProcess()->GetProgram();
26       return true;
27     case DIR_APP_DATA:
28     case DIR_CACHE:
29       *result = base::FilePath(base::kPersistedDataDirectoryPath);
30       return true;
31     case DIR_ASSETS:
32     case DIR_SOURCE_ROOT:
33       *result = base::FilePath(base::kPackageRootDirectoryPath);
34       return true;
35   }
36   return false;
37 }
38
39 }  // namespace base