Skip to content

Commit

Permalink
[fuchsia] Remove DIR_MODULE & FILE_MODULE from cross-platform code.
Browse files Browse the repository at this point in the history
Also, do not define these keys on Fuchsia as the module location is not
useful and there is no legitimate use in obtaining it.

Bug: 1263691, 1184980, 1262430
Change-Id: I856b6dbf79312006b96ce2714d999cef7059b454
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3188614
Commit-Queue: Mason Bendixen <masonben@chromium.org>
Auto-Submit: Mason Bendixen <masonben@chromium.org>
Reviewed-by: David Dorwin <ddorwin@chromium.org>
Reviewed-by: Michael Spang <spang@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Peter Kvitek <kvitekp@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944621}
  • Loading branch information
Mason Bendixen authored and Chromium LUCI CQ committed Nov 23, 2021
1 parent f400fcd commit d798600
Show file tree
Hide file tree
Showing 35 changed files with 88 additions and 47 deletions.
2 changes: 1 addition & 1 deletion ash/keyboard/ui/resources/keyboard_resource_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void InitializeKeyboardResources() {
initialized = true;

base::FilePath pak_dir;
base::PathService::Get(base::DIR_MODULE, &pak_dir);
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
base::FilePath pak_file =
pak_dir.Append(FILE_PATH_LITERAL("keyboard_resources.pak"));
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(pak_file,
Expand Down
2 changes: 1 addition & 1 deletion ash/test/ash_test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void AshTestSuite::Initialize() {

// Load ash test resources and en-US strings; not 'common' (Chrome) resources.
base::FilePath path;
base::PathService::Get(base::DIR_MODULE, &path);
base::PathService::Get(base::DIR_ASSETS, &path);
base::FilePath ash_test_strings =
path.Append(FILE_PATH_LITERAL("ash_test_strings.pak"));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ash_test_strings);
Expand Down
6 changes: 3 additions & 3 deletions ash/webui/ash_webui_test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ void InitI18n() {
ASSERT_TRUE(base::PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);

base::FilePath dir_module_path;
ASSERT_TRUE(base::PathService::Get(base::DIR_MODULE, &dir_module_path));
base::FilePath dir_assets_path;
ASSERT_TRUE(base::PathService::Get(base::DIR_ASSETS, &dir_assets_path));
base::FilePath chromeos_test_strings_path =
dir_module_path.Append(FILE_PATH_LITERAL("chromeos_test_strings.pak"));
dir_assets_path.Append(FILE_PATH_LITERAL("chromeos_test_strings.pak"));
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
chromeos_test_strings_path, ui::kScaleFactorNone);
}
Expand Down
4 changes: 4 additions & 0 deletions base/base_paths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,26 @@ bool PathProvider(int key, FilePath* result) {
return false;
*result = result->DirName();
return true;
#if !defined(OS_FUCHSIA)
case DIR_MODULE:
if (!PathService::Get(FILE_MODULE, result))
return false;
*result = result->DirName();
return true;
case DIR_ASSETS:
return PathService::Get(DIR_MODULE, result);
#endif // !defined(OS_FUCHSIA)
case DIR_TEMP:
return GetTempDir(result);
case DIR_HOME:
*result = GetHomeDir();
return true;
case DIR_GEN_TEST_DATA_ROOT:
#if !defined(OS_FUCHSIA)
// On most platforms, all build output is in the same directory, so
// use DIR_MODULE to get the path to the current binary.
return PathService::Get(DIR_MODULE, result);
#endif // !defined(OS_FUCHSIA)
case DIR_TEST_DATA: {
FilePath test_data_path;
if (!PathService::Get(DIR_SRC_TEST_DATA_ROOT, &test_data_path))
Expand Down
20 changes: 16 additions & 4 deletions base/base_paths.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,26 @@ enum BasePathKey {
PATH_START = 0,

// The following refer to the current application.
FILE_EXE, // Path and filename of the current executable.
FILE_EXE, // Path and filename of the current executable.
#if !defined(OS_FUCHSIA)
// Prefer keys (e.g., DIR_ASSETS) that are specific to the use case as the
// module location may not work as expected on some platforms. For this
// reason, this key is not defined on Fuchsia. See crbug.com/1263691 for
// details.
FILE_MODULE, // Path and filename of the module containing the code for
// the PathService (which could differ from FILE_EXE if the
// PathService were compiled into a shared object, for
// example).
DIR_EXE, // Directory containing FILE_EXE.
DIR_MODULE, // Directory containing FILE_MODULE.
DIR_ASSETS, // Directory that contains application assets.
#endif
DIR_EXE, // Directory containing FILE_EXE.
#if !defined(OS_FUCHSIA)
// Prefer keys (e.g., DIR_ASSETS) that are specific to the use case as the
// module location may not work as expected on some platforms. For this
// reason, this key is not defined on Fuchsia. See crbug.com/1263691 for
// details.
DIR_MODULE, // Directory containing FILE_MODULE.
#endif
DIR_ASSETS, // Directory that contains application assets.

// The following refer to system and system user directories.
DIR_TEMP, // Temporary directory for the system and/or user.
Expand Down
3 changes: 0 additions & 3 deletions base/base_paths_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ namespace base {

bool PathProviderFuchsia(int key, FilePath* result) {
switch (key) {
case FILE_MODULE:
NOTIMPLEMENTED_LOG_ONCE() << " for FILE_MODULE.";
return false;
case FILE_EXE:
*result = CommandLine::ForCurrentProcess()->GetProgram();
return true;
Expand Down
4 changes: 1 addition & 3 deletions base/path_service_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ TEST_F(PathServiceTest, Get) {
#elif defined(OS_FUCHSIA)
constexpr std::array<int, 3> kUnsupportedKeys = {
// TODO(crbug.com/1231928): Implement DIR_USER_DESKTOP.
DIR_USER_DESKTOP,
// TODO(crbug.com/1184980), Do not define FILE_MODULE and DIR_MODULE.
FILE_MODULE, DIR_MODULE};
DIR_USER_DESKTOP};
#else
constexpr std::array<int, 0> kUnsupportedKeys = {};
#endif // defined(OS_ANDROID)
Expand Down
5 changes: 5 additions & 0 deletions base/profiler/stack_sampling_profiler_test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,13 @@ NativeLibrary LoadOtherLibrary() {
// macros in a function returning non-null.
const auto load = [](NativeLibrary* library) {
FilePath other_library_path;
#if defined(OS_FUCHSIA)
// TODO(crbug.com/1262430): Find a solution that works across platforms.
ASSERT_TRUE(PathService::Get(DIR_ASSETS, &other_library_path));
#else
// The module is next to the test module rather than with test data.
ASSERT_TRUE(PathService::Get(DIR_MODULE, &other_library_path));
#endif // defined(OS_FUCHSIA)
other_library_path = other_library_path.AppendASCII(
GetLoadableModuleName("base_profiler_test_support_library"));
NativeLibraryLoadError load_error;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ struct Environment {
base::PathService::CheckedGet(ui::UI_TEST_PAK);
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);

base::FilePath pak_path = base::PathService::CheckedGet(base::DIR_MODULE);
base::FilePath pak_path = base::PathService::CheckedGet(base::DIR_ASSETS);
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
pak_path.AppendASCII("components_tests_resources.pak"),
ui::kScaleFactorNone);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,10 @@ const struct {
{chrome::DIR_DEFAULT_DOWNLOADS_SAFE, nullptr, kDontBlockChildren},
// The Chrome installation itself should not be modified by the web.
{base::DIR_EXE, nullptr, kBlockAllChildren},
#if !defined(OS_FUCHSIA)
{base::DIR_MODULE, nullptr, kBlockAllChildren},
#endif
{base::DIR_ASSETS, nullptr, kBlockAllChildren},
// And neither should the configuration of at least the currently running
// Chrome instance (note that this does not take --user-data-dir command
// line overrides into account).
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/load_library_perf_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "base/scoped_native_library.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "media/media_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/perf/perf_result_reporter.h"
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/vr/test/vr_test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void VrTestSuite::Initialize() {
ui::RegisterPathProvider();
base::PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path);
#else
base::PathService::Get(base::DIR_MODULE, &pak_path);
base::PathService::Get(base::DIR_ASSETS, &pak_path);
#endif
ui::ResourceBundle::InitSharedInstanceWithPakPath(
pak_path.AppendASCII("vr_test.pak"));
Expand Down
5 changes: 2 additions & 3 deletions chrome/common/chrome_paths.cc
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,14 @@ bool PathProvider(int key, base::FilePath* result) {
return base::PathService::Get(chrome::DIR_USER_DATA, result);
#else
// Debug builds write next to the binary (in the build tree)
// TODO(crbug.com/1262330): implement workable solution for Fuchsia.
#if defined(OS_MAC)
// Apps may not write into their own bundle.
if (base::mac::AmIBundled()) {
return base::PathService::Get(chrome::DIR_USER_DATA, result);
}
return base::PathService::Get(base::DIR_EXE, result);
#else
return base::PathService::Get(base::DIR_EXE, result);
#endif // defined(OS_MAC)
return base::PathService::Get(base::DIR_EXE, result);
#endif // NDEBUG
}

Expand Down
2 changes: 2 additions & 0 deletions chrome/test/base/chrome_test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ void ChromeTestSuite::Initialize() {

if (!browser_dir_.empty()) {
base::PathService::Override(base::DIR_EXE, browser_dir_);
#if !defined(OS_FUCHSIA)
base::PathService::Override(base::DIR_MODULE, browser_dir_);
#endif // !defined(OS_FUCHSIA)
}

// Disable external libraries load if we are under python process in
Expand Down
2 changes: 1 addition & 1 deletion chrome/test/base/web_ui_browser_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void BaseWebUIBrowserTest::SetUpOnMainThread() {
JavaScriptBrowserTest::SetUpOnMainThread();

base::FilePath pak_path;
ASSERT_TRUE(base::PathService::Get(base::DIR_MODULE, &pak_path));
ASSERT_TRUE(base::PathService::Get(base::DIR_ASSETS, &pak_path));
pak_path = pak_path.AppendASCII("browser_tests.pak");
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
pak_path, ui::kScaleFactorNone);
Expand Down
14 changes: 12 additions & 2 deletions chrome/test/chromedriver/chrome/chrome_finder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
Expand Down Expand Up @@ -149,12 +150,21 @@ bool FindChrome(base::FilePath* browser_exe) {
#endif
};

LOG_IF(ERROR, browser_exes_array[0].empty()) << "Unsupported platform.";

std::vector<base::FilePath> browser_exes(
browser_exes_array, browser_exes_array + base::size(browser_exes_array));
base::FilePath module_dir;
#if defined(OS_FUCHSIA)
// Use -1 to allow this to compile.
// TODO(crbug.com/1262176): Determine whether Fuchsia should support this and
// if so provide an appropriate implementation for this function.
if (base::PathService::Get(-1, &module_dir)) {
#else
if (base::PathService::Get(base::DIR_MODULE, &module_dir)) {
for (size_t i = 0; i < browser_exes.size(); ++i) {
base::FilePath path = module_dir.Append(browser_exes[i]);
#endif
for (const base::FilePath& file_path : browser_exes) {
base::FilePath path = module_dir.Append(file_path);
if (base::PathExists(path)) {
*browser_exe = path;
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class MojoJSInterfaceBrokerBrowserTest : public InProcessBrowserTest {

void SetUpOnMainThread() override {
base::FilePath pak_path;
ASSERT_TRUE(base::PathService::Get(base::DIR_MODULE, &pak_path));
ASSERT_TRUE(base::PathService::Get(base::DIR_ASSETS, &pak_path));
pak_path = pak_path.AppendASCII("browser_tests.pak");
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
pak_path, ui::kScaleFactorNone);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void MediaRouterIntegrationBrowserTest::CheckStartFailed(
base::FilePath MediaRouterIntegrationBrowserTest::GetResourceFile(
base::FilePath::StringPieceType relative_path) const {
const base::FilePath full_path =
base::PathService::CheckedGet(base::DIR_MODULE)
base::PathService::CheckedGet(base::DIR_ASSETS)
.Append(kResourcePath)
.Append(relative_path);
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class MediaRouterIntegrationOneUABrowserTest
// Set up embedded test server to serve offscreen presentation with relative
// URL "presentation_receiver.html".
base::FilePath resource_dir =
base::PathService::CheckedGet(base::DIR_MODULE)
base::PathService::CheckedGet(base::DIR_ASSETS)
.Append(FILE_PATH_LITERAL("media_router/browser_test_resources/"));
embedded_test_server()->ServeFilesFromDirectory(resource_dir);
ASSERT_TRUE(embedded_test_server()->Start());
Expand Down
8 changes: 4 additions & 4 deletions chromecast/browser/cast_browser_main_parts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ base::FilePath GetApplicationFontsDir() {
std::string fontconfig_sysroot;
if (env->GetVar("FONTCONFIG_SYSROOT", &fontconfig_sysroot)) {
// Running with hermetic fontconfig; using the full path will not work.
// Assume the root is base::DIR_MODULE as set by
// Assume the root is base::DIR_ASSETS as set by
// test_fonts::SetUpFontconfig().
return base::FilePath("/fonts");
} else {
base::FilePath dir_module;
base::PathService::Get(base::DIR_MODULE, &dir_module);
return dir_module.Append("fonts");
base::FilePath dir_assets;
base::PathService::Get(base::DIR_ASSETS, &dir_assets);
return dir_assets.Append("fonts");
}
}

Expand Down
6 changes: 3 additions & 3 deletions chromeos/components/chromeos_components_test_suite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ void InitI18n() {
ASSERT_TRUE(base::PathService::Get(ui::UI_TEST_PAK, &ui_test_pak_path));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ui_test_pak_path);

base::FilePath dir_module_path;
ASSERT_TRUE(base::PathService::Get(base::DIR_MODULE, &dir_module_path));
base::FilePath dir_assets_path;
ASSERT_TRUE(base::PathService::Get(base::DIR_ASSETS, &dir_assets_path));
base::FilePath chromeos_test_strings_path =
dir_module_path.Append(FILE_PATH_LITERAL("chromeos_test_strings.pak"));
dir_assets_path.Append(FILE_PATH_LITERAL("chromeos_test_strings.pak"));
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
chromeos_test_strings_path, ui::kScaleFactorNone);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class DomDistillerDistillablePageUtilsTest : public content::ContentBrowserTest,
#if defined(OS_ANDROID)
CHECK(base::PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_dir));
pak_dir = pak_dir.Append(FILE_PATH_LITERAL("paks"));
#else
#elif defined(OS_MAC)
base::PathService::Get(base::DIR_MODULE, &pak_dir);
#else
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
#endif // OS_ANDROID
pak_file =
pak_dir.Append(FILE_PATH_LITERAL("components_tests_resources.pak"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,10 @@ class DomDistillerJsTest : public content::ContentBrowserTest {
#if defined(OS_ANDROID)
CHECK(base::PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_dir));
pak_dir = pak_dir.Append(FILE_PATH_LITERAL("paks"));
#else
#elif defined(OS_MAC)
base::PathService::Get(base::DIR_MODULE, &pak_dir);
#else
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
#endif // OS_ANDROID
pak_file =
pak_dir.Append(FILE_PATH_LITERAL("components_tests_resources.pak"));
Expand Down
4 changes: 3 additions & 1 deletion components/dom_distiller/content/browser/test/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ void AddComponentsResources() {
#if defined(OS_ANDROID)
CHECK(PathService::Get(base::DIR_ANDROID_APP_DATA, &pak_dir));
pak_dir = pak_dir.Append(FILE_PATH_LITERAL("paks"));
#else
#elif defined(OS_MAC)
PathService::Get(base::DIR_MODULE, &pak_dir);
#else
PathService::Get(base::DIR_ASSETS, &pak_dir);
#endif // OS_ANDROID
pak_file =
pak_dir.Append(FILE_PATH_LITERAL("components_tests_resources.pak"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ std::unique_ptr<DomDistillerService> CreateDomDistillerService(
void AddComponentsTestResources() {
base::FilePath pak_file;
base::FilePath pak_dir;
base::PathService::Get(base::DIR_MODULE, &pak_dir);
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
pak_file =
pak_dir.Append(FILE_PATH_LITERAL("components_tests_resources.pak"));
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
Expand Down
2 changes: 1 addition & 1 deletion components/exo/wayland/fuzzer/server_environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void ServerEnvironment::SetUpOnUIThread(base::WaitableEvent* event) {
// Load ash test resources and en-US strings; not 'common' (Chrome)
// resources.
base::FilePath path;
base::PathService::Get(base::DIR_MODULE, &path);
base::PathService::Get(base::DIR_ASSETS, &path);
base::FilePath ash_test_strings =
path.Append(FILE_PATH_LITERAL("ash_test_strings.pak"));
ui::ResourceBundle::InitSharedInstanceWithPakPath(ash_test_strings);
Expand Down
2 changes: 1 addition & 1 deletion components/ntp_tiles/icon_cacher_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class IconCacherTestPopularSites : public IconCacherTestBase {
#if defined(OS_ANDROID)
base::PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &pak_path);
#else
base::PathService::Get(base::DIR_MODULE, &pak_path);
base::PathService::Get(base::DIR_ASSETS, &pak_path);
#endif

base::FilePath ui_test_pak_path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class PdfAccessibilityTreeTest : public content::RenderViewTest {
content::RenderViewTest::SetUp();

base::FilePath pak_dir;
base::PathService::Get(base::DIR_MODULE, &pak_dir);
base::PathService::Get(base::DIR_ASSETS, &pak_dir);
base::FilePath pak_file =
pak_dir.Append(FILE_PATH_LITERAL("components_tests_resources.pak"));
ui::ResourceBundle::GetSharedInstance().AddDataPackFromPath(
Expand Down
2 changes: 1 addition & 1 deletion device/test/run_all_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DeviceTestSuite : public base::TestSuite {
#if defined(OS_ANDROID)
ASSERT_TRUE(base::PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &path));
#else
ASSERT_TRUE(base::PathService::Get(base::DIR_MODULE, &path));
ASSERT_TRUE(base::PathService::Get(base::DIR_ASSETS, &path));
#endif // defined(OS_ANDROID)
base::FilePath bluetooth_test_strings =
path.Append(FILE_PATH_LITERAL("bluetooth_test_strings.pak"));
Expand Down
2 changes: 1 addition & 1 deletion extensions/shell/app/shell_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void InitLogging() {
// Returns the path to the extensions_shell_and_test.pak file.
base::FilePath GetResourcesPakFilePath() {
base::FilePath extensions_shell_and_test_pak_path;
base::PathService::Get(base::DIR_MODULE, &extensions_shell_and_test_pak_path);
base::PathService::Get(base::DIR_ASSETS, &extensions_shell_and_test_pak_path);
extensions_shell_and_test_pak_path =
extensions_shell_and_test_pak_path.AppendASCII(
"extensions_shell_and_test.pak");
Expand Down
6 changes: 6 additions & 0 deletions headless/lib/headless_content_main_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,13 @@ void HeadlessContentMainDelegate::InitLogging(

// Otherwise we log to where the executable is.
if (log_path.empty()) {
#if defined(OS_FUCHSIA)
// TODO(crbug.com/1262330): Use the same solution as used for LOG_DIR.
// Use -1 to allow this to compile.
if (base::PathService::Get(-1, &log_path)) {
#else
if (base::PathService::Get(base::DIR_MODULE, &log_path)) {
#endif
log_path = log_path.Append(log_filename);
} else {
log_path = log_filename;
Expand Down
Loading

0 comments on commit d798600

Please sign in to comment.