Skip to content

Commit

Permalink
[Fuchsia] Remove package detection in base::PathProviderFuchsia()
Browse files Browse the repository at this point in the history
Previously PathProvider was trying to detect if it's packaged or not.
That logic is no longer needed because we can assume that all binaries
produced in chromium are packaged.

Change-Id: I963afac5342d44b8d8188c07ffb927d6b4fac271
Reviewed-on: https://chromium-review.googlesource.com/1134586
Commit-Queue: Sergey Ulanov <[email protected]>
Reviewed-by: Wez <[email protected]>
Cr-Original-Commit-Position: refs/heads/master@{#574684}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4f9d9e774d5d41a5d8073b156348eee4bde25753
  • Loading branch information
SergeyUlanov authored and Commit Bot committed Jul 12, 2018
1 parent 870355c commit f7885f6
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions base_paths_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,9 @@
#include "base/process/process.h"

namespace base {
namespace {

constexpr char kPackageRoot[] = "/pkg";

} // namespace

base::FilePath GetPackageRoot() {
base::FilePath path_obj(kPackageRoot);

// Fuchsia's appmgr will set argv[0] to a fully qualified executable path
// under /pkg for packaged binaries.
if (path_obj.IsParent(base::CommandLine::ForCurrentProcess()->GetProgram())) {
return path_obj;
} else {
return base::FilePath();
}
return base::FilePath("/pkg");
}

bool PathProviderFuchsia(int key, FilePath* result) {
Expand All @@ -39,9 +26,6 @@ bool PathProviderFuchsia(int key, FilePath* result) {
case FILE_EXE:
*result = CommandLine::ForCurrentProcess()->GetProgram();
return true;
case DIR_SOURCE_ROOT:
*result = GetPackageRoot();
return true;
case DIR_APP_DATA:
// TODO(https://crbug.com/840598): Switch to /data when minfs supports
// mmap().
Expand All @@ -53,6 +37,7 @@ bool PathProviderFuchsia(int key, FilePath* result) {
*result = FilePath("/data");
return true;
case DIR_ASSETS:
case DIR_SOURCE_ROOT:
*result = GetPackageRoot();
return true;
}
Expand Down

0 comments on commit f7885f6

Please sign in to comment.