Commit 12550a7b authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Update PathProvideFuchsia to avoid blocking IO.

Previously GetPackageRoot() was calling base::FileExists(), which requires
blocking IO, i.e. it DCHECKs on some threads. Updated the logic used to
detect that the app is packaged to avoid blocking IO.

Bug: 796779, 778467
Change-Id: I3ae8f5fefea182295a7fda4ff40964f21ba63e5c
Reviewed-on: https://chromium-review.googlesource.com/876660
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarWez <wez@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#531308}
parent 77cc1c93
...@@ -21,7 +21,7 @@ constexpr char kPackageRoot[] = "/pkg"; ...@@ -21,7 +21,7 @@ constexpr char kPackageRoot[] = "/pkg";
base::FilePath GetPackageRoot() { base::FilePath GetPackageRoot() {
base::FilePath path_obj(kPackageRoot); base::FilePath path_obj(kPackageRoot);
if (PathExists(path_obj)) { if (path_obj.IsParent(base::CommandLine::ForCurrentProcess()->GetProgram())) {
return path_obj; return path_obj;
} else { } else {
return base::FilePath(); return base::FilePath();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment